📜 ⬆️ ⬇️

New revisions of modules based on ESP8266 do not know how to write in SPI Flash


In the photo on the right - the hero of the occasion, the PUYA P25Q80 chip

Chinese suppliers have begun to use a PUYA flash-memory chip. This caused the SPIFFS drivers, which are usually used to save settings in ESP8266 modules, to crash. Many projects have suffered. There is no solution yet.


This morning I started with the routine operation of flashing the next batch of IO-Node I / O modules. The heart of the device is the ESP-07 module. No signs of trouble.

The first module was stitched, launched, launched into the web interface. Two relay outputs and discrete inputs earned immediately. However, when trying to search for connected 1-wire temperature sensors, something strange happened. IO-Node reported that one sensor was found and frozen.



Moreover, it hung so that even after a reboot, the status LED did not flash. To say that I was surprised is to say nothing. Re-flashing did not help either.

Thinking that the failed ESP-07 module was caught, I took up the firmware of the next board. What was my surprise when the next board behaved the same way. Obviously, this was not a coincidence.

Starting to debug the firmware code, I discovered that SPIFFS is not working - the file system driver that we use to store settings.

A Google search revealed that this is a very new problem that appeared literally in early January. There are discussions here and here .

The essence of the problem is that the Chinese began to use the new PUYA P25Q80 flash memory chip (see the first photo). This microcircuit doesn’t work quite like the previous microcircuits produced by Winbond and others.

What exactly is happening is not completely clear. The opinion is expressed that when an attempt is made to record a part of a memory block, the microcircuit goes into an alarm state. At that time, when recording the entire block at once, it works correctly.

By the way, if you put data in SPIFFS during the initial firmware of the ESP module, then the data from it is read correctly. Errors only occur when writing to memory from the firmware code. But this is a critical problem, because now it is not possible to save user settings.

What to do?

At the moment, we, like other ESP8266 users, are replacing PUYA with Winbond microchips. There is no such problem with them. And we are waiting for the development of the situation - suddenly a software patch will appear. In the long run, we will either release our module or we will dissolve all these chips on our “motherboard” to keep this situation under control.

It is inconvenient that when buying modules it is not known what will be sold to you - the chip is hidden under the metal screen and is visually inaccessible.

Source: https://habr.com/ru/post/409911/