2025-08-10 9:26 AM
I am using an STM32G431CBT6. I wrote code to toggle an LED in stm32cubeide. When I build the project in STM32G431, the LED stays permanently ON. However, when I power the board OFF and ON again, the LED starts toggling. Why is this happening?
2025-08-10 11:13 AM
Hi @Sethnittu ,
Are you sure that you have started your application execution after downloading your build? If you are running in debug mode you'll need to start execution.
The next thing to check would be to put a breakpoint at the point where your code writes to the GPIO that is wired to the led, and step through execution.
I think there's just a basic misunderstanding about how to use CubeIDE going on here. You can find many YouTube video tutorials that may be helpful.
Good luck!
2025-08-10 12:46 PM
Hi @bramble,
Thank you for your reply. Actually, when I power my controller device OFF and ON, the LED blinks, but when I build and run the code, it doesn’t work it stays permanently high. Why?
2025-08-10 1:20 PM
Maybe it toggles to fast to see by eye. Observe using oscilloscope or logic analyzer. Single-strep code in debugger.
Post more details, include source code.
JW