See GitHub - maxgerhardt/pio-espidf-simple-ota-example: PlatformIO compilable version of https://github.com/espressif/esp-idf/tree/v4.2/examples/system/ota/simple_ota_example.