Issue in Installing Micropython WROOM32D
Posted: Sat Jan 11, 2020 7:34 am
Hi All,
I am new to this mcu and facing some issue with installing micropython on it. So here is the story:
I have a PCB on which WROOM is mounted (it's pins are connected to several other components). To install micropython on it. I have done the following:
1. connections: PC -> USB2Serial Converter -> UART0. I ground the GPIO0 and power on the MCU. I get this message on the terminal:
rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download
2. Now, I close the terminal (connected to UART0) and try this:
~ ❯❯❯ esptool --chip esp32 --port /dev/ttyUSB0 erase_flash
esptool.py v2.1
Connecting....
Chip is ESP32D0WDQ5 (revision (unknown 0xa))
Enabling default SPI flash mode...
Erasing flash (this may take a while)...
A fatal error occurred: ESP32 ROM does not support function erase_flash
I am not able to get around this error
3. I try to run next command to write the flash
❯ esptool --chip esp32 --port /dev/ttyUSB0 write_flash -z 0x1000 <path to bin file>
esptool.py v2.1
Connecting...
Chip is ESP32D0WDQ5 (revision (unknown 0xa))
Enabling default SPI flash mode...
Configuring flash size...
Auto-detected Flash size: 4MB
Erasing flash...
Compressed 1087456 bytes to 687409...
Took 3.57s to erase flash block
Wrote 1087456 bytes (687409 compressed) at 0x00001000 in 73.9 seconds (effective 117.6 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting...
So, it completes successfully as I see.
4. Resetting the MCU (with GPIO0 unconnected) gives this on UART0
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:4732
load:0x40078000,len:7496
load:0x40080400,len:5512
entry 0x4008114c
I (401) cpu_start: Pro cpu up.
I (401) cpu_start: Single core mode
I (401) heap_init: Initializing. RAM available for dynamic allocation:
I (405) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (411) heap_init: At 3FFC0E38 len 0001F1C8 (124 KiB): DRAM
I (417) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (424) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (430) heap_init: At 400915EC len 0000EA14 (58 KiB): IRAM
I (436) cpu_start: Pro cpu start user code
I (7) cpu_start: Starting scheduler on PRO CPU.
FAT filesystem appears to be corrupted. If you had important data there, you
may want to make a flash snapshot to try to recover it. Otherwise, perform
factory reprogramming of MicroPython firmware (completely erase flash, followed
by firmware programming).
[Continuously repeating last 4 lines]
5. If I try to erase flash in this mode (booting with GPIO0 unconnected).
esptool.py v2.1
Connecting........_____....._____....._____....._____....._____....._____....._____....._____....._____....._____
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
I read somewhere that I need to connect EN to GND when 'connecting....' appears. But when I do this response mentioned in (2) appears.
6. I have also tried to connect the RTS and DTR of USB2Serial Converter with EN and GPIO0 with a breadboard circuit (BC547 and 10K res) emulating this. https://robu.in/wp-content/uploads/2019 ... BU.IN_.pdf
-> gave a gibberish response on terminal while booting, so I didn't proceed with this.
7. Tried holding GPIO0 to low and running the erase flash command, but same response. (mentioned in point (5)).
Please help me out in this situation. I'm not sure what I am missing in the procedure
I am new to this mcu and facing some issue with installing micropython on it. So here is the story:
I have a PCB on which WROOM is mounted (it's pins are connected to several other components). To install micropython on it. I have done the following:
1. connections: PC -> USB2Serial Converter -> UART0. I ground the GPIO0 and power on the MCU. I get this message on the terminal:
rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download
2. Now, I close the terminal (connected to UART0) and try this:
~ ❯❯❯ esptool --chip esp32 --port /dev/ttyUSB0 erase_flash
esptool.py v2.1
Connecting....
Chip is ESP32D0WDQ5 (revision (unknown 0xa))
Enabling default SPI flash mode...
Erasing flash (this may take a while)...
A fatal error occurred: ESP32 ROM does not support function erase_flash
I am not able to get around this error
3. I try to run next command to write the flash
❯ esptool --chip esp32 --port /dev/ttyUSB0 write_flash -z 0x1000 <path to bin file>
esptool.py v2.1
Connecting...
Chip is ESP32D0WDQ5 (revision (unknown 0xa))
Enabling default SPI flash mode...
Configuring flash size...
Auto-detected Flash size: 4MB
Erasing flash...
Compressed 1087456 bytes to 687409...
Took 3.57s to erase flash block
Wrote 1087456 bytes (687409 compressed) at 0x00001000 in 73.9 seconds (effective 117.6 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting...
So, it completes successfully as I see.
4. Resetting the MCU (with GPIO0 unconnected) gives this on UART0
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:4732
load:0x40078000,len:7496
load:0x40080400,len:5512
entry 0x4008114c
I (401) cpu_start: Pro cpu up.
I (401) cpu_start: Single core mode
I (401) heap_init: Initializing. RAM available for dynamic allocation:
I (405) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (411) heap_init: At 3FFC0E38 len 0001F1C8 (124 KiB): DRAM
I (417) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (424) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (430) heap_init: At 400915EC len 0000EA14 (58 KiB): IRAM
I (436) cpu_start: Pro cpu start user code
I (7) cpu_start: Starting scheduler on PRO CPU.
FAT filesystem appears to be corrupted. If you had important data there, you
may want to make a flash snapshot to try to recover it. Otherwise, perform
factory reprogramming of MicroPython firmware (completely erase flash, followed
by firmware programming).
[Continuously repeating last 4 lines]
5. If I try to erase flash in this mode (booting with GPIO0 unconnected).
esptool.py v2.1
Connecting........_____....._____....._____....._____....._____....._____....._____....._____....._____....._____
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
I read somewhere that I need to connect EN to GND when 'connecting....' appears. But when I do this response mentioned in (2) appears.
6. I have also tried to connect the RTS and DTR of USB2Serial Converter with EN and GPIO0 with a breadboard circuit (BC547 and 10K res) emulating this. https://robu.in/wp-content/uploads/2019 ... BU.IN_.pdf
-> gave a gibberish response on terminal while booting, so I didn't proceed with this.
7. Tried holding GPIO0 to low and running the erase flash command, but same response. (mentioned in point (5)).
Please help me out in this situation. I'm not sure what I am missing in the procedure