2024-12-10 02:28 AM
I am working with an STM32U585 microcontroller, and I need to perform read, write, and erase operations on the internal flash memory (Bank 1) with TrustZone security enabled. The page size is 8 KB, and I am encountering an issue when trying to write data.
Problem Overview:
Current Findings:
Questions:
I would appreciate any guidance, tips, or best practices that you can share to achieve partial page erasure in the STM32U575 microcontroller.
Thank you for your assistance!
Solved! Go to Solution.
2024-12-10 03:55 AM
Hi,
To the best of my knowledge, it's not possible to write only a few bytes to Flash memory without first erasing the entire page. This is a fundamental characteristic of Flash memory.
To modify a portion of the page, you must:
For page rewriting, you are not required to write the entire page. The minimum write size is 4 32-bit words.
2024-12-10 03:55 AM
Hi,
To the best of my knowledge, it's not possible to write only a few bytes to Flash memory without first erasing the entire page. This is a fundamental characteristic of Flash memory.
To modify a portion of the page, you must:
For page rewriting, you are not required to write the entire page. The minimum write size is 4 32-bit words.
2024-12-10 06:09 AM
Hi @Nitin ,
yes fully agree with @olivierxpmetal .
This is the principle of FLASH memory implementation.
If you need to read write without bothering with this sector constraint you have also following solutions
1) Usage of external EEPROM. Such device don't have sector erase constraint.
2) Usage of EEPROM emulator: Principle is to use emulate the behavior of EEPROM using few flash sectors. You can have a look at X-CUBE-EEPROM - EEPROM emulation expansion software for STM32Cube - STMicroelectronics
Best regards
Jocelyn
2024-12-10 06:45 AM
Thanks for the confirmation Olivierxpmetal and Jocelyn.