Can't flash an ESP32-S2

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Can't flash an ESP32-S2

Post by pythoncoder » Tue Mar 15, 2022 4:39 pm

Will do. Before I do I'm still puzzled by this and have a couple of questions.

With a USB interface on GPIO19 and 20 would I be able to flash firmware on that port?

Given that the chip supports USB natively, why have Espressif implemented a USB-UART bridge?
Peter Hinch
Index to my micropython libraries.

User avatar
russ_h
Posts: 88
Joined: Thu Oct 03, 2019 2:26 am
Contact:

Re: Can't flash an ESP32-S2

Post by russ_h » Tue Mar 15, 2022 5:35 pm

Given that the chip supports USB natively, why have Espressif implemented a USB-UART bridge?
The native USB has some limitations (https://docs.espressif.com/projects/esp ... nsole.html) that could be annoying during development. One advantage is using the native USB with a debugger without affecting the serial console.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Can't flash an ESP32-S2

Post by pythoncoder » Wed Mar 16, 2022 9:56 am

Thank you - very informative.
Peter Hinch
Index to my micropython libraries.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Can't flash an ESP32-S2

Post by pythoncoder » Wed Mar 16, 2022 10:26 am

@ash10 I have raised this issue.
Peter Hinch
Index to my micropython libraries.

ash10
Posts: 11
Joined: Tue Mar 08, 2022 1:43 pm

Re: Can't flash an ESP32-S2

Post by ash10 » Wed Mar 16, 2022 11:04 am

With a USB interface on GPIO19 and 20 would I be able to flash firmware on that port?
I tried to flash firmware via GPIO19/20 and it works but the REPL still doesn't come up on the ESP-IDF interface, even after hard reset.
It comes up as a COM port which you can connect to with a terminal application (I used PuTTY initially and I could access the terminal).

Currently I'm using Thonny and it works well for uploading/running code as well as accessing the internal file system with a GUI interface (which is convenient). I also tried to flash firmware via Thonny, but this didn't work and the COM port on GPIO19/20 disappeared. So I had to flash again using ESP-IDF and the COM port returned on GPIO19/20.

I also tried uPyCraft which was quite unstable and tried the Pymakr plugin for VSCodes which would work on and off sporadically for accessing the REPL but I couldn't upload/download/run any code.

So, currently, the most reliable way of using MicroPython on the S2 board I am working on, is to flash MicroPython via ESP-IDF and then use Thonny to access the REPL or upload/download/run code. Note: the COM port name differs in upload mode (IO0 pulled to ground) and normal use mode.
@ash10 I have raised this issue.
Thank you

dk2jk
Posts: 4
Joined: Sun Jun 13, 2021 9:09 am
Location: JO41dl

Re: Can't flash an ESP32-S2

Post by dk2jk » Sat Apr 23, 2022 9:30 am

Hello,
I have the same problem. Board is: ESP32-s2-soala-1 , chip esp32-s2-wrover.
Flashing with Thonny seems to work:
.../thonny/bin/python3.7 -u -m esptool --port /dev/ttyUSB0 write_flash --flash_mode keep --flash_size detect 0x1000 /home/dk2jk/Downloads/ESP32_S2_WROVER-20220117-v1.18.bin
esptool.py v3.1
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP32-S2
Chip is ESP32-S2
Features: WiFi, ADC and temperature sensor calibration in BLK2 of efuse
Crystal is 40MHz
MAC: 7c:df:a1:06:98:ea
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Flash will be erased from 0x00001000 to 0x0012bfff...
Compressed 1222704 bytes to 806301...
Writing at 0x00001000... (2 %)
Writing at 0x00012557... (4 %)
...
Writing at 0x00129b5b... (100 %)
Wrote 1222704 bytes (806301 compressed) at 0x00001000 in 71.5 seconds (effective 136.7 kbit/s)...
Hash of data verified.

Leaving...
Done!

Close !


After Push Reset Button :

ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3ffe6100,len:0xf48
load:0x4004c000,len:0xaec
load:0x40050000,len:0x2bd4
entry 0x4004c1b0


Is there a new binary file, correcting the REPL problem ?

with regards
Heribert

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Can't flash an ESP32-S2

Post by Roberthh » Sat Apr 23, 2022 10:06 am

For a strange reason, on these boards REPL appears only at the UART port. You can as well try to install the most recent daily build. On my feathers2 board it has a REPL at USB.

wangshujun@tom.com
Posts: 61
Joined: Fri Feb 15, 2019 9:22 am

Re: Can't flash an ESP32-S2

Post by wangshujun@tom.com » Sun Apr 24, 2022 7:16 am

It seems that you have successfully refreshed the mpy firmware, but repl is on the USB port. You can recompile the firmware and cancel the USB option

dk2jk
Posts: 4
Joined: Sun Jun 13, 2021 9:09 am
Location: JO41dl

Re: Can't flash an ESP32-S2

Post by dk2jk » Mon May 09, 2022 9:44 pm

"You can recompile the firmware and cancel the USB option"

Sorry , it may be simple, but
how do you do that ?
with regards

Update: the problem is solved. With the newest binfile for esp32-s2 '
the serial port starts as expected. No compiling necessary...

Post Reply