cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Nucleo-F411 not jumping to main (or not saving program) if not debugging?

DSabo
Associate III

I have a Nucleo-F411RE and can debug and program ok (using arm cross gcc, eclipse, OpenOCD) and everything works fine.

However, If I just power it but don't debug through eclipse, the board doesn't do anything. LD1 and LD3 are solid red.

My guess is that when I'm debugging it isn't actually flashing the board, or for some reason it isn't jumping to main from the reset vector when I'm not debugging.

Not sure how to approach this.

Maybe related, maybe not... I tried to use the ST-LINK Utility to flash the output file, but I get a No ST_LINK detected error and it won't connect.

EDIT

It looks like the program counter when I start to debug at main is 0x8002810 so it looks like it is running from flash. I just read about the boot pins so I have connected boot0 to gnd but see no difference.

12 REPLIES 12
DSabo
Associate III

It looks like it's failing the check below in HAL_RCC_OscConfig.

    if(__HAL_RCC_GET_SYSCLK_SOURCE()!= RCC_CFGR_SWS_PLL)

When I debug, the sys clk source returns 0 (HSI) but when cycle power and just connect to it without flashing the image that returns 8 (PLL).

Be wary about transferring control in interrupt/callbacks, or from an RTOS that has a system/user execution state which will block access to protected instructions.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
DSabo
Associate III

Hi,

I'm not sure what you mean