ESP32-S3-Zero does not work on PlatformIO

Hi guys, I’m trying to program my esp32-s3-zero (https://www.waveshare.com/wiki/ESP32-S3-Zero) using platform.io in VSCode. However, I am not able to correctly configure the board in platformio.ini, when I select the “esp32-s3-devkitM-1” board I receive the message that it was not found and cannot be configured, when using “esp32-s3-devkitc -1” the board is found and I compile the project and it is written to the board, but the board does not run the code, a simple blink does not work. I am already able to program the board using the Arduino IDE by selecting the ESP32-S3 Dev Module, however the same code that works on the Arduino does not work on the platform with the esp32-s3-devkitc-1.

Has anyone ever gone through something similar? In Platformio I am using the Arduino framework.

image

Please try default settings in platformio.ini:

[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino

Make sure you have selected the correct com port and upload a sketch.

If you have any error messages, please post them here using pre-formatted text.

I used your configuration and the code compiles without any errors, but the board does not execute the code. As the board uses USB and does not have any serial USB chip, I cannot know what is being sent to the tx pin, but I can see from the oscilloscope that it is always sending the same data continuously, I believe the board is in a data loop. restart, maybe the watchdog acting up.

No matter what code I try to compile, it doesn’t run. A simple blink to the board’s LED works with the Arduino IDE, but it doesn’t work with the Platformio.

You need to enable USB-CDC by

build_flags = 
  -DARDUINO_USB_CDC_ON_BOOT=1

This allows you to use the Serial object.
After a reboot of the ESP32 your PC will detect a new Serial device.

Did you try a reset after uploading the code?

I enabled USB_CDC_ON_BOOT and now I can see the error message that esp returns. The problem is that my board has 4MB of Flash, and the esp32-s3-devkitc-1 has 8MB.

I activated the Flag “board_build.flash_size = 4MB” but the error continues after compiling for the board.

The esp32-s3-devkit-c1 has 8 MB flash and is using the default_8MB partition layout, which is too large for your board.

Therefore you need to change the partition layout:

board_build.partitions = default.csv

or use a custom partition layout which fits into 4 MB flash.

Sorry for the lack of knowledge, I’ve never dealt with partitions in esp. Where can I find this default.csv file?

It is part of the framework and should be available.
Do you have an error message about a missing default.csv?

Ah ok, it compiled with the default.csv, it didn’t return any errors but it also didn’t work again and I got the same error regarding flash.

Do you have a link to your board or can you name the exact ESP32-S3 module type?

Sorry, you said this in the first post.
It seems to be an ESP32-S3FH4R2, 4MB Flash and 2MB PS-RAM.

Please try

[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
board_upload.flash_size = 4MB
board_build.partitions = default.csv
build_flags = 
  -DARDUINO_USB_CDC_ON_BOOT=1
  -DBOARD_HAS_PSRAM

Oh man, this works perfectly now :pray:

Thank you very much friend, now I can continue with my project :grinning:

Okay, cool.

I have created a board file for the ESP32-S3-FH4R2 in my pio-boards repository.
This should make it easier to use in the future.

Create a file C:\Users\<username>\.platformio\boards\esp32-s3-fh4r2.json.
Copy the content of esp32-s3-fh4r2.json into the file.

Use the following for the platformio.ini

[env:esp32-s3-fh4r2]
platform = espressif32
framework = arduino
board = esp32-s3-fh4r2

Let me know if this works for you.

1 Like

It works for me, Thank you! hope this .json could be in the official support

1 Like