ESP32 应用程序崩溃 i2c: CONFLICT! driver_ng is not allowed to be used with this old driver

使用 ESP-IDF 5.3 或更高版本编译的应用程序在运行时可能会出现以下消息而失败:

i2c: CONFLICT! driver_ng is not allowed to be used with this old driver

问题是由于不兼容的 BSP (板级支持包) 使用了旧版本的 I2C 驱动程序引起的。

解决方案是在 idf_component.yaml 中添加以下依赖项:

  esp_codec_dev:
    public: true
    version: "==1.1.0"

重新构建应用程序,问题应得到解决。