cancel
Showing results for 
Search instead for 
Did you mean: 

Dear ST staff, I am using the nucleo board STM32L476RG to flash a STM32L476ZGT6. I once wrongly connected the SWD pins. I am now only able to erase the microcontroller flash: I cannot flash the microcontroller again. Do you have a clue?

PFavr.1
Associate II

Note:The hardware is still functional, I made sure of it.

5 REPLIES 5

Can you connect to the target e.g. in STLink Utility?

JW

PFavr.1
Associate II

Hello Jan,

Thanks for your feedback.

I could connect to the target via ST Link:

11:09:56 : Connected via SWD.

11:09:56 : SWD Frequency = 4,0 MHz.

11:09:56 : Connection mode : Connect Under Reset.

11:09:56 : Debug in Low Power mode enabled

PF

Most people here are not ST staff.

> I could connect to the target via ST Link:

And what are the error messages when you try to flash ?

PFavr.1
Associate II

Hello,

The problem came from specific backup registers that needed to be reset.

You can find below the SW excerpt related to the needed action:

HAL_Init(); 

HAL_DBGMCU_EnableDBGStandbyMode();

__HAL_RCC_BACKUPRESET_FORCE();

__HAL_RCC_BACKUPRESET_RELEASE();

Thank you all for your help,

PF

Strap the BOOT0 pin HIGH, connect, do a mass erase, and set option bytes to defaults.​

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