Can't get REPL after loading micropython on ESP32-S2 Feather

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
karltbraun
Posts: 7
Joined: Thu Jan 06, 2022 4:15 am

Can't get REPL after loading micropython on ESP32-S2 Feather

Post by karltbraun » Thu Jan 06, 2022 4:26 am

Greetings -
I've tried several times to flash micropython on to my ESP32-S2 Feather. I've used
* Adafruit web espytool
* Command line espytool
* Thonny install/update firmware tool
all with the same results and per the instructions. After flashing the firmware, hit reset, and the serial port disappears. Before resetting, the serial port is there, but can't raise the REPL (which, I think, is expected).

After doing the write, there are the messages:
WARNING: ESP32-S2FNR2 chip was placed into download mode using GPIO0. esptool.py can not exit the download mode over USB. To run the app, reset the chip manually. As mentioned, after reset, the serial port goes away and I have to repeat by going into flash mode (boot-reset).

I'm on an iMac and have been developing off this (including with circuitpython on the same board).
Firmware used:
* esp32-20210902-v1.17.bin and
* featherS2-20210902-v1.17.bin

Any help appreciated.

p_j
Posts: 102
Joined: Mon Aug 23, 2021 1:08 pm
Location: Sydney

Re: Can't get REPL after loading micropython on ESP32-S2 Feather

Post by p_j » Sat Jan 08, 2022 11:10 am

How are you connecting your ESP32-S2 to your MAC? Are you using a USB cable plugged into the Feather USB port or are you connecting directly to the RX/TX pins on the Feather?

karltbraun
Posts: 7
Joined: Thu Jan 06, 2022 4:15 am

Re: Can't get REPL after loading micropython on ESP32-S2 Feather

Post by karltbraun » Mon Jan 17, 2022 11:40 pm

USB cable.
(I've been successful with this cable, port, and setup on multiple boards, including one just like this one; although it's possible I'm screwing up the process somehow).

nadvorvo
Posts: 3
Joined: Tue Jan 18, 2022 1:31 pm

Re: Can't get REPL after loading micropython on ESP32-S2 Feather

Post by nadvorvo » Tue Jan 18, 2022 1:43 pm

Hi @karltbraun,
have you solved the issue?
I am facing same problem:
flashed ESP32_S2_WROVER-20220117-v1.18.bin to my ESP32-S2-WROVER

Code: Select all

esptool.py --chip esp32s2 --port COM7 erase_flash
esptool.py --port COM7 flash_id
esptool.py --chip esp32s2 --port COM7 -b 460800 write_flash -z 0x1000 ESP32_S2_WROVER-20220117-v1.18.bin

1.18.bin
esptool.py v3.2
Serial port COM7
Connecting...
Chip is ESP32-S2
Features: WiFi, No Embedded Flash, No Embedded PSRAM, ADC and temperature sensor calibration in BLK2 of efuse V2
Crystal is 40MHz
MAC: 84:f7:03:c2:e2:f0
Stub is already running. No upload is necessary.
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x0012afff...
Compressed 1219936 bytes to 803840...
Wrote 1219936 bytes (803840 compressed) at 0x00001000 in 19.9 seconds (effective 490.7 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
Then reset board and there is no REPL on programing UART0 pins?

Thank you in advance for your assistance.
Regards, Vojtech

p_j
Posts: 102
Joined: Mon Aug 23, 2021 1:08 pm
Location: Sydney

Re: Can't get REPL after loading micropython on ESP32-S2 Feather

Post by p_j » Tue Jan 18, 2022 3:42 pm

I had this problem last year when I was compiling micropython for a custom board.

I can't remember the exact details on the root cause of the problem but basically it is an issue with USB on the ESP32-S2. When you compile micropython with USB support (tinyusb) on the esp32-s2 the chip runs really slow when the USB cable isn't connected.

For this reason on our ESP32-S2 boards I have disabled USB support in micropython. I haven't used the feathers2 firmware however I'm guessing that it has USB disabled for the above reason.

What you need to do is use a usb-serial cable and connect it to the repl pins on the feather S2. This should work fine but obviously not as convenient as using a USB cable for power/repl.

The other option is to use webrepl however note that webrepl on the S2 only works from the command line and not through the web interface.

Hope that helps!

nadvorvo
Posts: 3
Joined: Tue Jan 18, 2022 1:31 pm

Re: Can't get REPL after loading micropython on ESP32-S2 Feather

Post by nadvorvo » Tue Jan 18, 2022 6:57 pm

Hi p_j,
Thank you for your reply. I am not using feathers2. I am using ESP32-S2-WROVER.
GPIO43,44 are used for programing (connected over usb-serial cable).
I expect REPL will be available on same pins (GPIO43,44)?
I will try webrepl tomorrow.

Thank you in advance for your assistance.
Regards, Vojtech
p_j wrote:
Tue Jan 18, 2022 3:42 pm
I had this problem last year when I was compiling micropython for a custom board.

I can't remember the exact details on the root cause of the problem but basically it is an issue with USB on the ESP32-S2. When you compile micropython with USB support (tinyusb) on the esp32-s2 the chip runs really slow when the USB cable isn't connected.

For this reason on our ESP32-S2 boards I have disabled USB support in micropython. I haven't used the feathers2 firmware however I'm guessing that it has USB disabled for the above reason.

What you need to do is use a usb-serial cable and connect it to the repl pins on the feather S2. This should work fine but obviously not as convenient as using a USB cable for power/repl.

The other option is to use webrepl however note that webrepl on the S2 only works from the command line and not through the web interface.

Hope that helps!

karltbraun
Posts: 7
Joined: Thu Jan 06, 2022 4:15 am

Re: Can't get REPL after loading micropython on ESP32-S2 Feather

Post by karltbraun » Tue Jan 18, 2022 9:35 pm

Not yet resolved
p_j wrote:
Tue Jan 18, 2022 3:42 pm
I had this problem last year when I was compiling micropython for a custom board.

I can't remember the exact details on the root cause of the problem but basically it is an issue with USB on the ESP32-S2. When you compile micropython with USB support (tinyusb) on the esp32-s2 the chip runs really slow when the USB cable isn't connected.

For this reason on our ESP32-S2 boards I have disabled USB support in micropython. I haven't used the feathers2 firmware however I'm guessing that it has USB disabled for the above reason.

What you need to do is use a usb-serial cable and connect it to the repl pins on the feather S2. This should work fine but obviously not as convenient as using a USB cable for power/repl.

The other option is to use webrepl however note that webrepl on the S2 only works from the command line and not through the web interface.

Hope that helps!

p_j
Posts: 102
Joined: Mon Aug 23, 2021 1:08 pm
Location: Sydney

Re: Can't get REPL after loading micropython on ESP32-S2 Feather

Post by p_j » Thu Jan 20, 2022 1:08 am

I always get confused with the pin numbers, note that the pin numbers on the esp32-s2 chip are different to the pin numbers on the various modules.

If you are using an ESP32-S2-WROVER the repl should be on the following pins:

-----| ESP32-S2 CHIP | WROVER MODULE
----------------------------------------------------------------
RX | PIN 49 - U0RXD | PIN 38 - RXOD
TX | PIN 48 - U0TXD | PIN 37 - TXOD

See if that works for you.

nadvorvo wrote:
Tue Jan 18, 2022 6:57 pm
Hi p_j,
Thank you for your reply. I am not using feathers2. I am using ESP32-S2-WROVER.
GPIO43,44 are used for programing (connected over usb-serial cable).
I expect REPL will be available on same pins (GPIO43,44)?
I will try webrepl tomorrow.

Thank you in advance for your assistance.
Regards, Vojtech
p_j wrote:
Tue Jan 18, 2022 3:42 pm
I had this problem last year when I was compiling micropython for a custom board.

I can't remember the exact details on the root cause of the problem but basically it is an issue with USB on the ESP32-S2. When you compile micropython with USB support (tinyusb) on the esp32-s2 the chip runs really slow when the USB cable isn't connected.

For this reason on our ESP32-S2 boards I have disabled USB support in micropython. I haven't used the feathers2 firmware however I'm guessing that it has USB disabled for the above reason.

What you need to do is use a usb-serial cable and connect it to the repl pins on the feather S2. This should work fine but obviously not as convenient as using a USB cable for power/repl.

The other option is to use webrepl however note that webrepl on the S2 only works from the command line and not through the web interface.

Hope that helps!

nadvorvo
Posts: 3
Joined: Tue Jan 18, 2022 1:31 pm

Re: Can't get REPL after loading micropython on ESP32-S2 Feather

Post by nadvorvo » Thu Jan 20, 2022 10:52 am

Hi p_j,
I really appreciate the support you’ve given me.
In my HW I have connected right pins (PIN37,38) and it is functional. I am able to flash chip using ESP-PROG. (Also blink tutorial using esp-idf functional)

When I flash ESP32_S2_WROVER-20220117-v1.18.bin there is no REPL on pins 37,38.
Same when GENERIC_S2-20220117-v1.18.bin flashed

Is it really UART0? From repository it seems to me USB is enabled for REPL?
sdkconfig.usb (CONFIG_USB_ENABLED=y)
https://github.com/micropython/micropyt ... config.usb
https://github.com/micropython/micropyt ... main.c#L91

Thank you in advance for your assistance.
Regards, Vojtech
p_j wrote:
Thu Jan 20, 2022 1:08 am
I always get confused with the pin numbers, note that the pin numbers on the esp32-s2 chip are different to the pin numbers on the various modules.

If you are using an ESP32-S2-WROVER the repl should be on the following pins:

-----| ESP32-S2 CHIP | WROVER MODULE
----------------------------------------------------------------
RX | PIN 49 - U0RXD | PIN 38 - RXOD
TX | PIN 48 - U0TXD | PIN 37 - TXOD

See if that works for you.

p_j
Posts: 102
Joined: Mon Aug 23, 2021 1:08 pm
Location: Sydney

Re: Can't get REPL after loading micropython on ESP32-S2 Feather

Post by p_j » Fri Jan 21, 2022 6:46 am

Hi,

I have tested this out on a WROVER module I have here.

You are correct, the firmware on the website doesn't have REPL on pins 37,38. On that firmware I can only get REPL through the USB cable.

If you want to get REPL on pins 37,38 you need to compile micropython with tinyusb disabled. This will put the REPL back on pins 37,38. I don't fully understand the mechanics of why this works :lol: There may be an easier way but I'm not sure how.

Image

It's pretty easy to compile micropython and I would recommend doing this anyway.
nadvorvo wrote:
Thu Jan 20, 2022 10:52 am
Hi p_j,
I really appreciate the support you’ve given me.
In my HW I have connected right pins (PIN37,38) and it is functional. I am able to flash chip using ESP-PROG. (Also blink tutorial using esp-idf functional)

When I flash ESP32_S2_WROVER-20220117-v1.18.bin there is no REPL on pins 37,38.
Same when GENERIC_S2-20220117-v1.18.bin flashed

Is it really UART0? From repository it seems to me USB is enabled for REPL?
sdkconfig.usb (CONFIG_USB_ENABLED=y)
https://github.com/micropython/micropyt ... config.usb
https://github.com/micropython/micropyt ... main.c#L91

Thank you in advance for your assistance.
Regards, Vojtech
p_j wrote:
Thu Jan 20, 2022 1:08 am
I always get confused with the pin numbers, note that the pin numbers on the esp32-s2 chip are different to the pin numbers on the various modules.

If you are using an ESP32-S2-WROVER the repl should be on the following pins:

-----| ESP32-S2 CHIP | WROVER MODULE
----------------------------------------------------------------
RX | PIN 49 - U0RXD | PIN 38 - RXOD
TX | PIN 48 - U0TXD | PIN 37 - TXOD

See if that works for you.

Post Reply