I got it working like this:
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
; Used ESP32 S3 module: ESP32-S3-WROOM-1-N4CT-ND
[env:lolin_s3]
platform = espressif32
board = lolin_s3
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 = COM5
lib_deps =
; For this to work the file lolin_s3.json was modified.
; The modified version of the file is included in the folder "boards" of this project.
; You need to replace the original lolin_s3.json file in the %HOMEPATH%\.platformio\platforms\espressif32\boards directory
; Rename the file from this project to lolin_s3.json
Modified lolin_s3.json file content:
{
"build": {
"arduino": {
"ldscript": "esp32s3_out.ld",
"memory_type": "qio_qspi"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_LOLIN_S3",
"-DARDUINO_USB_MODE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"hwids": [
[
"0x303A",
"0x1001"
]
],
"mcu": "esp32s3",
"variant": "lolin_s3_2"
},
"connectivity": [
"wifi",
"bluetooth"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "lolin_s3_2",
"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"
}