Compiled code with ESP-IDF from PIO crashes , ESP-IDF v4.1-dirty works just fine

Hi there,

I have tried to move to PIO today from the classic ESP-IDF environment. Pretty straight forward, however, I have been stuck all day at getting bluetooth to initialize with no success. I am using the exact same code , very few lines just enough to init the bluetooth. On PIO,The config is identical, partition table to that of my ESP-IDF env. On PIO it keeps rebooting and says: ESP_ERROR_CHECK failed: esp_err_t 0x101 (ESP_ERR_NO_MEM) at 0x40091514. On ESP-IDF the init is successful and program behaves as intended.

Below you can find the verbose log output of PIO :
https://pastebin.com/cKeENyMD

Below you can find the verbose log output of ESP-IDF env:
https://pastebin.com/RCFLBKgJ

We can already observe that addresses are not the same all around the log. But I lack good understanding of how memories are mapped for ESP32 to actually understand what’s happening. All in all, same code same config same partition tables I would have expected same result.

Any idea on what might be the cause ?

Thanks !