cancel
Showing results for 
Search instead for 
Did you mean: 

Must reconnect Nucleo to USB in order to run code

Rshaw.1
Associate II

I have a simple cubemx generated project where i simply toggle led and printf to my external console. After programming the program isnt running. i must reconnect the st-link usb interface and then the program will run normally. Simply pressing reset after programming doesnt cause the code to run.

Also i notice that the LD8 green led is on in the non working case. After reconnecting power LD8 is off and the program is running correctly.

I would expect the code to start running after being programmed with st-link.

Nucleo-L4R5ZI-P (hardware in factory state re jumpers/solder bridges)

In MX i have defined the sys/debug as "serial wire"

Connected the uart pins to the st-link uart interface.

GPIO connected to PB14 for Red LED drive.

4 REPLIES 4

I didn't try to interpret the symptoms you observe.

Try to have a look at https://community.st.com/s/question/0D53W00000raYd2SAE/intermittent-break-at-address-0x1fff51f4-with-no-debug

JW

Thanks for the response

More details
Stm32cubeide Version: 1.7.0
Build: 10852_20210715_0634 (UTC)
cubeMX design started for just the processor without selecting the Nucleo board to which I’m working on. Wanted a bare minimum MX project.

The info you suggested includes elements of what I’m seeing. If I run under the debugger and then pause it does show a similar location of "0x1fff16dc".

I’m still seeing the problem: after programming, the code doesn’t run unless I remove the usb/power and then reconnect, then the code runs as programmed.

Steps taken:
1. I replaced the x470/471.stldr files with ones noted in your link
2. SB jumpers on this Nucleo board are different from another Nucleo-L4a6zg that I believe worked as expected (ran correct code after programming). I isolated the net PH3-BOOT0 from the other nets and replaced 10K pulldown with 0 ohm. None of the nets connected to BOOT0 are configured.

Check firmware on the ST-LINK side, several versions clamp NRST when not connected to a PC.

There should also be some SB to disconnect the NRST line from the ST-LINK STM32F103 to the Target MCU

I don't think BOOT0 should be an issue, but make sure Error Handler and Hard Fault Handlers suitably alert if you end up in those

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
A few more observations.

Building a simple project on Nucleo-l4a6zg works as expected (starts running and can be reset with reset button)
The same code on Nucle0-l4r5zi-p has the noted issues(doesn’t run after programming nor runs with reset. Removing power with jp6 does properly reset and start running)

Again both projects are built from cubemx and simply toggle the red led.

Nucleo-l4r5zi-p supports external smps and there are different jumper and ic loadings.