Skip to content

Handle missing CONFIG_FREERTOS_NUMBER_OF_CORES define for some build environments#808

Closed
TCWORLD wants to merge 1 commit into
fredlcore:masterfrom
TCWORLD:patch-1
Closed

Handle missing CONFIG_FREERTOS_NUMBER_OF_CORES define for some build environments#808
TCWORLD wants to merge 1 commit into
fredlcore:masterfrom
TCWORLD:patch-1

Conversation

@TCWORLD
Copy link
Copy Markdown
Contributor

@TCWORLD TCWORLD commented May 5, 2026

When building with PlatformIO, this define does not appear to exist in the available libraries. I'm guessing related to which version of the Arduino ESP32 libraries are used for the build.

While trying to fix the build issue, I found an example on the Arduino community forum here, in which the example for this watchdog initialisation uses configNUM_CORES. This define does exist in FreeRTOSConfig.h in the ESP32 libraries, and is defined in my case as 2 which matches the original hard-coded value before this define was used.

I wasn't sure of the source of the selected define, but clearly it exists somewhere in the Arduino IDE otherwise somebody would have noticed by now. So instead of just replacing it, I'm proposing we set a failback define in case the former is missing.

When building with platformio, this define does not appear to exist. 

Based on an example on the Arduino community forum, they use `configNUM_CORES` for this purpose, which the Arduino ESP32 libs define as 2 (same as original value before this define was used).

Add a failback define in case the former is not defined.
@fredlcore
Copy link
Copy Markdown
Owner

Hm, I'm using platformio (with pioarduino) as well, and the definement can be found in .platformio/packages/framework-arduinoespressif32-libs/esp32/dio_qspi/include/sdkconfig.h, where there are a lot of CONFIG_FREERTOS_ definements. Which version of the arduino-esp32 framework are you using? I assume it's an older version because there are a number of users who use platformio, so the issue would have popped up earlier if it was a general issue.

@TCWORLD
Copy link
Copy Markdown
Contributor Author

TCWORLD commented May 5, 2026

I did wonder whether it was some versioning issue. I've been using:

platform = https://github.com/platformio/platform-espressif32.git
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.4, framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip

It's possible I've missed it somewhere (did check the docs), but could you let me know what settings you have in your platformio.ini file and I'll update mine to match.

@fredlcore
Copy link
Copy Markdown
Owner

You're using version 3.0.4 which is quite outdated. BSB-LAN requires currently(!) at least 3.0.7. Besides, PlatformIO no longer supports Espressif/ESP32, so there is a community project (pioarduino) that has taken over. Here's my config for the Olimex EVB:

; 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

[platformio]
src_dir = src/BSB_LAN

[env:Olimex-EVB]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
board = esp32-evb 
framework = arduino
build_src_filter = +<*>
upload_speed = 460800
board_build.partitions = min_spiffs.csv
build_flags = -DDS218 -DBSB_BUS -Wall -Werror=tautological-compare -Wtype-limits -Wimplicit-fallthrough
upload_port = /dev/cu.*usb*serial*
build_type = debug
monitor_port = socket://192.168.1.50:23
monitor_filters = esp32_exception_decoder, time
monitor_speed = 115200

@fredlcore fredlcore closed this May 5, 2026
@TCWORLD
Copy link
Copy Markdown
Contributor Author

TCWORLD commented May 5, 2026

Thanks. I'll update. Wasn't aware of pioarduino, so was using the most recent one on platformio that actually compiled at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants