Bad flash writes with v1.5.1 (increased power usage???)
Bad flash writes with v1.5.1 (increased power usage???)
Postby rab » Fri Jan 22, 2016 12:39 am
I've found that flash writes sometimes fail (silently) with sdk v1.5.1, but they used to work fine with older sdks. Some users of rBoot have noticed this and I have been able to reproduce it myself just by recompiling with sdk v1.5.1. All the spi_flash_write calls return success, but after writing a rom (~250k) there may be one of more unwritten areas (0xff) in the flash. The number, position and size of the unwritten area varies each time.
I have seen this before when users have not had enough power - too few mA from their power supply - to flash and use wifi at the same time (and the write still does not return an error). Now it is happening on devices that were fine before sdk v1.5.1 so I suspect that the new sdk is using more power than the old version.
To make it worse if you try to read the flash back to check the data is correct, it appears to come from the cache and so it looks fine (but if you use esptool.py to read the flash you can see it is bad). This means it is not possible to check the write worked at all!
Can you advise on how to fix this?
Richard.
I have seen this before when users have not had enough power - too few mA from their power supply - to flash and use wifi at the same time (and the write still does not return an error). Now it is happening on devices that were fine before sdk v1.5.1 so I suspect that the new sdk is using more power than the old version.
To make it worse if you try to read the flash back to check the data is correct, it appears to come from the cache and so it looks fine (but if you use esptool.py to read the flash you can see it is bad). This means it is not possible to check the write worked at all!
Can you advise on how to fix this?
Richard.
Re: Bad flash writes with v1.5.1+ (increased power usage???)
Postby rab » Sun Feb 14, 2016 4:07 am
I have created a (fairly simple) test case:
https://github.com/raburton/flashwritebug
Instruction are in the readme.txt
I have tested the code with the new v1.5.2 sdk and the bug is still there. The flash write gets blocks of 0xff bytes (I assume these are erased, but not rewritten) in the middle of the file. This seems to happen on any sustained write, so I assume it will affect the sdk bootloader ota write just as much as as rBoot ota.
Richard.
https://github.com/raburton/flashwritebug
Instruction are in the readme.txt
I have tested the code with the new v1.5.2 sdk and the bug is still there. The flash write gets blocks of 0xff bytes (I assume these are erased, but not rewritten) in the middle of the file. This seems to happen on any sustained write, so I assume it will affect the sdk bootloader ota write just as much as as rBoot ota.
Richard.
Re: Bad flash writes with v1.5.1 (increased power usage???)
Postby henkep » Sun Feb 14, 2016 4:53 am
This is of great concern for us as we are using rBoot and are now left in a situation where we can´t upgrade to any of the newer SDK´s since OTA fails every time for us using the newer SDK´s.
//Henrik Pedersen
//Henrik Pedersen
-
- Posts: 5
- Joined: Tue Mar 08, 2016 1:03 am
Re: Bad flash writes with v1.5.1 (increased power usage???)
Postby piersfinlayson » Tue Mar 08, 2016 5:29 am
I can reproduce this with Richard's test app. I notice that in all failed cases the "unwritten" bytes (the 0xff bytes) start at the start of a sector. Given the way the test app works I'm wondering if spi_flash_erase_sector is returning before completion and actually being applied after the spi_flash_write which immediately follows it (and straddles sectors), although this sounds rather odd.
I wrote my own simpler test app to see if I can repro it with that. I can't so far. The key different being my test app isn't doing anything active with the network, so not drawing as much power.
I wrote my own simpler test app to see if I can repro it with that. I can't so far. The key different being my test app isn't doing anything active with the network, so not drawing as much power.
Re: Bad flash writes with v1.5.1 (increased power usage???)
Postby ESP_Faye » Wed Mar 23, 2016 5:31 pm
Hi,
Please have a try with the attachment based on ESP8266_NONOS_SDK_V1.5.2.
If your problem is still unsolved, please feel free to let us know.
Please have a try with the attachment based on ESP8266_NONOS_SDK_V1.5.2.
If your problem is still unsolved, please feel free to let us know.
- Attachments
-
- libmain_for_ESP8266_NONOS_SDK_V1.5.2.zip
- (58.02 KiB) Downloaded 647 times
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.