Chat about current Lua tools and IDEs

User avatar
By hobby_guy
#93488 Yeah, I see the chksum err. Strange, because the flashing with esptool apparently went well:

Code: Select all$ py esptool.py --port COM7 --baud 115200 --after no_reset write_flash --flash_size detect --flash_mode dio 0x00000 "C:\ESP8266 web server\nodemcu-release-7-modules-2022-01-27-21-14-42-float.bin"
esptool.py v3.3-dev
Serial port COM7
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting...
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC:
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 1MB
Flash will be erased from 0x00000000 to 0x0006efff...
Compressed 454656 bytes to 295280...
Writing at 0x00000000... (5 %)
Writing at 0x00005399... (10 %)
Writing at 0x000147af... (15 %)
Writing at 0x0001a23a... (21 %)
Writing at 0x0001f4dd... (26 %)
Writing at 0x00024c16... (31 %)
Writing at 0x0002a2fa... (36 %)
Writing at 0x0002f78d... (42 %)
Writing at 0x00035bd3... (47 %)
Writing at 0x0003b426... (52 %)
Writing at 0x00040bcf... (57 %)
Writing at 0x000463af... (63 %)
Writing at 0x0004bf5d... (68 %)
Writing at 0x00051cbb... (73 %)
Writing at 0x0005716c... (78 %)
Writing at 0x0005c05f... (84 %)
Writing at 0x00061143... (89 %)
Writing at 0x0006658f... (94 %)
Writing at 0x0006e000... (100 %)
Wrote 454656 bytes (295280 compressed) at 0x00000000 in 26.7 seconds (effective 136.5 kbit/s)...
Hash of data verified.

Leaving...
Staying in bootloader.


I'll try again. I think I have the correct flash size, though (1MB). I checked in advance, using esptool:

Code: Select all$ py esptool.py --port COM7 flash_id
esptool.py v3.3-dev
Serial port COM7
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting...
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC:
Uploading stub...
Running stub...
Stub running...
Manufacturer: 5e
Device: 4014
Detected flash size: 1MB
Hard resetting via RTS pin...
User avatar
By hobby_guy
#93489 Good idea on reverting to the AT firmware. Downloaded the ESP8266-IDF-AT_V2.2.1.0.zip from the Espressif website, and flashed it successfully onto the ESP. After rebooting, I get this (more promising) output:

Code: Select all ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x40210010, len 711800, room 16


However, now I don't get the "Ai-Thinker Technology Co. Ltd. ready" output (at 115200 baud), following the initial output above... Probably there are many versions of the AT firmware, and there's no way to figure out exactly what AT firmware these ESP were shipped with when I bought them?

Here's the output from another ESP in the batch I ordered -- one which I have not tried to reprogram. Any information here on what firmware this is, and where to get that BIN (in case I want to "restore" this ESP I've now experimented with)?

Code: Select all ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x40100000, len 1856, room 16
tail 0
chksum 0x63
load 0x3ffe8000, len 776, room 8
tail 0
chksum 0x02
load 0x3ffe8310, len 552, room 8
tail 0
chksum 0x79
csum 0x79

2nd boot version : 1.5
  SPI Speed      : 40MHz
  SPI Mode       : DOUT
  SPI Flash Size & Map: 8Mbit(512KB+512KB)
jump to run user1 @ 1000

rf cal sector: 249
rf[112] : 00
rf[113] : 00
rf[114] : 01

SDK ver: 1.5.4.1(39cb9a32) compiled @ Jul  1 2016 20:04:35
phy ver: 972, pp ver: 10.1


Just to clarify: My aim with all this is to learn how to program directly onto the ESP, rather than have a separate MCU (atmega16) for my code, which then has to interface the wifi through AT commands. If I can skip the atmega16 altogether (and crystal and reliable UART etc etc) then everything will be so much easier.
User avatar
By hobby_guy
#93490 Or, does "rst cause:2" actually indicate an error?
I've read that boot problems like this might sometimes be due to unstable power supply, and that one should have decoupling capacitors across the power rails. I'm using a breadboard power supply, which converts 12V to 5 or 3.3V, and it's got a 100uF cap on it. I though this would be designed to be quite stable/user friendly but I tried to stick a 10nF cap between GND and 3.3V -- no change.

Presumably the there was something wrong with the AT firmware I flashed; either I got the wrong binary for my ESP-01, or something is persistently failing with esptool (even though the output indicates it getting to 100% without problems).