Jul 07, 2019
10:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 07, 2019
10:56 PM
Hello Guys,
I am working on a TC23x device. There is query with Flash write\erase.
Problem Statement:
• Attempt of writing 0x100 bytes causing memory corruption.
Scenario:
• There is no content in the memory. Attempt of write into memory is successful and any attempt of reading this flash is causing exception.
• Attempt of write after erasing the particular sector is fine and any read attempt is also successful without any exception.
• Attempting a write into any other address in the same sector is successful, but read of that particular memory is causing an exception.
Understanding:
• Memory erase is always mandatory before writing the empty space of a particular sector. In this case we need to take the backup of the written memory followed by erase and then write the complete memory.
Please let me know if my understanding is correct.
Thanks in advance!
Regards
VVSS
I am working on a TC23x device. There is query with Flash write\erase.
Problem Statement:
• Attempt of writing 0x100 bytes causing memory corruption.
Scenario:
• There is no content in the memory. Attempt of write into memory is successful and any attempt of reading this flash is causing exception.
• Attempt of write after erasing the particular sector is fine and any read attempt is also successful without any exception.
• Attempting a write into any other address in the same sector is successful, but read of that particular memory is causing an exception.
Understanding:
• Memory erase is always mandatory before writing the empty space of a particular sector. In this case we need to take the backup of the written memory followed by erase and then write the complete memory.
Please let me know if my understanding is correct.
Thanks in advance!
Regards
VVSS
- Tags:
- IFX
1 Reply
Jul 08, 2019
11:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 08, 2019
11:30 AM
Hi VVSS. For PFLASH, the erased state (all 0s) always causes an uncorrectable ECC read error.
An erase is only necessary before a write if the destination is not already erased.
For example: you can erase PF0 (0xA0000000-0xA01FFFFF), write 0xA0000000-0xA00000FF, and then write 0xA0001000-0xA00010FF without erasing. But if you want to rewrite 0xA0000000, you need to preserve everything else in S0 (0xA0000000-0xA0003FFF), erase S0, and then rewrite the sector (or at least, the populated parts of the sector).
An erase is only necessary before a write if the destination is not already erased.
For example: you can erase PF0 (0xA0000000-0xA01FFFFF), write 0xA0000000-0xA00000FF, and then write 0xA0001000-0xA00010FF without erasing. But if you want to rewrite 0xA0000000, you need to preserve everything else in S0 (0xA0000000-0xA0003FFF), erase S0, and then rewrite the sector (or at least, the populated parts of the sector).