Skip to main content
IVent.1
Senior
Feb 24, 2023 2:42 PM UTC
Question

writing single byte in flash

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.

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
Feb 24, 2023 2:47 PM UTC

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
Pavel A.
Feb 24, 2023 7:58 PM UTC

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).