I have spent the past 12+ hours (taking some short breaks only) trying to figure out how to configure the ESP32-S3-Mini from WeAct Studio. For the life of me, I simply cannot find the right settings.
A dumb and simple hello_world.cpp
code works fine when flashing it with the Arduino IDE after setting the USB CDC on boot
option to enabled (as previously reported EVERYWHERE), however, nothing seems to work on platfomio
. Believe me, I have read every result on the pio forum, SOVF and Google related to the configuration settings for the ESP32-S3 without any success.
These are my settings on the Arduino IDE:
and the successful output:
I have approached this through the creation of a custom .json
file for the device and also through different build_flags
. My objective is to “carbon copy” the same settings from the Arduino IDE to either of these two configuration files.
My latest platformio.ini
file looks like this:
[env:esp32s3]
platform = espressif32
board = esp32-s3-mini
framework = arduino
upload_protocol = esptool
monitor_speed = 460800 ; several posts saying that this could solve the issue
board_build.flash_mode = dio ; read point 1 below
build_flags =
-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1
-D ARDUINO_DFU_ON_BOOT=0
-D ARDUINO_CORE_DEBUG=0
-D ARDUINO_UPLOAD_MODE=0
-D ARDUINO_ERASE_FLASH_BEFORE_UPLOAD=1
while my custom configuration for the WeAct Mini, named esp32-s3-mini.json
is configured as follows:
FIle: esp32-s3-mini.json
{
"build": {
"arduino":{
"ldscript": "esp32s3_out.ld",
"memory_type": "qio_qspi",
"partitions": "default.csv"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=0",
"-DARDUINO_USB_MSC_ON_BOOT=0"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"hwids": [
[
"0x303A",
"0x1001"
]
],
"mcu": "esp32s3",
"variant": "esp32s3"
},
"connectivity": [
"bluetooth",
"wifi"
],
"debug": {
"default_tool": "esp-builtin",
"onboard_tools": [
"esp-builtin"
],
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "esp32-s3-mini",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"speed": 921600
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitm-1.html",
"vendor": "Espressif"
}
Amongst the many issues that I am facing, I can list them as follows:
- Boot-looping. I am aware that changing the
flash_mode
to qio could work. I doesn’t. The board constantly connects/disconnects after printing this on the serial monitor:
- Serial COM port is lost. Sometimes after changing some of the flags, the port dissapears and I am unable to upload the code. Only after connecting the board while pressing boot + short rst pulse + release boot push buttons I can make it accept code again. This works in 1 of 5 attempts only. Highly frustrating.
-
There isn’t a specific list of flags available for
pio
that to copy the same settings from the Arduino IDE. For instance, I created the flag-D ARDUINO_ERASE_FLASH_BEFORE_UPLOAD=1
expecting that it could work. Since the project configuration and compilation were successful I assument that this could be the right flag, however, I have not found any clear references that confirm this flag as correct. -
After adding the lines:
build_flags =
-DBOARD_HAS_PSRAM
-mfix-esp32-psram-cache-issue
as recommended here the bootlooping occurs at a later point, compared to the one shown in Point 1. I am aware that these lines apply only when having external RAM, however, a this point I am testing EVERY possibility.
What am I missing? At this point I can’t think clearly and my head is just foggy nand extremely annoyed by these boards.
Final question. How can I prevent the board writing the memory information after bootup? My final application might have some issues with that.
To be frank, I find these ESP32-S3 chips extremely unreliable, convoluted and extremely poorly documented and poorly supported by espressif. What is the deal with them?