No REPL on ESP32-S2

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
alexmus
Posts: 1
Joined: Sun Jun 20, 2021 9:36 am

No REPL on ESP32-S2

Post by alexmus » Mon Jun 21, 2021 7:15 am

Hello all,

I'm pretty new to Micropytohn firmware building process, but I tried to build the GENERIC_S2 esp32 port from current Micropython master and I was able to get a micropython.bin firmware executable.

Once deployed on my board (a simple standalone esp32-s2-wroom already checked with espressif examples) I have no REPL on UART0 (RX module pin 37 and TX module pin 38) but only the following:

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:0x12b0
load:0x4004c000,len:0x8c4
load:0x40050000,len:0x2ca4
entry 0x4004c1a8

I have no panic at 0x4004c1a8 so I think the firmware is running, but I'm not sure, any suggestion?

Here my deployment command:

esptool.py esp32s2 -p /dev/ttyUSB0 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size 4MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 micropython.bin

Here my IDF SDK version:

ESP-IDF v4.4-dev-4-g73db14240-dirty

Thanks in advance
Alex

haybarry
Posts: 8
Joined: Mon Nov 07, 2016 10:16 am

Re: No REPL on ESP32-S2

Post by haybarry » Mon Jun 21, 2021 10:15 pm

Hi Alexmus,

The ESP32S2 build seems to send REPL to the native USB port, not the UART port where you programmed the ESP32S2 from.

I have my S2 currently running MP 1.15 with USB Data Positive (White Wire) connected to ESP32S2 Pin 19 and USB Data Negative (Green Wire) connected to ESP32S2 Pin 20.

It connects as /dev/ttyACM1 on my RPi.

Cheers

Barry

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

Re: No REPL on ESP32-S2

Post by wangshujun@tom.com » Sun Jun 27, 2021 12:58 pm

I also encounter the same problem. After compiling and enabling USB, the repl of serial port will no longer respond

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

Re: No REPL on ESP32-S2

Post by wangshujun@tom.com » Wed Jun 30, 2021 2:13 pm

Try the following modifications to make USB and UART work at the same time:
1. main.c
83 line
#if CONFIG_USB_ENABLED
usb_init();
#endif
uart_init();

2. mphalport.c
121 line
#if CONFIG_USB_ENABLED
usb_tx_strn(str, len);
#endif
for (uint32_t i = 0; i < len; ++i) {
uart_tx_one_char(str);
}

After modification, UART and CDC can be opened at the same time by using the serial assistant.

but,use thonny opening any one, the other serial port can only output and can not input .

User avatar
hcet14
Posts: 34
Joined: Sat Dec 19, 2020 12:59 am

Re: No REPL on ESP32-S2

Post by hcet14 » Wed Jun 30, 2021 4:20 pm

Hi alexmus,

did you try firmware from here https://micropython.org/download/esp32/? Is your HW ok?
I'm a beginner with this stuff and no programmer at all.

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

Re: No REPL on ESP32-S2

Post by wangshujun@tom.com » Sun Jul 11, 2021 4:38 am

According to the previous modification, if only UART is connected and USB is not connected, the repl speed of UART will be very slow and not practical


wangshujun@tom.com wrote:
Wed Jun 30, 2021 2:13 pm
Try the following modifications to make USB and UART work at the same time:
1. main.c
83 line
#if CONFIG_USB_ENABLED
usb_init();
#endif
uart_init();

2. mphalport.c
121 line
#if CONFIG_USB_ENABLED
usb_tx_strn(str, len);
#endif
for (uint32_t i = 0; i < len; ++i) {
uart_tx_one_char(str);
}

After modification, UART and CDC can be opened at the same time by using the serial assistant.

but,use thonny opening any one, the other serial port can only output and can not input .

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

Re: No REPL on ESP32-S2

Post by wangshujun@tom.com » Tue Jul 13, 2021 1:09 am

Please try this firmware
esp12k is esp32s2 module
https://github.com/wangshujun-tj/mpy-Framebuf-boost

jlb
Posts: 1
Joined: Sun Oct 11, 2020 10:10 pm

Re: No REPL on ESP32-S2

Post by jlb » Sat Sep 25, 2021 7:31 pm

Hello, I have this same issue .
firmware seems to load but I get the following message when I open terminal :
--> A fatal error occurred: This chip is ESP32-S2 not ESP32. Wrong --chip argument?
is it possible to run Micropython on esp32S2 model??
do I have to upgrade esptool, I have version 2.8?
Do I set the target somehow I thought that esptool automatically does this.

Thank you fro any suggestions.
Jeff

bjames28
Posts: 14
Joined: Fri May 17, 2019 12:55 pm

Re: No REPL on ESP32-S2

Post by bjames28 » Sun Sep 26, 2021 12:34 pm

Hi,

I am not sure, but your problem seems very similar to what I had (esp32-ca-mb with esp32S2)
Try the solution described below, and give feedback if it works:

viewtopic.php?f=18&t=10151&start=10#p61272

leosok
Posts: 18
Joined: Sun May 02, 2021 10:10 pm

Re: No REPL on ESP32-S2

Post by leosok » Sat Oct 16, 2021 1:31 pm

wangshujun@tom.com wrote:
Tue Jul 13, 2021 1:09 am
Please try this firmware
esp12k is esp32s2 module
https://github.com/wangshujun-tj/mpy-Framebuf-boost
Thank you! This absolutely works on my board! Now I'd like to find out why my own build (from 1.17 master) does not.

Post Reply