Differences in FTM Measurement Results between ESP-IDF and PlatformIO

Hello,

I have some discrepancies in FTM measurement results between an ESP-IDF project and a PlatformIO project. I’m using the esp32 example (https://github.com/espressif/esp-idf/blob/master/examples/wifi/ftm/main/ftm_main.c) as a basis, which I have adapted a little so that I can use it in PlatformIO.

In PlatformIO, I have the following code structure:

// identical first code part here
void setup()
{
    // identical second code part here
}
void loop()
{
}

In ESP-IDF, I have a similar structure:

// identical first code part here
void app_main(void)
{
    // identical second code part here
}

The problem is that in ESP_IDF I get very realistic distances and in PlatformIO I get at least an additional offset of 30 m. What could be the reason for this?

I would appreciate some help as I am still relatively new to this type of programming.

What version of framework-espidf is PlatformIO showing at the start of the compilation log, and what are version is your pure ESP-IDF project using?

In PlatformIO I used the “framework-arduinoespressif32 @ 3.20011.230801 (2.0.11)” framework and in pure ESP-IDF I used “Espressif IoT Development Framework (ESP-IDF) 5.1.1”. My board is the Espressif-ESP32-C3-DevKitM-1. Do I also have to use the esp-idf framework in platformIO? I wanted to avoid this so that I can program with C++ directly

Wut, so that is not even a pure ESP-IDF project, you’re riding on top of the ESP-IDF version provided by Arduino-ESP32? That is ESP-IDF 4.4.5 btw (source), not even 5.x. Use framework = espidf in PlatformIO too, like official examples show, to get a project that uses ESP-IDF 5.1.1 currently.

If you wanted Arduino with a ESP-IDF 5.x base, this is not out officially yet, but third party solutions are available.

This makes zero sense. You can use the C++ programming language in ESP-IDF too, with all the fancy stuff, like official example show.

Thank you for your answer. This was my mistake, that I used the wrong framework