2025-01-15 04:16 AM
Hi,
I am trying to erase and write to stm32u545 flash.
The memory partition is such that, I am dividing each Flash bank 256kb into secure and non secure regions.
first 8 pages are secure and rest of the bank are non secure.
I am running my code from Bank 1 and experimenting on writing to secure and non secure sections in bank 2.
My code is running as secure code and I am able to write/erase to first 8 pages successfully.
When I try to erase 9th page [Non -Secure], I am encountering TZIC illegal access error.
I know that I am trying to access non secure page from secure, so what settings do I need to ensure that I can access it?
I have options bytes configured correctly based on my memorymap. SAU is disabled and TZEN =1.
Thanks,
Bharath
2025-01-23 01:17 AM - edited 2025-01-23 01:18 AM
Hi @bvenkatesh,
You can refer to the reference manual RM0456, specifically section 7.7 Flash memory and FLASH registers access control, where you will find the explanation of access to the flash memory
and also refer to this application note AN5347, which shows that you have to use NSC register to erase Non -Secure pages.
Thank you.
ELABI.1
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.