Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By piersfinlayson
#57052 I don't use the Arduino environment much, so can't guide you through this precisely, however:

The SDK itself stores some data on the flash at an address of its chosing. Precisely where depends on how you've actually flashed your code. The SDK info is stored at 0x7c000 if you've flash it as a 512KB flash device, or 0xfc000 if you've flash it as a 1MB flash. If you've flashed it as a 4MB device it'll be at 0x3fc000.

If you don't know which you've flashed it as it'll probably be as a 512KB or 1MB device.

What you can then do is, once you've flashed your program and run it the SDK will probably have initialized this data - so you can read off what it's initialized it as, and change the appropriate byte, and then flash this back,

Something like:

Code: Select allesptool.py read_flash 0x7c000 0x1000 /tmp/flash.bin


This will read 0x1000 (4KB, 1 sector) of data into the file /tmp/flash.bin

Then use hexedit, or some other hex editor to tweak the byte indicated.

Then flash this back to the device:

Code: Select allesptool.py write_flash 0x7c000 /tmp/flash/bin


There may well be an easier way with the IDE!
User avatar
By KevinA
#57058 I've had issues getting things to program, I found Espressif's ESP8266 Download Tool 3.4.2 seems to work and if you leave the Download Path Config blank, set COM: to the port of your device and click START the DETECTED INFO window will display what you have hooked to the COM port.
DO NOT try this with NodeMCU, it clobbers the flash... http://espressif.com/sites/default/file ... .2_win.zip
User avatar
By cherowley
#57078 Thanks Piers!

I stopped being dumb and figured out what you meant...

But, I had to do things differently as flashing those blocks didn't seem to work - I would read it, amend it and flash it back. BUT when reading it back again it had reverted to the original ?!

In the end I used a hex editor to search the full original bin file to find the places where I needed to change it from 1 to 0 (two places?!) then flashed the whole image as normal..

Got it working in the end, thanks!

Also this method means I can still use OTA updates by editing the full bin first..