Closes https://github.com/espressif/esp-idf/issues/12620, Closes https://github.com/espressif/esp-idf/issues/12605