esptool/py --port ... --baud ... write_flash --flash_size 16m-c1 --flash_mode qio \
0x000000 espiobridge-rboot-boot.bin \
0x001000 rboot-config.bin \
0x002000 espiobridge-rboot-image.bin \
0x1fc000 esp_init_data_default_v08.bin \
0xfb000 blank1.bin \
If you already did flash either of esp_init_data_default_v08.bin or blank1.bin or blank3.bin, you don't really need to do it again, it needs to be done once on a "fresh" ESP8266 that has never run this image before (or it has been completely erased / overwritten). It makes sure the system config areas are empty, so the SDK WLAN code will fill them correctly.
esptool.py -p /dev/cu.wchusbserial1420 write_flash --flash_size 2MB-c1 --flash_mode dio 0x000000 espiobridge-rboot-boot.bin 0x001000 rboot-config.bin 0x002000 espiobridge-rboot-image.bin 0x1fc000 esp_init_data_default_v08.bin 0xfb000 blank1.bin 0x1fd000 blank3.bin
I don't think your "flash size" is right. The size is in mbits not mbytes, so if you have 2 mbyte, you should use
Also do you really need "--flash_mode dio"? You only need this is you use some of the GPIO's in the range 6-11 for something different than SPI flash access. If you specifiy mode dio, the flash througput will be half the normal speed. Also for this to be properly set up, a function called "user_spi_flash_dio_to_qio_pre_init" is used. This function is quite large and resides in IRAM. The SDK offers the choice to override it (with a null function) to keep IRAM function low, which my code does. So it won't work on "dio" connected flash anyway.
holopaul wrote:I did manage to access the esp on port 24 but encountered the following behaviour:
1. Bridge port is forced to port 1 somehow
2. When trying to set the uart speed i get this message : cannot delete config (default values)
I think this is because the overlapping config but please check it out.
Please do a "cd" (config-dump) to see what's actually in the config. Use "l" or "lc" (log, log-clear) to see what happened why the config entry couldn't be written or the entry couldn't be deleted.
I just finished testing booting with a complete empty config on both a "plain" image on an 1 Mb/8 Mbits model and with an "ota" image on an 4 Mb/32 Mbits model and both worked as expected, after a minute getting no IP address, the mode changes to access point, the "esp" SSID is broadcast, I log in using "espespesp", I get an IP address, connect to the gw's address at port 24 with a browsers, filled in SSID/passwd, reset and it worked.
- "modern" browsers tend to setup multiple connections at the same time, the ESP doesn't cope with that very well. I experience often that I have to refresh a page a few times before it shows / or may need to submit forms more than once before it's accepted. When using an old browser, it just works like expected.
- I made a hack in the code so if no configuration is available at all, at least the UART TX is enabled. Without that, you won't see any logging and one may think it has crashed.
Please try again with my notes in mind, let's see if we can find the root cause.
BTW you can always save, restore and erase the config using esptool.py. For plain images it's at 0x7a000 and for ota images it's at 0xfa000. An alternative way to bootstrap your device is to write a sector there, like this: (replace xxxxxx), it's all text format. Lines need to be ended with newline ("\n" or 0xa), no carriage return ("\r", 0xd) allowed! Don't use wordpad or notepad! Note the mandatory empty line at the end.