You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "pkarashchenko (via GitHub)" <gi...@apache.org> on 2023/05/31 19:17:11 UTC
[GitHub] [nuttx] pkarashchenko opened a new issue, #9446: SAMv7 Progmem driver byte write lead to ECC errors and flash data corruption
pkarashchenko opened a new issue, #9446:
URL: https://github.com/apache/nuttx/issues/9446
SAMv7 progmem (internal flash) driver does not perform byte writes correctly.
The driver assumes that it is possible to read page content, change erased (`0xFF`) bytes value and write page back to flash. That is usually a case for most of standard flashes, but SAMv7 internal flash has built-in ECC support, so applying such procedure destroys the flash content and rise "Multiple ECC Error" bit in `EEFC_FSR` register. The partial page programming of internal flash is of course possible, but with some restrictions specified in datasheet.
<img width="1011" alt="Screenshot 2023-05-31 at 21 58 42" src="https://github.com/apache/nuttx/assets/17704713/b07dbac7-d956-41cb-b6a0-0b2837ce67df">
So only the first partial programming after erase is forking fine.
I found this and debugged for a while trying to place MTD config data on top of internal flash page.
Just logging it here as I do not plan to do anything with it, but this information may save investigation time for someone else.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] TimJTi commented on issue #9446: SAMv7 Progmem driver byte write lead to ECC errors and flash data corruption
Posted by "TimJTi (via GitHub)" <gi...@apache.org>.
TimJTi commented on issue #9446:
URL: https://github.com/apache/nuttx/issues/9446#issuecomment-1571520140
No internal flash on SAMA5D2 but thanks for heads-up!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] mu578 commented on issue #9446: SAMv7 Progmem driver byte write lead to ECC errors and flash data corruption
Posted by "mu578 (via GitHub)" <gi...@apache.org>.
mu578 commented on issue #9446:
URL: https://github.com/apache/nuttx/issues/9446#issuecomment-1668751599
yes there is no execute in place capabilities, you need two kind of strategies NAND volatile and soon be gone NOR flash memories.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] acassis commented on issue #9446: SAMv7 Progmem driver byte write lead to ECC errors and flash data corruption
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on issue #9446:
URL: https://github.com/apache/nuttx/issues/9446#issuecomment-1571062827
Thank you for explanation! Maybe it could be useful for @michallenc @adamfeuer and @TimJTi since they are using SAMv7 chips.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] acassis commented on issue #9446: SAMv7 Progmem driver byte write lead to ECC errors and flash data corruption
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on issue #9446:
URL: https://github.com/apache/nuttx/issues/9446#issuecomment-1570821961
@pkarashchenko is this related with similar flash ECC error you were fighting some time ago?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] pkarashchenko commented on issue #9446: SAMv7 Progmem driver byte write lead to ECC errors and flash data corruption
Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on issue #9446:
URL: https://github.com/apache/nuttx/issues/9446#issuecomment-1668729539
I think turning off the ECC does not help here as seems like flash has a "NAND nature", so bits are getting corrupted on write, so reading back data do not match with data just written. Only full sector read-erase-write sequence works reliably, but progmem interface assumes a "NOR nature" of the underlying flash.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] PetervdPerk-NXP commented on issue #9446: SAMv7 Progmem driver byte write lead to ECC errors and flash data corruption
Posted by "PetervdPerk-NXP (via GitHub)" <gi...@apache.org>.
PetervdPerk-NXP commented on issue #9446:
URL: https://github.com/apache/nuttx/issues/9446#issuecomment-1667825970
The S32K3XX also has ECC flash, doing back-to-back writes would much invalidates the ECC value.
On the S32K3XX however we can disable the ECC for the special data region so we can do back-to-back on specific region and implement things like LittleFS.
https://github.com/apache/nuttx/blob/23d42632079cc8e5671b7cdceba874091172bebc/arch/arm/src/s32k3xx/s32k3xx_progmem.c#L430-L432
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] pkarashchenko commented on issue #9446: SAMv7 Progmem driver byte write lead to ECC errors and flash data corruption
Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on issue #9446:
URL: https://github.com/apache/nuttx/issues/9446#issuecomment-1570841479
Yes. It was reproduced like a sporadic bit flip that I initially thought was related to flash wait cycles configuration. I tried to fix it in https://github.com/apache/nuttx/pull/6295, but finally found out that it is ECC errors.
The current driver even can't detect it since flash write operation ends up without issues as ECC error bits are set only after reading data from flash :)
Anyway flash wait cycles configuration is a bit messed up in current code base, so I think I will reopen https://github.com/apache/nuttx/pull/6295, but remove any "bit flip" referenced from it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org