1. 程式人生 > 其它 >esp32-idf編譯錯誤問題集合及解決方法

esp32-idf編譯錯誤問題集合及解決方法

esp32-idf編譯錯誤問題集合及解決方法

一、證書過期導致編譯失敗

  • 編譯報錯現象

    [659/966] Generating x509_crt_bundle
    FAILED: esp-idf/mbedtls/x509_crt_bundle
    cmd.exe /C "cd /D E:\ESP32-Audio\hello_world\build\esp-idf\mbedtls && F:\esp\esp-idf-v4.3.1\.espressif\python_env\idf4.3_py3.8_env\Scripts\python.exe F:/esp/esp-idf-v4.3.1/esp-idf/components/mbedtls/esp_crt_bundle/gen_crt_bundle.py --input F:/esp/esp-idf-v4.3.1/esp-idf/components/mbedtls/esp_crt_bundle/cacrt_all.pem -q"
    gen_crt_bundle.py: Invalid certificate in F:/esp/esp-idf-v4.3.1/esp-idf/components/mbedtls/esp_crt_bundle/cacrt_all.pem
    Invalid certificate
    

    圖片現象:

  • 解決方法
    這個問題是因為cacrt_all.pem檔案中的一個證書最近(9月30日)過期,導致編譯工程失敗。
    解決辦法為,在idf.py build編譯工程之前,輸入此命令idf.py menuconfig進行工程配置,按照如下路徑進入Certificate Bundle設定中,將Enable trusted root certificate bundle選項取消掉,即不在此工程中啟用用受信任的根證書捆綁包。
    (Top) > Component config > mbedTLS > Certificate Bundle->Enable trusted root certificate bundle