Right, so I am looking at the schematics again and I think the issue is that button pins are in a pull-down configuration instead of pull-up as the button on the cape itself. This means that as far as the bela-cape-btn program is concerned, the button is pressed when it is not actually pressed and viceverse. So, first off, to get this to work again you should be able to boot the board while hold pressing the button. Keep it pressed until you manage to ssh in and run systemctl stop bela_button. Then you should be able to release the button and the board should stay up. If holding the button is complicated you can disconnect your Bela from Pepper and run a jumper wire from 3v3 (P9.03) to the pin (P8.27).

Once you re-acquire control of the board, edit /lib/systemd/system/bela_button.service adding --pressed 1 to the argument list. This will tell it that the button is pressed when a 1 is read (default is opposite, which is causing the current behaviour).

I think this should work as far as the systemd service is concerned. However, the Bela program will fail to start saying "button pressed ... exit". I don't have a command line option / setting to fix that yet. For now you should make a manual change to /root/Bela/core/PRU.cpp: the line that reads if(stopButton.read() == 0){ should become if(stopButton.read() == 1){. If this works, I can add a command-line option for it that can be stored in belaconfig in a couple of weeks from now.

    PS: I fixed the Pd pin number in the above table (was 34, it actually is 23)

      giuliomoro Yes i had used 23 already, assumed a typo. Which of the three buttons do i need to hold? Reset, Power or Bela button? - if i hold the Bela button th unit dosn't reach any state that i can ssh into -

      EDIT trying jumper wire

      the rightmost button on the front panel: I understand that that is the one you have assigned to bela-cape-btn after editing the .service file?

        giuliomoro Jumper wire helps. But "/root/Bela/core/PRU.cpp" contains no line for the stopButton. I went through some of the /include files but couldn't find that line either.

        giuliomoro and yes, the rightmost button on Pepper's front panel. If i could wish for sthg i would love to be able for this button only to fire "next patch" in loop mode, when i have pressd it for a minimum of a second. Just slipping this in while we're at it. Thank you for walking me through.

        hmmm maybe you have an oldish version of the codebase. It looked like this before:

                               if(belaCapeButton.read() == 0){

        again, make it == 1 instead.

        Actually now that I think of it you should probably update your Bela code anyhow, or the whole belaconfig stuff may not work.

          giuliomoro You were right, it was "if(stopButton.read()..." - changed value to 1. Have to reattach to Pepper to see what it does, bare with me...

          After the stopButton.read change in PRU.cpp IDE starts up, but fails to run, in single patch mode i get this:

          Nov 03 17:17:22 bela stdbuf[969]: Button pressed, quitting
          Nov 03 17:17:22 bela stdbuf[969]: make: warning: Clock skew detected. Your build may be incomplete.
          Nov 03 17:17:22 bela stdbuf[969]: make: Leaving directory '/root/Bela'
          Nov 03 17:17:23 bela systemd[1]: bela_startup.service: Service hold-off time over, scheduling restart.
          Nov 03 17:17:23 bela systemd[1]: Stopped Run Bela at boot.
          Nov 03 17:17:23 bela systemd[1]: bela_startup.service: Start request repeated too quickly.
          Nov 03 17:17:23 bela systemd[1]: Failed to start Run Bela at boot.
          Nov 03 17:17:23 bela systemd[1]: bela_startup.service: Unit entered failed state.
          Nov 03 17:17:23 bela systemd[1]: bela_startup.service: Failed with result 'start-limit-hit'.

          Ay. i guess i will return everything to initial state now.

          Bela version is v0.3.8b btw

          Does it run when you run the project from the IDE?

            giuliomoro No, the messages above came from the IDE. It also doesn't matter, if i choose single patch or loop mode. The essage "bela stdbuf[969]: Button pressed, quitting" appears regardless.

            yeah but what if you start a program from the IDE? That's the first step we need to get to work before the rest falls into place.In particular, I would like to make sure that PRU.cpp got rebuilt after your changes. You could do rm /root/Bela/build/core/PRU.o before starting a project and that should force a rebuild of PRU.cpp.

            I did start from the IDE, too. rm /root/Bela/build/core/PRU.o gives me a "no such file or directory"

            and when you start the program from the IDE it should show that it rebuilds PRU.cpp, is that the case?

            Okay IDE is single patch mode is doing something

            Building PRU.cpp...
            ...done
            Linking...
            ...done
            Enabling Bela at startup in a loop...
            project set to run on boot succesfully

            Running several different patches then each say

            Button pressed, quitting
            ...done
            Enabling Bela at startup in a loop...
            Bela stopped
            project set to run on boot succesfully

            All in IDE.

              jayrope Building PRU.cpp...
              ...done
              Linking...
              ...done
              Enabling Bela at startup in a loop...
              project set to run on boot succesfully

              does the project run OK here?

              jayrope Running several different patches then each say

              If the answer above is yes, try cleaning each project and rebuilding it ?

                giuliomoro No, none of the projects run (all PD). Upon running them they load and then quit saying

                Button pressed, quitting
                Bela stopped

                EDIT: This also goes for the PD patches in the examples

                ok, what is the content of /root/.bela/belaconfig at the moment?

                Also i have removed PRU.o again (rm /root/Bela/build/core/PRU.o) to force rebuild PRU.cpp, the rebuild happens, but at last

                Button pressed, quitting
                Bela stopped

                appear again