Hi!
Newbie here, trying to move from Arduino IDE to VSC + PlatformIO and having a really hard time. I have been working with Arduino for about 5 years now, I am pretty decent at the hardware side of things but software has always been my weak point.
I make my own PCBs, and lately I’ve been using ESP32-S3. In Arduino IDE I use the “ESP32S3 Dev Module” board and all my PCB’s work just fine.
For PlatformIO, I’ve been having tons of problems. I use the ESP32-S3-WROOM-1-N4 module, and there does not seem to be a default board that works well with this basic module.
I found this post:
And I managed to create a new JSON file for a new board from the info on that post.
I then found the problem that the Arduino pins header file was missing, I added one on .platformio\packages\framework-arduinoespressif32\variants
Then I thought I had finally managed to fix it.
I uploaded a simple sketch, it worked and I could use the serial monitor.
But then I tried to port a bigger sketch from another project and it entered a boot loop as soon as I uploaded the code.
The error I get is this:
ELF file SHA256: 6360e88d7b7dd159
Rebooting...
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x2b (SPI_FAST_FLASH_BOOT)
Saved PC:0x42035cca
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbd8
load:0x403cc700,len:0x2a80
entry 0x403c98d0
assert failed: heap_caps_free heap_caps.c:381 (heap != NULL && "free() target pointer is outside heap areas")
Backtrace: 0x40377122:0x3fceb9c0 0x4037a5bd:0x3fceb9e0 0x4037ff19:0x3fceba00 0x403776d2:0x3fcebb30 0x4037ff49:0x3fcebb50 0x42009d11:0x3fcebb70 0x42009dfa:0x3fcebb90 0x420023c9:0x3fcebbb0 0x4200240e:0x3fcebbd0 0x420029a5:0x3fcebc20 0x4200b58a:0x3fcebc50
I am no expert, but since it says something about heap, I assume it is trying to use the wrong memory or something related with memory.
My board file is:
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"memory_type": "qio_qspi"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_LOLIN_S3",
"-DARDUINO_USB_MODE=1",
"-DARDUINO_USB_CDC_ON_BOOT=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"hwids": [
[
"0x303A",
"0x1001"
]
],
"mcu": "esp32s3",
"variant": "EZY_4MB"
},
"connectivity": [
"wifi",
"bluetooth"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino"
],
"name": "EZY_4MB",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"wait_for_upload_port": true,
"require_upload_port": true,
"speed": 460800
},
"url": "https://www.lcsc.com/product-detail/WiFi-Modules_Espressif-Systems-ESP32-S3-WROOM-1-N4_C2913197.html",
"vendor": "Espressif Systems"
}
and my platformio.ini:
[env:EZY_4MB]
platform = espressif32
board = EZY_4MB
board_build.mcu = esp32s3
framework = arduino
monitor_speed = 921600
;upload_protocol = jlink
debug_tool = esp-builtin
; esp-builtin or jlink
debug_speed = 40000
upload_port = COM26
build_flags =
-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1
lib_deps = dfrobot/DFRobotDFPlayerMini@^1.0.6
Can you please point me in the right direction or point out any obvious errors?
Thanks in advance