Setting flashing mode in the firmware

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
Abishek_Muthian
Posts: 1
Joined: Thu Mar 17, 2022 4:13 am

Setting flashing mode in the firmware

Post by Abishek_Muthian » Thu Mar 17, 2022 4:51 am

Greetings forum members,

I'm building micropython firmware for NodeMCU with my freezed main.py and I'm able to do it successfully.

I'm flashing it via web using esp-web-tools https://github.com/esphome/esp-web-tools, But recently they have removed the header patching in their flashing library - https://github.com/NabuCasa/esp-web-flasher/issues/103 and so micropython cannot be flashed anymore using esp-web-tools without setting the flashing mode in the firmware itself.

Header patching is done during flashing by esptool.py if ESP8266 with 26Mhz crystal is detected i.e. Changing 4th byte to 0x20 was done to set the 'Flashing Mode' to DIO and 'Flashing Speed' to 40 Mhz(40m).

I'm told that this can be done in the firmware itself if xtal freq is set in the board config, But the option doesn't seem to be available for ESP8266 - https://github.com/micropython/micropython/issues/8395.

Any help to set the flashing mode in the firmware would be much appreciated.

Post Reply