Skip to main content
Ole Thomsen
Associate II
December 20, 2019
Question

Debugging, but not running.

  • December 20, 2019
  • 4 replies
  • 2834 views

Hey,

I build my own STM32 board with the STM32L011G3 and started testing with a simple blinking program via SWD and ST-Link V2.  When I'm debugging it, everything works fine, but when I use the run command in SW4STM32 the LED lights up, but does not toggle.

Is there any configuration I shood change or any known problem?

Thanks for help :)

This topic has been closed for replies.

4 replies

Bob S
Super User
December 20, 2019

Probably some initialization that the debugger does that your code does not, or the interrupt vector table is not correct. If you can, while running the program under the debugger, toggle the reset line to the CPU (if you have a switch on your board that makes it easy, otherwise you need to use a wire). Does the LED blink or it is on solid? If on solid, halt the debugger and see what is (or isn't) happening.

Tesla DeLorean
Guru
December 20, 2019

Some models need a power cycle if they previously had a blank FLASH, as the ROM code will be run.

More generally, make sure BOOT(0) pin is pulled LOW to assure FLASH code is run

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Ole Thomsen
Associate II
December 20, 2019

The BOOT(0) is pulled down. In the meantime everything works. I have no clue what the problem was. But plugging off the board and repowering it makes the program work.

In the debugging mode there was a blinking light, but after running it, it just lights up and never goes off again (HAL_Delay(1000)) but after repowering it blinks like it should. Thanks for your help.

Mohammed Eshaq
Associate II
March 16, 2022

I have the same issue (posted here: MCU works with DEBUG but not with RUN - Reset is required with RUN (st.com)).

Did you manage to solve the problem? Or you are still using power cycling to start your code?