ESP Now component compiles in Platformio but not in ESP IDF
Posted: 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
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
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 | 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