Uses heltec v4 board

Friends, help me set up a platformio.ini file to use the heltec v4 device.

Microcontroller: ESP32-S3R2

Communications:

Wi-Fi: 802.11 b/g/n, up to 150 Mbps.

Bluetooth: LE, Bluetooth 5, Bluetooth Mesh.

LoRa: SX1262 chip, power up to 27 dBm, sensitivity -137 dBm.

Memory: 512 KB SRAM, 2 MB PSRAM (PSRAM), 16 MB Flash.

There is no ready-made configuration.

I used these typical settings

[env:heltec_wifi_lora_32_V3]

platform = espressif32

board = heltec_wifi_lora_32_V3

framework = arduino

board_build.partitions = partitions_custom.csv

board_build.flash_size = 16MB

With these parameters, the device works without errors. I also created my own partition table for 16MB and 128KB NVS. But these settings don’t use these variables. The board v3 parameters are still read (default: this board). And upon verification, it turns out that the flash is 8MB and the NVS size is 20KB. I can’t get the compiler to recognize my settings. I need to use all the flash memory for maximum efficiency. I also need to connect the 2MB RAM correctly.

What a weird Wiki. This indeed creates a board definition with the right pin mapping, but does not use Heltec’s forked Arduino core, which has crucial changes needed for the LoRaWAN library to work, which are the main point of the board.

Heltec support in PlatformIO remains bad, with only point-wise hacks and patches known. See How replicate this step from Arduino IDE to PlatformIO - #2 by maxgerhardt