cancel
Showing results for 
Search instead for 
Did you mean: 

My board can no longer run the program I uploaded to it earlier

HeroNthn
Associate

Hi,

Here's the thing. The program is supposed to change the speed of the blinking of the user green led when you click on the blue button. I made it a week ago, tested it and all was going well. However I dropped the board this morning, four pins (2 from CN12 and 2 others from CN11) were a bit twisted but I managed to put them back (wasn't a big of a deal). I checked if there were any missing components but there weren't any. I wanted to make sure nothing was wrong so I connected the board to my computer to see (the last uploaded program to the board is the one I mentioned earlier). I was surprised by the fact that the green led was not even blinking (it is supposed to, since when powered the last uploaded program in the flash memory is supposed to be ran). So I uploaded the same program to the board again, the led was blinking but if i disconnect the board from my computer and plug it again, the led's no longer blinking. It stops blinking as well if i click on the reset button (black button on the right of the blue one). Therefore I've deduced from it that the board no longer boots from the main flash  memory since the led is no longer blinking. I've looked up things like boot0 in the reference manual, I wanted to check if the pin was set to 0 but couldn't do so. I've found out about STM32CubeProgrammer a bit earlier, I used it and everything seemed fine. In the option bytes menu, nBOOT1 was checked, meaning that the board would boot from flash memory if BOOT0 = 0. This means if the BOOT0 pin is connected to ground, however before I dropped the board, there was no "jumper" connecting it to the GND pin. 

6 REPLIES 6
TDK
Guru

You could really present the issue with more clarity. Hard to answer these "X doesn't work, help" posts in a manner that is useful to the asker.

  • What is the program supposed to do?
  • What does "not working" mean here? 
  • Does the board ever work? In what cases?
  • Can you connect over STM32CubeProgrammer?
If you feel a post has answered your question, please click "Accept as Solution".

Here's the thing. The program is supposed to change the speed of the blinking of the user green led when you click on the blue button. I made it a week ago, tested it and all was going well. However I dropped the board this morning, four pins (2 from CN12 and 2 others from CN11) were a bit twisted but I managed to put them back (wasn't a big of a deal). I checked if there were any missing components but there weren't any. I wanted to make sure nothing was wrong so I connected the board to my computer to see (the last uploaded program to the board is the one I mentioned earlier). I was surprised by the fact that the green led was not even blinking (it is supposed to, since when powered the last uploaded program in the flash memory is supposed to be ran). So I uploaded the same program to the board again, the led was blinking but if i disconnect the board from my computer and plug it again, the led's no longer blinking. It stops blinking as well if i click on the reset button (black button on the right of the blue one). Therefore I've deduced from it that the board no longer boots from the main flash  memory since the led is no longer blinking. I've looked up things like boot0 in the reference manual, I wanted to check if the pin was set to 0 but couldn't do so. I've found out about STM32CubeProgrammer a bit earlier, I used it and everything seemed fine. In the option bytes menu, nBOOT1 was checked, meaning that the board would boot from flash memory if BOOT0 = 0. This means if the BOOT0 pin is connected to ground, however before I dropped the board, there was no "jumper" connecting it to the GND pin. I'll make my posts more explicit next time, I apologize for not being clear earlier.

Thank you for the explanation.

There are a few ways to figure out if the cpu is in the bootloader or flash memory. Here is one of them:

In STM32CubeProgrammer, connect over SWD, then go to the CPU tab (on left) and note the value of the PC register. If the code is executing from flash, it will be 0x08xxxxxx. If it's in the bootloader, it will be 0x1FFFxxxx. I suspect it's booting from user flash. (Note that once you connect, the core will stop executing whatever it's doing but the registers will retain their values).

If it's booting from flash, but your program is not running, it's likely an issue with the various clocks not stabilizing during startup. You can change your program to use the internal LSI clock and not use HSE or LSE to see if this resolves the issue. Otherwise, you can debug the program (in STM32CubeIDE) and see which clock is causing issues and go from there.

If you feel a post has answered your question, please click "Accept as Solution".
HeroNthn
Associate

The code is executing from flash since PC's value starts with 0x08. However I'm not sure I can have a view of the clocks while in debug mode. I could only open the .ioc file and check the clock configuration tab I can't modify anything in here.

AScha.3
Chief III

Hi,

>My board

is - which board ? and cpu ?

If you feel a post has answered your question, please click "Accept as Solution".
HeroNthn
Associate

It is the Nucleo-L476RG (Nucleo-64), cpu is STM32L476RG