Using ESP-IDF components (which is what ESP-MDF is, basically) in a pure Arduino project is not so straight-forward (refer Using esp-idf library within the Arduino Framework (ESP32)). The configuration of the components is supposed to happen via menuconfig but you can’t do that in an Arduino project – so all the config macros have to go into the build_flags
as per old example, which can be quite cumbersome. Also, it might be actually incompatible since the current Arduino core uses an older ESP-IDF version, but ESP-MDF might need a newer version.
The easiest path is to use framework = espidf, arduino
per e.g. this example and adapting the code. I’ll give it a quick shot.
If you want to stay with only framework = arduino
you’ll need to move all folders in components
into lib
and add a library.json
to them for build instructions and component and example config per remarks above. I can also give that a quick shot.