Hello,
I am new to platformIO community and try my best to not go against any community rules. After spending a lot of time reading posts on different forums I have not come any close to a solution.
Hardware
I currently work with a custom designed board based on a ESP32-S3-Minni-1 MCN4R2. This unit has 4 MB QSPI Flash and 2 MB QSPI RAM. The board uses a USB connection into pins 23 and 24, has a boot switch and a reset switch. IO 45 is not used and IO46 is tied to GND. Currently IO3 is tied to 3.3V.
Behavior
When I first push the boot switch and then the reset switch the unit moves into bootloading mode as it should and I can upload my firmware. Based on many comments online I was hoping that I would have to do this only for the first upload and consecutive uploads would automatically work.
Unfortunately that is not the case. Not only that, the board also does not reset after a firmware upload. Only after a manual reboot the new code can be used.
Error Messages
Depending on the entries in platformio.ini the error messages differ. I either get:
- A serial exception error occurred: Write timeout
- A fatal error occurred: Failed to connect to ESP32-S3: Wrong boot mode detected (0x2b)! The chip needs to be in download mode.
- Failed to get PID of a device on com12
platformio.exe device list results in:
COM12
-----
Hardware ID: USB VID:PID=303A:1001 SER=E8:06:90:96:EE:18
Description: USB Serial Device (COM12)
Board definitions
I have experimented a lot with the content of platformio.ini and BD612.json. They currently are:
[env:BD612]
board = BD612
framework = arduino
platform = espressif32
;upload_port = COM12
;
; [env:esp32-s3-devkitc-1]
; platform = espressif32
; board = esp32-s3-devkitc-1
; framework = arduino
;
; board_build.arduino.memory_type = qio_qspi
; board_build.flash_mode = qio
; board_build.psram_type = qio
; board_upload.flash_size = 4MB
; board_upload.maximum_size = 4194304
; board_build.partitions = default.csv
; board_build.extra_flags = -DBOARD_HAS_PSRAM
The upload does not change if I use [env:BD612] or [env:esp32-s3-devkitc-1] I have tried both.
The BD612.json file is currently:
{
“build”: {
“arduino”:{
“ldscript”: “esp32s3_out.ld”,
“partitions”: “default.csv”,
“memory_type”: “qio_opi”
},
“core”: “esp32”,
“extra_flags”: [
“-DBOARD_HAS_PSRAM”,
“-DARDUINO_USB_MODE=1”,
“-DARDUINO_USB_CDC_ON_BOOT=1”,
“-DARDUINO_ESP32S3_DEV”
],
“f_cpu”: “240000000L”,
“f_flash”: “80000000L”,
“flash_mode”: “qio”,
“hwids”: [
[
“0X303A”,
“0x1001”
]
],
“mcu”: “esp32s3”,
“variant”: “esp32s3”
},
“connectivity”: [
“wifi”,
“bluetooth”
],
“debug”: {
“default_tool”: “esp-builtin”,
“onboard_tools”: [
“esp-builtin”
],
“openocd_target”: “esp32s3.cfg”
},
“frameworks”: [
“arduino”,
“espidf”
],
“name”: “BD612”,
“upload”: {
“flash_size”: “4MB”,
“maximum_ram_size”: 327680,
“maximum_size”: 4194304,
“require_upload_port”: true,
“speed”: 460800
},
“url”: “https://www.somename.com”,
“vendor”: “Vendorname”
}
On a few occasions the automatic upload worked but I was never able to understand why and how I could make it a regular occurence.
Any help is greatly appreciated.
Thanks