2024-04-11 12:12 AM
2024-04-11 05:11 PM
In context of writing the internal flash, word means the "flash word" which for STM32H503 is 128 bits (16 bytes). You can write less than 16 bytes to a "flash word" (see the RM for details) but then you cannot write other bytes in the same flash word, because of ECC (see the RM for details again). Typically you want to fill entire 16-byte "flash words", maybe except of the last incomplete "word".
Bottom line, the internal flash is special and not friendly to byte-granular (or even bit-granular) writes, as possible with some other memories.
2024-04-19 10:18 PM - edited 2024-04-19 10:20 PM
Hi all,
@Pavel A. Thank you, buddy. but
Still, I have that issue, I can't find the proper solution, anyone guide me to get the proper solution
Thanks
2024-04-20 03:13 AM
Here you can find help for your project.
Somebody who will drill into your requirements, study documentation and examples, find proper design and help writing code.
2024-04-20 03:43 AM
Hi,
>works well in multi-word write only, single word write is not working
Single word write is not possible . Just accept this.
Full 16-byte "flash words" have to be written. Thats it.
2024-04-20 03:53 AM
Hi @AScha.3
Can you explain that, why single word write method is not working?
I want to know about reason.
Thanks
2024-04-20 04:50 AM
Hi,
see rm :
So every write, that not generates a valid ECC will give a exception - "flash corrupted" or so .
You can set just one bit - but only when writing a full 16-byte "flash word" with this bit and all other zero or what you want.
2024-04-20 05:21 AM
Thanks, Buddy. for your update:smiling_face_with_smiling_eyes:
2024-04-20 05:53 AM - edited 2024-04-20 05:54 AM
The ECC by itself is not the problem. Some flash chips have ECC as well but they are designed to allow more granular writes. (This invalidates ECC on the block, but write succeeds TL;DR) It's just the ST implementation choice. If you want to write by small pieces, use suitable external memory chip. No external chip? then comply with ST limitation.