Page 1 of 1

ESP Now component compiles in Platformio but not in ESP IDF

Posted: Sat Aug 02, 2025 11:44 pm
by andy37
Hello,

I have two separate environments in VSCode - one PlatformIO and other ESP IDF having in each same small C program which has dependency on ESP Now. Both environments have same ESP Now component v2.5.2 installed automatically in {respective_project_dir}/managed_components/

ESP IDF builds with error:
/managed_components/espressif__esp-now/src/espnow/src/espnow.c:1086:46: error: passing argument 1 of esp_now_register_send_cb' from incompatible pointer type [-Wincompatible-pointer-types]
1086 | ESP_ERROR_CHECK(esp_now_register_send_cb(espnow_send_cb));
| ^~~~~~~~~~~~~~
| |
| void (*)(const uint8_t *, esp_now_send_status_t) {aka void (*)(const unsigned char *, esp_now_send_status_t)}

but PlatformIO using same ESP Now version compiles fine without errors.
Regardless of the error I am stumbled why PlatformIO can produce ESP Now .o files and ESP IDF can't.
I checked and both ESP Now directories are exactly the same - must be as are pulled from github. .component_hash is the same.

Please advise where to look to identify why PlatformIO is able to compile ESP Now and ESP IDF can't.

Andy

Re: ESP Now component compiles in Platformio but not in ESP IDF

Posted: Sun Aug 03, 2025 1:22 am
by andy37
And I've found the reason :) platformIO uses ESP framework 5.4 and ESP IDF has been configured by me to use 5.5.
ESP Now compiles once EPS framework in VSCode ESP IDF extension is changed to 5.4.