cancel
Showing results for 
Search instead for 
Did you mean: 

The STM32L562E-DK cannot use STM32CubeProgrammer to download user code to flash

MelodyZ
Associate II

We encountered an issue with the STM32L562E-DK board when attempting to clear TZEN by changing the RDP level from 0 to 1 and then back to 0. Using the STM32CubeProgrammer, we can connect to the device via ST-LINK. The memory blank check indicates flash is empty, but the first byte verification fails during download. Additionally, the PC register value is 0xFFFF_FFFE, and the SP register value is 0xFFFF_FFFC.

Could you please provide guidance on resolving this issue?

5 REPLIES 5
Imen.D
ST Employee

Hello @MelodyZ 

Try performing a regression to RDP Level 0 (option byte value 0xAA) with a full flash erase using STM32CubeProgrammer. 

If the device does not recover, boot from RSS using BOOT0 and ensure correct option bytes. 

For more details, please refer to this AN5347 in section 9 TrustZone deactivation, this may help you.

This article describes the nature of when the lock state occurs and how to best avoid and alleviate the situation.

 

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

I have set the option bytes with TZEN=0 and RDP=0, but why does the first byte still fail verification when starting from the on-chip flash?

I hope this helps with your technical support communication!

failfail

Imen.D
ST Employee

Hi @MelodyZ ,

Try program option bytes through JTAG/SWD and use "Hot plug" mode for option byte programming.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

I have used "Hot plug" to connect via JTAG/SWD, as shown in the last picture. Could you please advise which other option bytes need modification?

Thank you~

Hello @MelodyZ

Since TZEN = 0, the address to download at is @0x08000000 not @0x0C000000, please make sure to have TrustZone disabled on your project too.

Aziz


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.