cancel
Showing results for 
Search instead for 
Did you mean: 

writing single byte in flash

IVent.1
Senior

I'm trying to write on the flash of the stm32u5 microcontroller. Why in the flash driver, in particular in the file stm32u5xx_hal_flash.c, is present only FLASH_TYPEPROGRAM_QUADWORD and FLASH_TYPEPROGRAM_BURST? Is it not possible to write on the flash a single byte?Thank you.

2 REPLIES 2

Right, because the flash line in the array is wider, and also contains additional error-correction bits that are not directly visible to you.

You're going to have adapt, and write bigger structures.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Pavel A.
Evangelist III

This is a limitation of STM32. Each model has a minimal write granularity. Some other flash chips allow writing even by single bits (toggle any 1 to 0).