I have been trying to develop a project based on esp32 s3 zero but I have lately faced some issues with the monitoring of the code running.
Basically I see nothing on the serial monitor when the uploading completes. some times it changes address from /dev/ttyACM0 to /dev/ttyACM1 or vice versa. But even when I choose to change the port I get nothing from the esp, like it is not running.
--- Terminal on /dev/ttyACM0 | 9600 8-N-1
--- Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at https://bit.ly/pio-monitor-filters
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
* Terminal will be reused by tasks, press any key to close it.
When uploading I have to press the reset while pressing the boot to sync.
Here is my platformio.ini:
[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
board_build.mcu = esp32s3
;platform_packages = tool-esptoolpy @ ~1.40501.0
build_flags =
-DARDUINO_USB_MODE=1
-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MSC_ON_BOOT=0
-DARDUINO_USB_DFU_ON_BOOT=0
-DCORE_DEBUG_LEVEL=1
monitor_speed = 9600
upload_port = /dev/ttyACM0
monitor_port = /dev/ttyACM1
;monitor_rts = 0
;monitor_dtr = 0
board_upload.flash_size = 4MB
board_build.partitions = Partition_Table.csv
lib_deps =
https://github.com/bblanchon/ArduinoJson
ESP Async WebServer
The esptool from cli reports for my esp32:
esptool.py v4.7.0
Serial port /dev/ttyACM0
Connecting......
Detecting chip type... ESP32-S3
Chip is ESP32-S3 (QFN56) (revision v0.2)
Features: WiFi, BLE, Embedded Flash 4MB (XMC), Embedded PSRAM 2MB (AP_3v3)
Crystal is 40MHz
I am working on an Ubuntu PC running VSCode 1.93.1 Platformio Core 6.1.15
and Home 3.4.4
Can you simplify your project (or create a new one) with just
[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
build_flags =
-DARDUINO_USB_CDC_ON_BOOT=1
-DBOARD_HAS_PSRAM
board_upload.flash_size = 4MB
board_build.partitions = huge_app.csv
With src/main.cpp
#include <Arduino.h>
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println("Hello");
delay(1000);
}
does that output anything at all?
Thanks [maxgerhardt] for your answer.
I followed your advice and created a simple new project. The platform.ini has the entries you suggested and the simple src/main.cpp code. Just to mention that I changed the board to esp32-s3-devkitm-1 (This is the board initially suggested to use by the maker and I reverted to it).
Building is successful and uploading needs the pin sequence (press Reset while pressing Boot) but then is successful, too. Going now on Serial Monitor there is /dev/ttyACM0 available selecting it and starting monitoring shows immediately nothing. But then after repetitive selects on port brings the following:
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x23 (DOWNLOAD(USB/UART0))
Saved PC:0x40378cd3
waiting for download
Only after I press Reset pin on the dev board I get
Hello
Hello
So now to sum it up:
- To download I have to press the Reset while I press the Boot
- To monitor I have to Reset and then select Monitor. It seems that monitoring is not automatic.
Is this normal behavior? Many thanks!
Mhm. At least the “hold BOOT0 before connecting the USB cable” is documented at the board’s wiki:
Not 100% about ESP32-S3 boards with no USB-to-UART converter and using the Hardware CDC (no TinyUSB) if that’s supposed to be correct or not.
You can test the opposite way though: Switch to using TinyuSB (USB mode 0), then it should accept a reset method where you don’t have to press any buttons (except for the very first sketch upload of course).
Try and use this exact platformio.ini
[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
build_flags =
-DARDUINO_USB_MODE=0
-DARDUINO_USB_CDC_ON_BOOT=1
-DBOARD_HAS_PSRAM
build_unflags = -DARDUINO_USB_MODE=1
board_upload.flash_size = 4MB
board_build.partitions = huge_app.csv
; setup right reset method (comment this out on the first upload)
board_upload.wait_for_upload_port = yes
board_upload.use_1200bps_touch = yes
The Hold+Boot or Press Reset while Pressing Boot is not so much of an issue for me. The Serial Monitor though is a major issue because you really don’t know what is happening to your code.
When the board is not rebooted to run the firmware, your code doesn’t run at all – so you absolutely need to either press the reset button or try the above upload method that hopefully auto-resets the chip properly after the upload.
Thank you maxgerhardt for your help!