Skip to content

Recover from stuck in reboot loop

giuliomoro edited this page Nov 9, 2018 · 7 revisions

In case your board is set to run a program on startup and this program is too CPU intensive, you may struggle to get back control of the board. Here are some ways you can do it, assuming your board is in the standard configuration. The basic principle is: press the button on the Bela cape to kill the currently running program. This will temporarily free up some resources, however the project will restart immediately once killed. Holding the button down is not an option, as that will trigger a shutdown of the board if you hold it for more than 2 seconds.

Getting in

Quick try:

  • bash The Button very often. If you are quick enough, systemctl will realize that the bela_startup service is quitting too quickly and will temporarily disable it (this will NOT work on images before v0.3). This is not guaranteed to succeed (especially if the process does lots of preparation before calling render(), e.g.: loading many files from disk).

If this fails, go for the following:

  • if you have a terminal emulator at hand, run the line ssh -o StrictHostKeyChecking=no -o ConnectTimeout=1200 [email protected] make -C Bela stop
  • otherwise try to load the IDE page in a browser

If the board is actually very busy, none of the above will succeed, but at least you got them started. The game now is to get back CPU time in small chunks, which eventually will be enough for us to stop the running process.

For the terminal + ssh approach you can just press the button often, the ssh connection will (sooner or later) be established and the make command will stop the program. One possible failure here is if your ssh connection times out before you got enough chunks of CPU time. In this (unlikely) case, just increase the ConnectTimeout value at the command line

  • press The Button often. The program will restart immediately, but this will give some breath to the rest of the operating system, so that you may be able to finally load the IDE or manage to ssh into the board.

Once you are in

Run make -C /root/Bela stop nostartup to disable the program running at startup. You could also do this from the IDE if you manage to get it to show.

Clone this wiki locally