Thanks again for leading me in the right direction. After a bit more study, I have created a bit more full-bodied solution outside of just the .ini file updates.
The following .json file is placed in the .platformio/platforms/espressif32/boards/
which then enables creating new projects using this name “esp32-s3-lcd-ev” as the board. The .json file also enables USB_CDC (CDC/JTAG) mode allowing the use of the USB connector for both serial as well as programming/debug and obviating the need for the BOOT button to program things - sweet.
esp32-s3-lcd-ev.json
{
"build": {
"arduino":{
"ldscript": "esp32s3_out.ld",
"partitions": "default_16MB.csv",
"memory_type": "qio_opi"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_ESP32S3_DEV",
"-DBOARD_HAS_PSRAM",
"-DARDUINO_USB_MODE=1",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"psram_type": "opi",
"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": "Espressif ESP32-S3-LCD-EV-N16 (16 MB QD, 16 MB PSRAM)",
"upload": {
"flash_size": "16MB",
"maximum_ram_size": 327680,
"maximum_size": 16777216,
"require_upload_port": true,
"speed": 921600
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html",
"vendor": "Espressif"
}
The following is my platformio.ini file which enables the log_e() function to print error logs. You can increase this LEVEL to 2 for warnings and 3 for info, 4 for debug.
[env:esp32-s3-lcd-ev]
platform = espressif32
board = esp32-s3-lcd-ev
framework = arduino
board_build.filesystem = littlefs
build_flags =
-D CORE_DEBUG_LEVEL=1
Here’s the simple program that shows some nice information about free memory, memory sizes, and cpu model/frequency/cores and such as well followed by a sample of the output using my board.
#include <Arduino.h>
void systemInfo() {
uint32_t psrSize, hSize, fSize;
uint32_t psrFree, hFree;
uint32_t maxAllocHeap, maxAllocPsram;
uint32_t freq;
uint8_t cores;
const char* model;
psrSize = ESP.getPsramSize();
fSize = ESP.getFlashChipSize();
hSize = ESP.getHeapSize();
psrFree = ESP.getFreePsram();
hFree = ESP.getFreeHeap();
maxAllocHeap = ESP.getMaxAllocHeap();
maxAllocPsram = ESP.getMaxAllocPsram();
cores = ESP.getChipCores();
freq = ESP.getCpuFreqMHz();
model = ESP.getChipModel();
Serial.printf("Model: %s, Cores:%u, Frequency:%lu\n", model, cores, freq);
Serial.printf("SIZE(K): Heap:%lu, PSram:%lu, Flash:%lu\n", hSize/1024, psrSize/1024, fSize/1024);
Serial.printf("Free(K): Heap:%lu, PSram:%lu\n", hFree/1024, psrFree/1024);
Serial.printf("MaxAlloc(K): Heap:%lu, PSram:%lu\n", maxAllocHeap/1024, maxAllocPsram/1024);
}
void setup() {
Serial.begin(115200);
while (!Serial)
;
// Without this, you won't see the startup messages below as the UART won't be
// reconnected yet or the monitor won't be re-instantiated in VSCode.
delay(1000);
systemInfo();
Serial.println("Setup completed.");
}
void loop() {
static int iters=0;
Serial.printf("Serial.println #%d\n", iters);
iters++;
log_e("log_e");
delay(1000);
}
Output from the program:
Model: ESP32-S3, Cores:2, Frequency:240
SIZE(K): Heap:382, PSram:16381, Flash:16384
Free(K): Heap:358, PSram:16381
MaxAlloc(K): Heap:327, PSram:16127
Setup completed.
Serial.println #0
[ 1098][E][main.cpp:48] loop(): log_e
Serial.println #1
[ 2099][E][main.cpp:48] loop(): log_e
Serial.println #2
[ 3099][E][main.cpp:48] loop(): log_e