Bad flash writes with v1.5.1 (increased power usage???)
Re: Bad flash writes with v1.5.1 (increased power usage???)
Postby ESP_Faye » Wed Apr 06, 2016 6:30 pm
Hi,
In your reboot-ota.c, flash_write_flash function
You need to deal with the situation that "len > SECTOR_SIZE", otherwise, it will cause the problem.
In your reboot-ota.c, flash_write_flash function
Code: Select all
if (len > SECTOR_SIZE) {
// to support larger writes we would need to erase current
// (if not already done), next and possibly later sectors too
} else {
// check if the sector the write finishes in has been erased yet,
// this is fine as long as data len < sector size
if (status->last_sector_erased != (status->start_addr + len) / SECTOR_SIZE) {
status->last_sector_erased = (status->start_addr + len) / SECTOR_SIZE;
spi_flash_erase_sector(status->last_sector_erased);
}
}
You need to deal with the situation that "len > SECTOR_SIZE", otherwise, it will cause the problem.
Re: Bad flash writes with v1.5.1 (increased power usage???)
Postby rab » Wed Apr 06, 2016 9:28 pm
Oh wow, that's a little embarrassing. Of course I was aware of that limitation, I wrote the comment in the code afterall, but I didn't think this situation could ever occur! I had never seen packets of data arrive longer than about mid 1400s previously. I assumed these were limited to the MSS, or something similar, which would always be much smaller than the 4k sector size. Since you suggested looking at this I've done some more detailed testing in this area and found an occasional packet of 5744 arrive with SDK v1.5.2. Is this a new increased limit? Or has something just changed the timing in the SDK which allows a few packets to build up occasionally? Interestingly 5744 is still the only other size I have seen, after my previous max of 1436 - no other values have occurred yet.
To test further I created interference at the RF level to try and affect the internal working of the receive and was successful in causing these large packets to occur more frequently (still all 5744 though, odd!). This allowed me to confirm the problem and the fix.
Thank you very much for your help. I'll update rBoot and get some users to test it for real. If you can shed some light on why it's just started happening after v1.5.1 and a bit more on the inner workings of the network stack that would be interesting.
To test further I created interference at the RF level to try and affect the internal working of the receive and was successful in causing these large packets to occur more frequently (still all 5744 though, odd!). This allowed me to confirm the problem and the fix.
Thank you very much for your help. I'll update rBoot and get some users to test it for real. If you can shed some light on why it's just started happening after v1.5.1 and a bit more on the inner workings of the network stack that would be interesting.
Re: Bad flash writes with v1.5.1 (increased power usage???)
Postby ESP_Faye » Thu Apr 07, 2016 3:16 pm
Hi,
The TCP window is 4 x MSS = 4 x 1460 = 5840 > 4096 (Sector size).
So the received data length may be larger than the sector size.
Thanks for your interest in ESP8266 !
The TCP window is 4 x MSS = 4 x 1460 = 5840 > 4096 (Sector size).
So the received data length may be larger than the sector size.
Thanks for your interest in ESP8266 !
Re: Bad flash writes with v1.5.1 (increased power usage???)
Postby scargill » Wed Jul 19, 2017 7:15 am
I don't have a flash_write_flash function... I have an rboot-ota.c rboot_write_flash function - I'm still (SDK 2.1.0) getting occasional E:M 5600 or thereabouts messages which mess up the OTA which of course makes RBOOT's OTA code fail...
Any ideas? I can't see a fix incorporated anywhere.
Any ideas? I can't see a fix incorporated anywhere.
Who is online
Users browsing this forum: No registered users and 64 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.