Page 1 of 1

Firmware for ESP-01S on flash ZP25WQ80 is not loaded

Posted: 26 May 2023, 10:06
by Alex P
Firmware for ESP-01S on flash ZP25WQ80 is not loaded. get flash id : 0x001460ba manufacturer_id: 0xba device_id: 0x6014

INIT : Booting version: ESP_Easy_mega_20230306_normal_ESP8266_1M_VCC, (GitHub Actions) mega-20230306 (ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support)
5308 : Info : INIT : Free RAM:30072
5310 : Info : INIT : Soft Reboot #3 - Restart Reason: Software/System restart
5311 : Info : FS : Mounting...
5317 : Info : FS : Mount successful, used 1506 bytes of 113201
5323 : Error : FS : Error while reading/writing config.dat in 16498
5325 : Info : INIT : I2C
5326 : Info : INIT : SPI not enabled
5431 : Info : WIFI : Set WiFi to STA
10006 : Info : WIFI : Set WiFi to AP+STA
10117 : Info : WIFI : AP Mode ssid will be ESPEasy- with address 192.168.4.1
12405 : Info : WIFI : Disconnected! Reason: '(1)'
12506 : Info : Reset WiFi.
14793 : Info : WIFI : Set WiFi to OFF

PID:0
Version:0
INIT : Incorrect PID or version!
RESET: Resetting factory defaults... using default settings
RESET: Warm boot, reset count: 3
RESET: Too many resets, protecting your flash memory (powercycle to solve this)

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Exception (0):
epc1=0x4000e25d epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

>>>stack>>>

ctx: cont
sp: 3fff25c0 end: 3fff2850 offset: 0190
3fff2750: 00000001 3fff0eb0 3fff0a08 00000000
3fff2760: 402759ee 00000000 3fff46cc 40275af5
3fff2770: 0000001c 00000000 00000000 00000000
3fff2780: 00000003 00000000 3fff46cc 40275d2a
3fff2790: 3fff1710 00000001 3fff1710 00000000
3fff27a0: 00000000 00000001 3fff1710 4026fe28
3fff27b0: 00000000 3fff1710 0000000a 4027588e
3fff27c0: 00000000 0000001c 00000000 4026fda0
3fff27d0: 3fff1710 3fff0468 00000000 40238b8c
3fff27e0: 3fff0868 3fff0468 3fff0eb0 40238968
3fff27f0: 3fff0000 0036003f 80efeffe 3fff3700
3fff2800: 0000003f 80efeffe feefeffe feefeffe
3fff2810: feefeffe feefeffe feefeffe 3fff289c
3fff2820: 3fffdad0 00000000 3fff2858 4020a3dc
3fff2830: feefeffe feefeffe feefeffe 40272d77
3fff2840: feefeffe feefeffe 3ffe8694 401004dd
<<<stack<<<

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

ets Jan 8 2013,rst cause:1, boot mode:(3,6)

load 0x4010f000, len 3584, room 16
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld

Re: Firmware for ESP-01S on flash ZP25WQ80 is not loaded

Posted: 26 May 2023, 15:08
by TD-er
Can you try to power-cycle?
The unit has the flash protection active and this protection will be kept active in RTC memory, so a crash/reboot will not reset this protection.

Re: Firmware for ESP-01S on flash ZP25WQ80 is not loaded

Posted: 29 May 2023, 08:04
by Alex P
I flashed Wled, Tasmota, they work fine.

Re: Firmware for ESP-01S on flash ZP25WQ80 is not loaded

Posted: 29 May 2023, 11:17
by TD-er
Alex P wrote: 29 May 2023, 08:04 I flashed Wled, Tasmota, they work fine.
But did you power cycle that unit after the failed attempts of ESPEasy to create a settings file?

Re: Firmware for ESP-01S on flash ZP25WQ80 is not loaded

Posted: 29 May 2023, 11:40
by Alex P
Yes, ESPEasy cannot write the settings file.
It seems to me that the problem here is the same as with PUYA, ESPEasy does not know this type of flash, and cannot apply the appropriate algorithm.

Re: Firmware for ESP-01S on flash ZP25WQ80 is not loaded

Posted: 29 May 2023, 11:59
by TD-er
I can add the vendor ID (0xBA) to the PUYA check:

Code: Select all

bool flashChipVendorPuya() {
  const uint8_t vendorId = getFlashChipVendorId();

  return vendorId == 0x85 || // 0x146085 PUYA
        vendorId == 0xBA; // ZP25WQ80 0x001460BA
}
Can you make your own build, or should I make a PR for it including a GH Actions build for you to test?

Edit:
Made a PR for it:
https://github.com/letscontrolit/ESPEasy/pull/4683
Actions build: https://github.com/letscontrolit/ESPEas ... 5110807164

Re: Firmware for ESP-01S on flash ZP25WQ80 is not loaded

Posted: 29 May 2023, 12:05
by Alex P
An error has crept into the chip name correct ZD25WQ80

Re: Firmware for ESP-01S on flash ZP25WQ80 is not loaded

Posted: 29 May 2023, 12:07
by TD-er
I already made a PR for it, see edits in my previous post.

Re: Firmware for ESP-01S on flash ZP25WQ80 is not loaded

Posted: 29 May 2023, 12:10
by TD-er
Hmm I just realized this is only in the ESPEasy code, not yet in the Arduino code... That might need a bit more tweaking :(
So the build will probably not work

Re: Firmware for ESP-01S on flash ZP25WQ80 is not loaded

Posted: 29 May 2023, 12:18
by Alex P
I have not yet learned how to make my own builds, I download the finished *.BIN

Re: Firmware for ESP-01S on flash ZP25WQ80 is not loaded

Posted: 29 May 2023, 12:19
by TD-er
That build will not work, as it should be fixed in the Arduino code:

in flashWriteUnalignedMemory:

Code: Select all

#if PUYA_SUPPORT
        if (getFlashChipVendorId() == SPI_FLASH_VENDOR_PUYA) {
            for (size_t i = 0; i < wlen ; ++i) {
                buf[offset + i] &= data[i];
            }
        } else {
#endif
            memcpy(&buf[offset], data, wlen);
#if PUYA_SUPPORT
        }
#endif

Code: Select all

bool EspClass::flashWrite(uint32_t address, const uint32_t *data, size_t size) {
    SpiFlashOpResult result;
#if PUYA_SUPPORT
    if (getFlashChipVendorId() == SPI_FLASH_VENDOR_PUYA) {
        result = spi_flash_write_puya(address, const_cast<uint32_t *>(data), size);
    }
    else
#endif
    {
        result = spi_flash_write_page_break(address, const_cast<uint32_t *>(data), size);
    }
    return result == SPI_FLASH_RESULT_OK;
}