ESP Now component compiles in Platformio but not in ESP IDF

andy37
Posts: 2
Joined: Sat Aug 02, 2025 11:27 pm

ESP Now component compiles in Platformio but not in ESP IDF

Postby andy37 » Sat Aug 02, 2025 11:44 pm

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

andy37
Posts: 2
Joined: Sat Aug 02, 2025 11:27 pm

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

Postby andy37 » Sun Aug 03, 2025 1:22 am

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.

Who is online

Users browsing this forum: Bytespider, ChatGPT-User, Perplexity-User and 4 guests