-
• #2
Cool - ClearMemory041063
do you like to add a MSDos section to README_flash.txt and check ESP8266_Flashing.md if there is needed more information?
-
• #3
Hi @MaBe
Later today I hope to do the flash batch files for the 512K, 4M esp8266 chips and the ESP32
Obviously the files can be edited which I invite someone with better knowledge to suggest.
I run the batch files from Windows Explorer by double clicking on them. You can also make shortcuts and use those as well. Opening the Command window, changing directories and entering the batch file name works as well.It would be nice to read the flash info from the chip and parse it to supply the suggested flashing batch file to use. That's what the readme file contains. Seems that the 8266 chips have a separate flash chip. Using a magnifying glass one can sometimes read the part number. Relevant information is the SPI mode, size and speed. These need to be in the flash command.
A lower 40 flash speed seems to work for all, but there is an 80 speed.The 8266 chips also have a processor crystal speed. Choose the wrong speed in the flash command and the baud rates will change.
Let's see how this idea flies before suggesting they be included in the Espruino download.
-
• #4
Flashing Batch File for ESP8266 512KB version
Place Batch file in folder:
"C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266"Ground GPIO pin 0 abd reset the chip
From Explorer click on the "C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266\ESPinfo.bat" file. A command Window opens, enter the com port press returns at each pause. The output for a Sparkfun Thing dev board follows.C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266>set /p pport=Enter a Com port Enter a Com port com6 C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266>echo com6 com6 C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266>pause Press any key to continue . . . C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266>esptool.py --port com6 --baud 115200 --no-stub chip_id esptool.py v2.2.1 Connecting.... Detecting chip type... ESP8266 Chip is ESP8266EX Enabling default SPI flash mode... Chip ID: 0x008b1b99 Hard resetting... C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266>esptool.py --port com6 --baud 115200 --no-stub read_mac esptool.py v2.2.1 Connecting.... Detecting chip type... ESP8266 Chip is ESP8266EX Enabling default SPI flash mode... MAC: 5c:cf:7f:8b:1b:99 Hard resetting... C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266>esptool.py --port com6 --baud 115200 --no-stub flash_id esptool.py v2.2.1 Connecting.... Detecting chip type... ESP8266 Chip is ESP8266EX Enabling default SPI flash mode... Manufacturer: 1f Device: 8401 Detected flash size: Unknown Hard resetting... C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266>pause Press any key to continue . . .
The batch file FlashESP8266_1K.bat follows:
:: Flash ESP8288 512KB chip with Espruino set /p pport=Enter a Com port echo %pport% pause esptool.py --port %pport% --baud 57600 write_flash --flash_freq 40m --flash_mode qio --flash_size 512KB 0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin 0x7C000 esp_init_data_default.bin 0x7E000 blank.bin pause
Reset the chip and in file explorer click on
"C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266\FlashESP8266_1K.bat"
The output follows:C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266>set /p pport=Enter a Com port Enter a Com port com6 C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266>echo com6 com6 C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266>pause Press any key to continue . . . C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266>esptool.py --port com6 --baud 57600 write_flash --flash_freq 40m --flash_mode qio --flash_size 512KB 0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin 0x7C000 esp_init_data_default.bin 0x7E000 blank.bin esptool.py v2.2.1 Connecting.... Detecting chip type... ESP8266 Chip is ESP8266EX Uploading stub... Running stub... Stub running... Configuring flash size... Compressed 3856 bytes to 2762... Wrote 3856 bytes (2762 compressed) at 0x00000000 in 0.5 seconds (effective 62.2 kbit/s)... Hash of data verified. Compressed 456756 bytes to 320993... Wrote 456756 bytes (320993 compressed) at 0x00001000 in 56.7 seconds (effective 64.5 kbit/s)... Hash of data verified. Compressed 128 bytes to 75... Wrote 128 bytes (75 compressed) at 0x0007c000 in 0.0 seconds (effective 32.0 kbit/s)... Hash of data verified. Compressed 4096 bytes to 26... Wrote 4096 bytes (26 compressed) at 0x0007e000 in 0.0 seconds (effective 2047.7 kbit/s)... Hash of data verified. Leaving... Hard resetting... C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266>pause Press any key to continue . . .
Unground GPIO pin 0 and reset the chip then start WEBIDE
Connected > >reset() =undefine _____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 512KB:256/256, manuf 0x1f chip 0x8401 >
1 Attachment
-
• #5
Flashing Batch File for ESP32
Place Batch files in folder:
"C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32"
Ground GPIO pin 0 abd reset the chip
From Explorer click on the "C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32\ESPinfo.bat" file. A command Window opens, enter the com port press returns at each pause. The output for a Sparkfun ESP32 follows.C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>set /p pport=Enter a Com port Enter a Com port com7 C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>echo com7 com7 C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>pause Press any key to continue . . . C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>esptool.py --port com7 --baud 115200 --no-stub chip_id esptool.py v2.2.1 Connecting........____ Detecting chip type... ESP32 Chip is ESP32D0WDQ6 (revision 0) Enabling default SPI flash mode... Chip ID: 0x10240ac40097 Hard resetting... C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>esptool.py --port com7 --baud 115200 --no-stub read_mac esptool.py v2.2.1 Connecting.... Detecting chip type... ESP32 Chip is ESP32D0WDQ6 (revision 0) Enabling default SPI flash mode... MAC: 24:0a:c4:00:97:2a Hard resetting... C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>esptool.py --port com7 --baud 115200 --no-stub flash_id esptool.py v2.2.1 Connecting........__ Detecting chip type... ESP32 Chip is ESP32D0WDQ6 (revision 0) Enabling default SPI flash mode... Manufacturer: ef Device: 4016 Detected flash size: 4MB Hard resetting... C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>pause Press any key to continue . . .
The batch file FlashESP32.bat follows:
:: Flash ESP32 chip with Espruino set /p pport=Enter a Com port echo %pport% pause esptool.py --port %pport% --baud 57600 write_flash --flash_freq 40m --flash_mode qio --flash_size 4MB 0x1000 bootloader.bin 0x10000 espruino_esp32.bin 0x8000 partitions_espruino.bin pause
Reset the chip and in file explorer click on
"C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32\FlashESP32.bat"
The output follows:C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>set /p pport=Enter a Com port Enter a Com port com7 C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>echo com7 com7 C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>pause Press any key to continue . . . C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>esptool.py --port com7 --baud 57600 write_flash --flash_freq 40m --flash_mode qio --flash_size 4MB 0x1000 bootloader.bin 0x10000 espruino_esp32.bin 0x8000 partitions_espruino.bin esptool.py v2.2.1 Connecting..... Detecting chip type... ESP32 Chip is ESP32D0WDQ6 (revision 0) Uploading stub... Running stub... Stub running... Configuring flash size... Flash params set to 0x0020 Compressed 12272 bytes to 7603... Wrote 12272 bytes (7603 compressed) at 0x00001000 in 1.4 seconds (effective 72.2 kbit/s)... Hash of data verified. Compressed 933808 bytes to 519371... Wrote 933808 bytes (519371 compressed) at 0x00010000 in 91.8 seconds (effective 81.4 kbit/s)... Hash of data verified. Compressed 3072 bytes to 136... Wrote 3072 bytes (136 compressed) at 0x00008000 in 0.0 seconds (effective 522.8 kbit/s)... Hash of data verified. Leaving... Hard resetting... C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>pause Press any key to continue . . .
Unground GPIO pin 0 and reset the chip.
Start WEBIDE (may have to try resetting several times or use Putty at 115,200 Baud the first time)>reset() =undefined _____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate >
2 Attachments
-
• #6
Batch file to erase flash on ESP8266 oe ESP32
:: Erase flash set /p pport=Enter a Com port echo %pport% pause esptool.py --port %pport% erase_flash pause
The Output:
C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>set /p pport=Enter a Com port Enter a Com port com7 C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>echo com7 com7 C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>pause Press any key to continue . . . C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>esptool.py --port com7 erase_flash esptool.py v2.2.1 Connecting...... Detecting chip type... ESP32 Chip is ESP32D0WDQ6 (revision 0) Uploading stub... Running stub... Stub running... Erasing flash (this may take a while)... Chip erase completed successfully in 7.7s Hard resetting... C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>pause Press any key to continue . . .
1 Attachment
-
• #7
Batch flashing file for ESP8266 -12 4MB
Use Putty at 74880 Baud GPIO 0 not grounded connect and then reset the chip.
Note the SPI Speed, the SPI Mode and the Flash Size in bits.
ets Jan 8 2013,rst cause:2, boot mode:(3,7) load 0x40100000, len 1396, room 16 tail 4 chksum 0x89 load 0x3ffe8000, len 776, room 4 tail 4 chksum 0xe8 load 0x3ffe8308, len 540, room 4 tail 8 chksum 0xc0 csum 0xc0 2nd boot version : 1.4(b1) SPI Speed : 40MHz SPI Mode : DIO SPI Flash Size & Map: 8Mbit(512KB+512KB) jump to run user1 @ 1000
Run ESPinfo.bat
Ground GPIO 0 and reset the chip, run ESPinfo.bat
C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>set /p pport=Enter a Com port Enter a Com port com3 C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>echo com3 com3 C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>pause Press any key to continue . . . C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>esptool.py --port com3 --baud 115200 --no-stub chip_id esptool.py v2.2.1 Connecting.... Detecting chip type... ESP8266 Chip is ESP8266EX Enabling default SPI flash mode... Chip ID: 0x00134e51 Hard resetting... C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>esptool.py --port com3 --baud 115200 --no-stub read_mac esptool.py v2.2.1 Connecting... Detecting chip type... ESP8266 Chip is ESP8266EX Enabling default SPI flash mode... MAC: 5c:cf:7f:13:4e:51 Hard resetting... C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>esptool.py --port com3 --baud 115200 --no-stub flash_id esptool.py v2.2.1 Connecting... Detecting chip type... ESP8266 Chip is ESP8266EX Enabling default SPI flash mode... Manufacturer: e0 Device: 4016 Detected flash size: 4MB Hard resetting... C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp32>pause Press any key to continue . . .
Flashing the 4MB Espruino
Ground GPIO 9 reset the chip
Run the batch file
"C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266_4mb\FlashESP8266_4M.bat":: Flash ESP8288 4MB chip with Espruino set /p pport=Enter a Com port echo %pport% pause esptool.py --port %pport% --baud 115200 write_flash --flash_freq 80m --flash_mode qio --flash_size 4MB 0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin 0x3FC000 esp_init_data_default.bin 0x3FE000 blank.bin pause
C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266_4mb>set /p pport=Enter a Com port Enter a Com port com3 C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266_4mb>echo com3 com3 C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266_4mb>pause Press any key to continue . . . C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266_4mb>esptool.py --port com3 --baud 115200 write_flash --flash_freq 80m --flash_mode qio --flash_size 4MB 0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin 0x3FC000 esp_init_data_default.bin 0x3FE000 blank.bin esptool.py v2.2.1 Connecting.... Detecting chip type... ESP8266 Chip is ESP8266EX Uploading stub... Running stub... Stub running... Configuring flash size... Flash params set to 0x004f Compressed 3856 bytes to 2763... Wrote 3856 bytes (2763 compressed) at 0x00000000 in 0.3 seconds (effective 120.1 kbit/s)... Hash of data verified. Compressed 509332 bytes to 340820... Wrote 509332 bytes (340820 compressed) at 0x00001000 in 30.3 seconds (effective 134.6 kbit/s)... Hash of data verified. Compressed 128 bytes to 75... Wrote 128 bytes (75 compressed) at 0x003fc000 in 0.0 seconds (effective 63.5 kbit/s)... Hash of data verified. Compressed 4096 bytes to 26... Wrote 4096 bytes (26 compressed) at 0x003fe000 in 0.0 seconds (effective 1973.9 kbit/s)... Hash of data verified. Leaving... Hard resetting... C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266_4mb>pause Press any key to continue . . .
Run WEBIDE
unground GPIO 0, reset the chip
Connected > >reset() =undefin _____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v95 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:512/512, manuf 0xe0 chip 0x4016 >
1 Attachment
Using batch (.BAT) files to help with Flashing ESP8266
Having installed ESPtool.py and downloaded the latest version of Espruino into a folder:
In my case, I created a folder
"C:\Users\jj\Documents\espruinoEsp8266Flash"
and then copied the two batch files into the subfolder
"C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266"
Identify the ESP8266 Chip
Plug the ESP8266 into a USB port ( using supporting hardware)
Ground GPIO pin 0
Reset the chip and run ESPinfo.bat
ESPinfo.bat
and the output
Note the Flash size for the chip I used is 1Mbyte. So I will use a batch file set up to program the ESP8266 with that size flash chip.
Reset the ESP8266 and then run "C:\Users\jj\Documents\espruinoEsp8266Flash\espruino_1v95_esp8266\FlashESP8266_1M.bat"
The output:
Disconnect GPIO pin 0 from the ground and reset a couple of times.
Start WebIde and connect to the ESP8266
Need to create batch files for the other ESP8266 and ESP32 chips
2 Attachments