cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE example GPIO_IOToggle_TrustZone ,Error: Data mismatch found at address 0x0C000000 (byte = 0xFF instead of 0x00)

Jwu.6
Associate II

Hi,

I try to run GPIO\GPIO_IOToggle_TrustZone in the STM32CubeIDE, but fail.

code:

STM32Nucleo\STM32Cube_FW_L5_V1.4.0\Projects\NUCLEO-L552ZE-Q\Examples\GPIO\GPIO_IOToggle_TrustZone

Follow the readme steps without modifying any code or configuration。

After build, Select the xxxxx_S project and select "Debug ,select startup , add NS project

Fail at download:

Error: Data mismatch found at address 0x0C000000 (byte = 0xFF instead of 0x00)

The others example without TZ run OK.

This is my first time to use this platform. Is there anything else that needs to be configured, or something wrong with the operation,

Console output:

Erasing memory corresponding to segment 0:

Erasing internal memory sectors [0 4]

Erasing memory corresponding to segment 1:

Erasing internal memory sector 124

Download in Progress:

File download complete

Time elapsed during download operation: 00:00:00.328

Verifying ...

Error: Data mismatch found at address 0x0C000000 (byte = 0xFF instead of 0x00)

Error: Download verification failed

Encountered Error when opening D:\software\ST\STM32CubeIDE_1.6.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_1.6.0.202101291314\tools\bin\STM32_Programmer_CLI.exe

Error in STM32CubeProgrammer

Debugger connection lost.

Shutting down...

1 ACCEPTED SOLUTION

Accepted Solutions
Jwu.6
Associate II

Find the cause of the problem, need to do some basic configuration, after config, it works ok

To match the default partitioning, the STM32L5xx Series devices must have the following user option bytes set:

TZEN=1 (TrustZone-enabled device)

DBANK=1 (Dual bank Flash configuration)

SECWM1_PSTRT=0x0 SECWM1_PEND=0x7F (all 128 pages of Flash Bank1 set as secure)

SECWM2_PSTRT=0x1 SECWM2_PEND=0x0 (no page of Flash Bank2 set as secure, hence Bank2 is non-secure)

View solution in original post

1 REPLY 1
Jwu.6
Associate II

Find the cause of the problem, need to do some basic configuration, after config, it works ok

To match the default partitioning, the STM32L5xx Series devices must have the following user option bytes set:

TZEN=1 (TrustZone-enabled device)

DBANK=1 (Dual bank Flash configuration)

SECWM1_PSTRT=0x0 SECWM1_PEND=0x7F (all 128 pages of Flash Bank1 set as secure)

SECWM2_PSTRT=0x1 SECWM2_PEND=0x0 (no page of Flash Bank2 set as secure, hence Bank2 is non-secure)