when I found a board that did not have proper pins/characteristic defined I created my own. To do it:
1- go to the folder “.platformio/packages/framework-arduinoespressif32/variants
” and create there a folder - in my case: zh_esp32s3_bare_module
2- inside this folder (in my case: “.platformio/packages/framework-arduinoespressif32/variants/zh_esp32s3_bare_module
” ) there are files describing the board:
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#define USB_VID 0x239A
#define USB_PID 0x811B
#define USB_MANUFACTURER "PAPIO LTD"
#define USB_PRODUCT "ZH S3-WROOM-1U N4 bare module"
#define USB_SERIAL "" // Empty string for MAC adddress
#define EXTERNAL_NUM_INTERRUPTS 46
#define NUM_DIGITAL_PINS 48
#define NUM_ANALOG_INPUTS 20
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1)
#define digitalPinHasPWM(p) (p < 46)
static const uint8_t SDA = 8;
static const uint8_t SCL = 9;
static const uint8_t SS = 42;
static const uint8_t MOSI = 35;
static const uint8_t SCK = 36;
static const uint8_t MISO = 37;
#endif /* Pins_Arduino_h */
#include "esp32-hal-gpio.h"
#include "pins_arduino.h"
extern "C" {
// Initialize variant/board, called before setup()
void initVariant(void)
{
}
}
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x1E0000,
app1, app, ota_1, 0x1F0000,0x1E0000,
spiffs, data, spiffs, 0x3D0000,0x20000,
coredump, data, coredump,0x3F0000,0x10000,%
3- inside folder: “.platformio/platforms/espressif32/boards/
” you create the file i.e. “zh_esp32s3_bare_module.json
” in which you provide more info:
{
"build": {
"arduino":{
"ldscript": "esp32s3_out.ld",
"partitions": "zh_default_4MB.csv"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_USB_CDC_ON_BOOT=1",
"-DARDUINO_RUNNING_CORE=1",
"-DARDUINO_EVENT_RUNNING_CORE=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"hwids": [
[
"0x239A",
"0x811B"
],
[
"0x239A",
"0x011B"
],
[
"0x239A",
"0x811C"
]
],
"mcu": "esp32s3",
"variant": "zh_esp32s3_bare_module"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32s3.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "ZH S3-WROOM-1U N4 bare module",
"upload": {
"flash_size": "4MB",
"maximum_ram_size": 327680,
"maximum_size": 4194304,
"use_1200bps_touch": true,
"wait_for_upload_port": true,
"require_upload_port": true,
"speed": 460800
},
"url": "https://something.here",
"vendor": "PAPIO LTD"
}
of course I copied templates from other boards (folders/files as examples) and I modified to my case
this way now in platformio.ini
I declare this in
[zh_esp32s3_bare_module]
board = zh_esp32s3_bare_module
and further:
[env:esp32093]
extends = base
board = ${zh_esp32s3_bare_module.board}
build_flags = ${base.build_flags}
-D DEVICE_ID=93
-DARDUINO_USB_MODE=1
This way you can stop relying on the vendors of the boards and you can create your own taste.
Of course where there are custom names, you need to keep them consistent across all these files.
if that helps