版权声明:本文为博主原创文章,未经博主允许不得转载。 https://cloud.tencent.com/developer/article/1411523
参考Espressif Systems Github上开源的代码,编译出完整的固件跑通Alexa。
- 源代码下载
// 下载源码,详细说明可以参考 esp-va-sdk/README-Getting-Started.md
$ git clone --recursive https://github.com/espressif/esp-idf.git
$ cd esp-idf; git checkout release/v3.1; cd ..
$ git clone https://github.com/espressif/esp-avs-sdk.git
// 打补丁
$ cd esp-idf
$ git apply ../esp-avs-sdk/esp-idf-patches/memset-i2s-dma-buffers-zero.patch
$ git apply ../esp-avs-sdk/esp-idf-patches/esp-tls-Add-support-for-global-CA-store.-All-mbedtls.patch
- 配置相关参数
make menuconfig
代码语言:javascript复制Component config -> ESP32 Specific -> SPI RAM config -> Type of SPIRAM in use->select ESP-PSRAM64
- 擦除Flash
make erase_flash
或许
esptool --port /dev/ttyUSB0 erase_flash
- 编译代码/烧录固件
// 编译加监控串口输出
make -j 4 flash VOICE_ASSISTANT=alexa monitor
- 烧录固件
// 烧录固件之后,发现系统一直重启
>>Registering command: task-dump
Registering command: cpu-dump
Registering command: heap-trace
Registering command: nvs-get
Registering command: nvs-set
Registering command: nvs-erase
Registering command: reboot
Registering command: wifi-set
ret: 0
I (191) net80211: OS adapter function version error! Version 2 is expected, but it is 1
E (201) conn_mgr_prov: Failed to init wifi
E (211) app_main: Error getting device provisioning state
abort() was called at PC 0x400d777a on core 0
Backtrace: 0x400900c4:0x3ffc65d0 0x400902bf:0x3ffc65f0 0x400d777a:0x3ffc6610 0x400d2bb6:0x3ffc66c0
Rebooting...
ets Jun 8 2016 00:22:57
最终找到的原因是
esp-idf切换到v3.1分支之后,部分子模块并没有更新,需要运行git submodule update --init ,问题解决。
参考
- ESP8266擦除flash
- Linux下的固件烧录¶