2025-11-11 1:29 AM
Our own non-secure application is based on "SMAK_Appli" in the STM32TRUSTEE-SM example and in principle, it works, but debugging is giving me issues. This is with STM32CubeIDE latest version and all tools software and firmware updated to their latest versions, too.
Issue 1: Using STLINK-V3 to start debugging, whenever there has been a code change, the first attempt results in a verification error (see log below) and the second attempt then works. This is 100% consistent and terribly annoying since starting the non-secure debugging session is very slow to begin with.
Issue 2: Using J-Link to start debugging, it claims flash was programmed (very fast) and debugging seems to work at first, but I found that flash programming was not effective. The flash content is always what it was programmed with using STLINK. So if I want to use J-Link, I have to program with STLINK (twice), then switch to J-Link but I cannot successfully program changed flash content with J-Link.
Are these issues know and are there any ways to improve?
STMicroelectronics ST-LINK GDB server. Version 7.11.0
Copyright (c) 2025, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
-------------------------------------------------------------------
STM32CubeProgrammer v2.20.0
-------------------------------------------------------------------
Log output file: C:\Users\Chris\AppData\Local\Temp\STM32CubeProgrammer_a16476.log
ST-LINK SN : 004D003A3234510633353533
ST-LINK FW : V3J16M8B5S1
Board : STLINK-V3SET
Voltage : 3.22V
SWD freq : 8000 KHz
Connect mode: Hot Plug
Reset mode : Software reset
Device ID : 0x484
Revision ID : Rev X
Error: Fail to read Flash Size
Device name : STM32H56x/573
Flash size : 2 MBytes (default)
Device type : MCU
Device CPU : Cortex-M33
BL Version : 0xE4
SFSP Version: v2.5.0
Debug in Low Power mode enabled
Opening and parsing file: ST-LINK_GDB_server_a16476.srec
Memory Programming ...
File : ST-LINK_GDB_server_a16476.srec
Size : 236.95 KB
Address : 0x0805E400
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [47 76]
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Error: Fail to read Flash Size
Download in Progress:
File download complete
Time elapsed during download operation: 00:00:21.709
Verifying...
Error: Data mismatch found at address 0x0805E404 (byte = 0x4D instead of 0xF9)
Time elapsed during verifying operation: 00:00:02.471
Error: Download verification failed
Encountered Error when opening C:\ST\STM32CubeIDE\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.2.200.202503041107\tools\bin\STM32_Programmer_CLI.exe
Error in STM32CubeProgrammer
Shutting down...
Exit.