2025-02-21 04:06 AM - edited 2025-02-21 09:30 AM
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.
2025-02-21 08:55 AM - edited 2025-02-21 08:55 AM
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.
2025-02-21 09:26 AM
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.
2025-02-21 09:43 AM - edited 2025-02-21 09:44 AM
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.
2025-02-21 11:43 AM
2025-02-21 12:41 PM
Hi,
>My board
is - which board ? and cpu ?