2023-02-15 3:38 AM
Hi! all experts in Community ST,
I have been working on the embedded flash memory of STM32G474RE and the whole programming process of the flash memory has been successful.
However, I do not understand how the Error Correction Code works.
Referring to the reference manual,
8-bit ECC code is calculated and added per double word(64 bits).
If I interpreted correctly,
when 64-bit or 8 bytes data is programmed at some address, the 8-bit ECC code is calculated automatically and is stored in flash memory, following the data. Is it correct?
Here is the memory map of my test case:
Data: 0x1111111122222222
Addr: 0x0807F808
As you can see, the data has been successfully stored in the designated address but I can't find where the ECC is.
It is quite confusing for me.
If I want to store new data after the data which I already write, should I leave 8-bit for the ECC Code? or should I just write right after where the previous data ends?
I think I am not on the right track :'(
Where the ECC Code stores in the flash memory?
Please help me out and thank you in advanced!
Solved! Go to Solution.
2023-02-15 4:20 AM
The ECC data is stored in bits which are not visible to you. You will only see the 64-bits of user data in the Flash line stored in the array. From a user perspective you'll see contiguous blocks of 8-bytes as you wrote them.
2023-02-15 4:20 AM
The ECC data is stored in bits which are not visible to you. You will only see the 64-bits of user data in the Flash line stored in the array. From a user perspective you'll see contiguous blocks of 8-bytes as you wrote them.
2023-02-16 1:16 AM
Thank you! I am finally able to move forward :))
By the way, shouldn't the ECC data be in the flash memory somehow?
how can they be invisible although I can access almost every memory address?
I cant find any mention about that in the reference manual and other documents I can search.
Is it in the memory which is marked as "Reserved"? is that correct?
Hmm..
2023-02-16 7:34 AM
Hi @IJo.1
The forum moderator had marked your post as needing a little more investigation and direct support. An online support case has been created on your behalf, please stand by for just a moment and you will hear from us.
Regards,
Billy