Closes https://github.com/espressif/esp-idf/issues/7885 (cherry picked from commit 91f1159f9c)
91f1159f9c