Failing to flash new device with old firmware image (invalid magic number: 0xff)

ammaree
Posts: 39
Joined: Tue Dec 27, 2016 2:10 am

Failing to flash new device with old firmware image (invalid magic number: 0xff)

Postby ammaree » Fri Aug 16, 2024 3:11 pm

For software migration testing purposes I am trying to build a test device running old firmware, the exact source of which I do not have.
The old devices runs firmware built in 2019 and using SDK pre v3.1, v3.0.1 I think.
I have successfully read the full 4MB flash from an existing working device using latest esptool.py from master (v5.4).
I am trying to flash the complete 4MB image, as read from an old device, to an exact equivalent new device.

The image as read flashes successfully to the new device but does not boot.
ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:5200
ho 0 tail 12 room 4
load:0x40078000,len:13412
load:0x40080400,len:3996
entry 0x40080648
)E\,GDDzi
esptool.py image_info reports:
esptool.py v4.8.dev4
File size: 4194304 (bytes)
A fatal error occurred: This is not a valid image (invalid magic number: 0xff)
I would have thought that reading 100% of the flash of a working device and rewriting that to a brand new device should absolutely work. I know the new device works, have tested it with newly build firmware.

Any suggestions appreciated

ESP_Sprite
Posts: 9709
Joined: Thu Nov 26, 2015 4:08 am

Re: Failing to flash new device with old firmware image (invalid magic number: 0xff)

Postby ESP_Sprite » Sat Aug 17, 2024 5:42 am

Can you post the command lines you used to read/write the flash?

ammaree
Posts: 39
Joined: Tue Dec 27, 2016 2:10 am

Re: Failing to flash new device with old firmware image (invalid magic number: 0xff)

Postby ammaree » Sat Aug 17, 2024 10:46 am

esptool.py read_flash 0 all filename.hex
esptool.py write_flash 0 filename.hex

Who is online

Users browsing this forum: sterisa and 270 guests