cancel
Showing results for 
Search instead for 
Did you mean: 

New STM32L431KC does not program or run unless mass erase is performed first.

gerhard
Associate II

When first programming a New STM32L431KC, it does not program or run unless mass erase is performed first.

I use IAR and STLINK/V2

From IAR, I try:

a) Download program - uC does not run, even after reset

b) Start debugging session - Does not execute code. Gets stuck "hang" on HAL_Delay(xx) statement.

When I use STM32MXProgrammer and ERASE all flash, then the programming works, and I can download from IAR.

Any help appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions

I don't use IAR but you can try to power-cycle the board after first programming.

Alternatively, change explicitly the 0x0000'0000 remap to user FLASH at the beginning of your program; or, maybe better, set VTOR to 0x0800'0000.

JW

View solution in original post

2 REPLIES 2

I don't use IAR but you can try to power-cycle the board after first programming.

Alternatively, change explicitly the 0x0000'0000 remap to user FLASH at the beginning of your program; or, maybe better, set VTOR to 0x0800'0000.

JW

Thanks, and yes that works.

The F051, L051, L052 and others does not do that.

The only difference on the boards is the on the L431 I use a 32KHz resonator.

Perhaps that is it.