ESP8266 Developer Zone The Official ESP8266 Forum 2018-07-14T01:37:44+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=11437 2018-07-14T01:37:44+08:00 2018-07-14T01:37:44+08:00 https://bbs.espressif.com:443/viewtopic.php?t=11437&p=22079#p22079 <![CDATA[Re: SPI Erase Sector OTA]]>
blubb wrote:
You can only write zeros (0) into a flash memory. If you need to put a one (1) into a bit that was zero before, you have to erase the whole block and after that zero out the bits that need to be zero. Erasing is a totally different from writing. That is the short summary of how all flash memories work (low level). On e.g. usb key drives the only difference is that you have a controller which does all that for you (and also distributes new writes across all the flash space, so that it wears evenly).


Interesting, Got any YouTube videos that talk about this topic? I am used to conventional harddrives but I would like to dive deeper into the subject if you have any links?

Thanks!

Statistics: Posted by AgentSmithers — Sat Jul 14, 2018 1:37 am


]]>
2018-07-11T17:12:14+08:00 2018-07-11T17:12:14+08:00 https://bbs.espressif.com:443/viewtopic.php?t=11437&p=22051#p22051 <![CDATA[Re: SPI Erase Sector OTA]]> Statistics: Posted by blubb — Wed Jul 11, 2018 5:12 pm


]]>
2018-07-11T04:05:55+08:00 2018-07-11T04:05:55+08:00 https://bbs.espressif.com:443/viewtopic.php?t=11437&p=22039#p22039 <![CDATA[Re: SPI Erase Sector OTA]]>
blubb wrote:
That is for technical reasons. In flash memory only zeros can be written as single bits.
https://en.wikipedia.org/wiki/Flash_mem ... ck_erasure


Thank you for your input, I am not sure if that is the answer to my question.

AS I am looping through the total amount of firmware data, Why is erase even required when all the data underneath is going to be overwritten anyways.

Now for the last sector of 4096 bytes, I understand because the firmware may not cover the whole sector and there could be trailing data from the previous firmware version left in that sector, however for the sector's before that still makes no sense to me unless erase set's some flag for the sector in the background that FOTA read's on reboot before trying to load it.

Statistics: Posted by AgentSmithers — Wed Jul 11, 2018 4:05 am


]]>
2018-07-10T17:36:15+08:00 2018-07-10T17:36:15+08:00 https://bbs.espressif.com:443/viewtopic.php?t=11437&p=22035#p22035 <![CDATA[Re: SPI Erase Sector OTA]]> https://en.wikipedia.org/wiki/Flash_mem ... ck_erasure

Statistics: Posted by blubb — Tue Jul 10, 2018 5:36 pm


]]>
2018-07-10T01:01:02+08:00 2018-07-10T01:01:02+08:00 https://bbs.espressif.com:443/viewtopic.php?t=11437&p=22023#p22023 <![CDATA[SPI Erase Sector OTA]]> Does anyone know what SPI Erase sector actually do to the SPI rom. It seems if I overwrite the sector's with my OTA firmware it does not work unless I call to erase it first. Shouldn't overwriting the data with other data have the same effect or does Erase set some sort of flag behind the scene's allowing for the firmware to work when calling the reboot swap? I even call it on the last sector as I'm writing the last part of the rom and still no dice. I have to erase then write from start to end to have my OTA work. Any background?

Statistics: Posted by AgentSmithers — Tue Jul 10, 2018 1:01 am


]]>