Problems with ESP32-s3

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
automate1717
Posts: 10
Joined: Sat Jan 08, 2022 1:02 am

Problems with ESP32-s3

Post by automate1717 » Mon Jan 17, 2022 8:17 pm

I am still struggling with micropython on esp32-s3. I was able to get it run from source nut endure crashes in regards to memory.

I tried the latest image of 1.18 and I am able to do the erase and install but I am getting invalid header. I tried different memory addresses such as 0x0 and 0x8000 as well as the reccomended 0x1000 but I still get invalid header.

Has anyone got the same issue and/or have a solution? I felt the esp32-s3 is a very good option. I love the pico as well which is flawless with micropython but I am having a pain with getting external wifi to smoothly interface. I am working with esp01 at the moment. Thank you so much

[Moderator Note: I moved this from the announcements area into the more appropriate EPS32 area. Please don't hijack other peoples threads. Create a new thread in the appropriate area instead.]

seonr
Posts: 43
Joined: Mon Sep 10, 2018 6:54 am

Re: Problems with ESP32-s3

Post by seonr » Wed Feb 02, 2022 9:14 pm

Hiya! You not provided anywhere near enough info to be able to help you.

ESP32-S3 is flashed at 0x00 and flashes and works fine if you are using the correct board definition/firmware version for the dev board you have.

What ESP32-S3 boards are you using? Need to know that to determine the PSRAM and Flash size to make sure you are using a firmware version with matching partition table.

Please also post your esptool command so we can see how you are trying to flash it.

automate1717
Posts: 10
Joined: Sat Jan 08, 2022 1:02 am

Re: Problems with ESP32-s3

Post by automate1717 » Sat Feb 05, 2022 1:59 am

I have this board
ESP32­-S3­-DevKitC-1 - ESP32-S3-WROOM-2 - 32MB Flash 8MB PSRAM

I am using this tool
esptool.py v3.2

I have tried the following
esptool.py --chip esp32-s3 --port /dev/ttyUSB0 --baud 460800 write_flash -z 0x00 GENERIC_S3-20220117-v1.18.bin
esptool.py --chip esp32-s3 --port /dev/ttyUSB0 --baud 460800 write_flash -z 0x00 GENERIC_S3_SPIRAM-20220117-v1.18.bin

Sunstituing 0x00, I have tried 0x1000, 0x10000, 0x8000. I am getting invalid header in thonny with the adresses.

With 0x00, I get the following
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x10 (RTCWDT_RTC_RST),boot:0x18 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
Octal Flash Mode Enabled
For OPI Flash, Use Default Flash Boot Mode
mode:SLOW_RD, clock div:1
load:0x3fcd0108,len:0xf60
load:0x403b6000,len:0x978
load:0x403ba000,len:0x2c80
entry 0x403b616c
E (32) qio_mode: Failed to set QIE bit, not enabling QIO mode
W (32) bootloader_random: RNG for ESP32-S3 not currently supported
W (358) bootloader_random: RNG for ESP32-S3 not currently supported

Your help is greatly appreciated

automate1717
Posts: 10
Joined: Sat Jan 08, 2022 1:02 am

Re: Problems with ESP32-s3

Post by automate1717 » Sat Feb 05, 2022 5:52 pm

I am thinking the 32 MB of ram may have something to do with it. When I run chip_id, it comes back stating it could not determine the amount of ram and defaults to 4 MB. I have a board exactly like this one but only 8 MB and it is running in production.

Note: I tried to manually state the amount of ram but it failed and said that was not a valid entery. I tried by entering 32 MB and 32m but neither worked.

mwalimu
Posts: 6
Joined: Sat Jul 02, 2016 5:55 pm

Re: Problems with ESP32-s3

Post by mwalimu » Sat Feb 05, 2022 5:59 pm

You probably need to get the next version of esptool. I have the same board and was able to flash 1.18, but I had to update to the newest flash tools. However, even though I got it to work, it has lots of problems, the worst being that it reports 0 KB of storage. It appears that the esp-idf does not support 32Mb of flash.

automate1717
Posts: 10
Joined: Sat Jan 08, 2022 1:02 am

Re: Problems with ESP32-s3

Post by automate1717 » Sat Feb 05, 2022 6:39 pm

Thank you mwalimu

If you would please be so kind, please share what you did and I will continue to llook for a solution to the zeo kb.

I tried using esptool.py v3.2

Did you build from source? I never could get close to getting the downloads to work. Also, I once got where you are at with the 0 kb and I believe that is why too boot.py file was created and I cannot save anything and I tried with rshell and thonny.

Something else odd is that using idf, I only got it to work with version 4.4beta although 4.4 is out and I tried it.

Please see another post I put out where I list all my steps and one of them was removing usb from the config and the actual usb file. I have the 8 mb version of the board and it works perfectly and so far no issues found.

rira
Posts: 2
Joined: Sun Feb 13, 2022 2:16 pm

Re: Problems with ESP32-s3

Post by rira » Sun Feb 13, 2022 2:39 pm

The following protocol worked for my ESP32-S3-DEVKITC-1-N32R8V (WROOM2) to get a python repl without errors. Downside is only 16 out of 32 MB flash will be enabled. I believe this is a limitation of the esp-idf 4.4 package.

#built requirements
sudo apt-get install git wget flex bison gperf python3 python3-pip python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0

#allow current user read/write access to USB over serial port
sudo usermod -a -G dialout $USER

~/$ mkdir ~/esp
~/$ cd ~/esp

~/esp$ git clone --recursive -b v4.4-beta1 https://github.com/espressif/esp-idf.git
~/esp$ cd esp-idf
~/esp/esp-idf$ ./install.sh esp32s3
~/esp/esp-idf$ . ./export.sh
~/esp/esp-idf$ cd ..

~/esp$ mkdir mpy
~/esp$ cd mpy
~/esp/mpy$ git clone git://github.com/micropython/micropython --depth=1
~/esp/mpy$ cd ~/esp/mpy/micropython/ports/esp32/boards/

edit sdkconfig.spiram_sx
Change CONFIG_SPIRAM_MODE_QUAD=y -> CONFIG_SPIRAM_MODE_OCT=y

~/esp/mpy/micropython/ports/esp32/boards$ cd GENERIC_S3_SPIRAM/
edit mpconfigboard.cmake
comment out: boards/sdkconfig.usb -> # boards/sdkconfig.usb

~/esp/mpy/micropython/ports/esp32/boards/GENERIC_S3_SPIRAM$ cd ~/esp/mpy/micropython
~/esp/mpy/micropython$ make -C mpy-cross
~/esp/mpy/micropython$ cd ~/esp/mpy/micropython/ports/esp32/

edit Makefile
edit line: BOARD ?= GENERIC -> BOARD ?= GENERIC_S3_SPIRAM
edit line: idf.py $(IDFPY_FLAGS) build -> idf.py $(IDFPY_FLAGS) menuconfig

~/esp/mpy/micropython/ports/esp32$ make submodules
~/esp/mpy/micropython/ports/esp32$ make

in menuconfig -> serial flasher config:
enable Octal Flash
Set Flash size to 16 (later to 32 but current;y not supported)
After flashing -> reset

in menuconfig -> Partition Table:
custom partition table = partitions-16MiB.csv

press S to save

~/esp/mpy/micropython/ports/esp32$ make erase
~/esp/mpy/micropython/ports/esp32$ make deploy

~/esp/mpy/micropython/ports/esp32$ screen /dev/ttyUSB0 115200

androiddrew
Posts: 18
Joined: Sat Jan 23, 2021 7:24 pm

Re: Problems with ESP32-s3

Post by androiddrew » Mon Feb 14, 2022 4:36 pm

So I have a ESP32-S3-WROOM-1 N8R8 DevKitC-1 that I can't seem to get to work with the generic binaries. Is building from source the only option I have to use Micropython on the ESP32-S3? Is there not a matrix that could be added to build a couple of standard generic binaries to support the common flash sizes that come on there dev kits?

automate1717
Posts: 10
Joined: Sat Jan 08, 2022 1:02 am

Re: Problems with ESP32-s3

Post by automate1717 » Thu Feb 24, 2022 12:21 am

rira wrote:
Sun Feb 13, 2022 2:39 pm
The following protocol worked for my ESP32-S3-DEVKITC-1-N32R8V (WROOM2) to get a python repl without errors. Downside is only 16 out of 32 MB flash will be enabled. I believe this is a limitation of the esp-idf 4.4 package.

#built requirements
sudo apt-get install git wget flex bison gperf python3 python3-pip python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0

#allow current user read/write access to USB over serial port
sudo usermod -a -G dialout $USER

~/$ mkdir ~/esp
~/$ cd ~/esp

~/esp$ git clone --recursive -b v4.4-beta1 https://github.com/espressif/esp-idf.git
~/esp$ cd esp-idf
~/esp/esp-idf$ ./install.sh esp32s3
~/esp/esp-idf$ . ./export.sh
~/esp/esp-idf$ cd ..

~/esp$ mkdir mpy
~/esp$ cd mpy
~/esp/mpy$ git clone git://github.com/micropython/micropython --depth=1
~/esp/mpy$ cd ~/esp/mpy/micropython/ports/esp32/boards/

edit sdkconfig.spiram_sx
Change CONFIG_SPIRAM_MODE_QUAD=y -> CONFIG_SPIRAM_MODE_OCT=y

~/esp/mpy/micropython/ports/esp32/boards$ cd GENERIC_S3_SPIRAM/
edit mpconfigboard.cmake
comment out: boards/sdkconfig.usb -> # boards/sdkconfig.usb

~/esp/mpy/micropython/ports/esp32/boards/GENERIC_S3_SPIRAM$ cd ~/esp/mpy/micropython
~/esp/mpy/micropython$ make -C mpy-cross
~/esp/mpy/micropython$ cd ~/esp/mpy/micropython/ports/esp32/

edit Makefile
edit line: BOARD ?= GENERIC -> BOARD ?= GENERIC_S3_SPIRAM
edit line: idf.py $(IDFPY_FLAGS) build -> idf.py $(IDFPY_FLAGS) menuconfig

~/esp/mpy/micropython/ports/esp32$ make submodules
~/esp/mpy/micropython/ports/esp32$ make

in menuconfig -> serial flasher config:
enable Octal Flash
Set Flash size to 16 (later to 32 but current;y not supported)
After flashing -> reset

in menuconfig -> Partition Table:
custom partition table = partitions-16MiB.csv

press S to save

~/esp/mpy/micropython/ports/esp32$ make erase
~/esp/mpy/micropython/ports/esp32$ make deploy

~/esp/mpy/micropython/ports/esp32$ screen /dev/ttyUSB0 115200

I followed the above ran make and edited the config in the menuconfig as stated. I received the following error when make continued.

/tmp/confgen_tmpmgwbbn36:86 line was updated to CONFIG_SPIRAM_MEMTEST=n
/tmp/confgen_tmpmgwbbn36:88 line was updated to CONFIG_ESPTOOLPY_FLASHSIZE_4MB=n
/tmp/confgen_tmpmgwbbn36:90 line was updated to CONFIG_ESPTOOLPY_FLASHSIZE_16MB=n
Traceback (most recent call last):
File "makeimg.py", line 59, in <module>
partition_table = load_partition_table(arg_partitions_bin)
File "makeimg.py", line 37, in load_partition_table
with open(filename, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'build-GENERIC_S3_SPIRAM/partition_table/partition-table.bin'
make: *** [Makefile:35: all] Error 1

There is no partition_table directory in the build-GENERIC_S3_SPIRAM folder when I checked.

Any ideas? thank you so much

automate1717
Posts: 10
Joined: Sat Jan 08, 2022 1:02 am

Re: Problems with ESP32-s3

Post by automate1717 » Fri Feb 25, 2022 2:28 am

I was able to get by the error by first running make as described, making the changes in config as described and saving and continuing. I then changed the make file back from menuconfig to build and ran make and it compiled.

I still am not getting REPL. This is what I get in Thonny
Device is busy or does not respond. Your options:

- wait until it completes current work;
- use Ctrl+C to interrupt current work;
- use Stop/Restart to interrupt more and enter REPL.

Possibly the offset address is incorrect for the partition table?

Post Reply