Hello everyone,
I'm testing the new OpenPLC 4.1.0 release with a custom board based on the ESP32-S3 WROOM-1U (N16R8), which has 16MB of Flash and 8MB of PSRAM.
I added my board configuration to the hals.json file with the appropriate memory settings, and the board is correctly recognized and displayed in the editor. However, during compilation, I encounter the following messages:
Sketch uses 1034375 bytes (78%) of program storage space. Maximum is 1310720 bytes. Global variables use 47792 bytes (14%) of dynamic memory, leaving 279888 bytes for local variables. Maximum is 327680 bytes.
These values indicate that the compiler is referencing:
1,310,720 bytes (~1.25MB) for Flash, while the board actually has 16MB.
327,680 bytes (~320KB) for dynamic memory, while the ESP32-S3 features 512KB of internal RAM + 8MB of PSRAM.
It seems that the board definition in hals.json is not correctly passing the actual memory sizes to the compiler. As a result, larger programs may fail to compile, and the PSRAM may not be utilized.
Here’s an excerpt of my configuration in hals.json (paths and hardware details simplified):
json
"ESP32-S3-WROOM-1U-N16R8": {
"board_manager_url": "https://espressif.github.io/arduino-esp32/package_esp32_index.json",
"compiler": "arduino-cli",
"core": "esp32:esp32",
"c_flags": ["-MMD", "-c", "-Wno-incompatible-pointer-types"],
"cxx_flags": ["-MMD", "-c"],
"default_ain": "1, 2, 3, 4",
"default_aout": "36, 37",
"default_din": "6, 7, 8, 9",
"default_dout": "34, 35",
"define": "BOARD_ESP32",
"extra_libraries": [],
"platform": "esp32:esp32:esp32s3",
"preview": "esp32.png",
"source": "esp32.cpp",
"specs": {
"CPU": "ESP32-S3",
"RAM": "8 MB",
"Flash": "16 MB",
"Digital Pins": "36",
"Analog Pins": "18",
"PWM Pins": "16",
"WiFi": "Yes",
"Bluetooth": "Yes",
"Ethernet": "No"
}
},
Questions / suggestions:
Does the "ram" parameter in hals.json correspond to the internal RAM, and is "psram" properly accounted for during compilation?
Are additional defines or modifications to board_options required to ensure the compiler (PlatformIO?) utilizes the full Flash and PSRAM available?
If anyone has already configured an ESP32-S3 board with PSRAM under OpenPLC, could you share your configuration?
Thank you in advance for your help!
Environment:
Best regards.