2025-05-30 2:04 AM
Hello everyone,
I would like to implement a project using TrustZone on the STM32 L562 Discovery board. To get started, I based my work on the STM32Cube_FW_U5_V1.4.0\Projects\NUCLEO-U575ZI-Q\Examples\FLASH\FLASH_EraseProgram_TrustZone\ example, which is often referenced in the forum for similar questions.
When I try to write from the secure world to the secure world, everything works fine. However, when I try to write from the secure world to the non-secure world, I encounter an error with the SECWRPERR flag. This is puzzling because I haven't set any write protection on the memory areas I'm trying to access.
While trying to understand the cause of this issue, I checked the STM32L562xx Reference Manual and found something interesting. On page 189, it mentions the following:
Additionally, if I understand correctly, the table on page 212 states that the secure world cannot perform write-erase operations in the non-secure world.
However, this seems to contradict the general principles of TrustZone. According to TrustZone documentation (including STM’s own video series and the example project i mentioned in the start), the secure world should have full access to the non-secure world.
Am I misunderstanding something here? Why are erase and write operations failing?
Thank you so much for your help!
Solved! Go to Solution.
2025-05-30 3:08 AM
When performing flash operations in the secure domain, it’s necessary to specify whether the access will be secure or non-secure. This detail had escaped my notice.
2025-05-30 3:08 AM
When performing flash operations in the secure domain, it’s necessary to specify whether the access will be secure or non-secure. This detail had escaped my notice.