Board "olimex_esp32-c5-devkit definitions for pioarduino / Platformio values ?

Started by winfried, April 24, 2026, 11:03:26 AM

Previous topic - Next topic

winfried

Using your board definition with provided file: `olimex_esp32-c5-devkit-lipo.json`
with pioarduino and simple blink test drops an error on compilation:

*** ValueError `invalid literal for int() with base 10: ''' trying to evaluate `${__get_board_f_boot(__env__)}'
File "/home/winfried/.platformio/packages/framework-arduinoespressif32/tools/pioarduino-build.py", line 94, in generate_bootloader_image 

using `board=esp32-c5-devkitc1-n8r4` Code compiles, uploads and runs.

So comparing and testing this file with `esp32-c5-devkitc1-n8r4.json` from platformio, I found adding the definition of "f_flash": "80000000L" in the build section makes it to work.

So the question is now: Is this a proper value ?

Other questions, for info, because of the difference is:

- "f_cpu": "160000000L" vs "f_cpu": "240000000L",

  With 240Mhz it blinks, but is it save to operate ?

- What is the difference:
  "flash_mode": "dio", "psram_type": "opi" are not "qio" ?

- "maximum_ram_size": 524288,  "maximum_size": 8388608,
  vs
  "maximum_ram_size": 327680,  "maximum_size": 8388608,

  Is there a reason for other ram size ?

Any explanation is appreciated.

mfg winfried

platformio.ini:

[platformio]
description = "LoRaBees gateway ESP32-C5 and MOD-LoRa868-ANT"

include_dir = src

[env]
platform=https://github.com/pioarduino/platform-espressif32.git
framework = arduino

[env:ESP32-C5-DevKit-Lipo]
board = olimex_esp32-c5-devkit-lipo
; board = esp32-c5-devkitc1-n8r4

monitor_speed = 115200
upload_speed = 921600
---- Atelier Algorythmics --- [url="http://algo.mur.at/"]http://algo.mur.at/[/url] ----

LubOlimex

QuoteWith 240Mhz it blinks, but is it save to operate ?

As long as it works it is safe to use, might draw more current.

QuoteWhat is the difference:
  "flash_mode": "dio", "psram_type": "opi" are not "qio" ?

These are just different modes to flash and different interface for the PSRAM. Depends on the internal hardware of the ESP32-C5 module and revision. What is suggested by Espressif should be used. I think for ESP32-C5 should be dio and qio.

QuoteIs there a reason for other ram size ?

It is probably a mistake in our json, the chip has 320KB RAM. I have uploaded improved version.
Technical support and documentation manager at Olimex

winfried

Thanks for the explanation and corrections,

I tried the corrected board definition, using stable pioarduino as platformio, but still got on configuration process:
Maybe your configuration works on other environment, but here for Info:

Resolving ESP32-C5-DevKit-Lipo dependencies...
UserSideException: Please specify name, url and vendor fields for /home/winfried/repos/art/pfb/pfb-bees/experiments/07-test-ESP32-C5/boards/olimex_esp32-c5-devkit-lipo.json

After adding URL, I got on compilation:
*** ValueError `invalid literal for int() with base 10: ''' trying to evaluate `${__get_board_f_boot(__env__)}'
File "/home/winfried/.platformio/packages/framework-arduinoespressif32/tools/pioarduino-build.py", line 94, in generate_bootloader_image

So adding in section build:
    "f_flash": "80000000L",
solved this.

Also I add the openocd part, so debug and upload with "esp-builtin" works (still some errors reading some memory areas, but usable).

My working solution for platformio.ini and board definition below:

my-olimex_esp32-c5-devkit-lipo.json:

{
  "build": {
    "core": "esp32",
    "cpu": "esp32c5",
    "f_cpu": "240000000L",
    "f_flash": "80000000L",
    "mcu": "esp32c5",
    "variant": "esp32c5",
    "flash_mode": "dio",
    "psram_type": "opi",
    "extra_flags": [
      "-DBOARD_HAS_PSRAM",
      "-DARDUINO_USB_MODE=1",
      "-DARDUINO_USB_CDC_ON_BOOT=1"
    ]
  },
  "connectivity": [
    "wifi",
    "bluetooth"
  ],
  "debug": {
    "openocd_target": "esp32c5.cfg"
  },
  "frameworks": [
    "arduino",
    "espidf"
  ],
  "name": "Olimex ESP32-C5-DevKit-Lipo (WROOM-N8R4)",
  "upload": {
    "flash_size": "8MB",
    "maximum_ram_size": 327680,
    "maximum_size": 8388608,
    "require_upload_port": true,
    "speed": 921600
  },
  "vendor": "Olimex"
  ,"url": "https://www.olimex.com/Products/IoT/ESP32-C5/ESP32-C5-DevKit-Lipo/"
}

 platformio.ini:

[platformio]
description = "ESP32-C5 test"

[env]
;platform=https://github.com/pioarduino/platform-espressif32.git
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip

framework = arduino

[env:ESP32-C5-DevKit-Lipo]
board = my-olimex_esp32-c5-devkit-lipo

monitor_speed = 115200
upload_speed = 921600

; debugging with openocd on JTAG/serial USB-C port
debug_tool = esp-builtin
debug_init_break = tbreak setup ; Stoppt automatisch am Anfang von setup()

; upload methods working on JTAG/serial USB-C port
upload_protocol = esp-builtin
;upload_protocol = esptool
---- Atelier Algorythmics --- [url="http://algo.mur.at/"]http://algo.mur.at/[/url] ----