espressif / esp-va-sdk

Espressif's Voice Assistant SDK: Alexa, Google Voice Assistant, Google DialogFlow
Other
290 stars 82 forks source link

NVS/AIA issues #152

Closed danielhendrickson closed 3 years ago

danielhendrickson commented 3 years ago

Stuck on flashing firmware step. I got through the linking issues and commented out the 2nd definition of set_xpd_sar in the app_wifi file. Now when I run idf.py flash monitor I am getting some NVS issues as well as an AIA issue:

E (2247) [app_main]: NVS open failed with error 4354 E (2247) [app_main]: NVS open failed with error 4354 E (2257) [app_main]: NVS open failed with error 4354 E (2257) [app_main]: NVS open failed with error 4354 [app_main]: Using the non-NVS aws_endpoint: XXX E (2267) [app_main]: NVS open failed with error 4354 [app_main]: Using the non-NVS aws_account_id: XXX E (2277) [app_main]: NVS open failed with error 4354 [app_main]: Using the non-NVS client_id: 240ac4e6ce80 E (2297) [app_main]: AIA device certificates not found. Please flash the certificates at the correct location and reboot the device to proceed.

Any ideas on what the problem is? I am using macOS 11.4 for reference

Full logs are below:

dhendrickson@syn0098 amazon_aia % idf.py flash monitor Checking Python dependencies... Python requirements from /Users/dhendrickson/esp-idf/requirements.txt are satisfied. Adding flash's dependency "all" to list of actions Executing action: all (aliases: build) Running ninja in directory /Users/dhendrickson/esp-va-sdk/examples/amazon_aia/build Executing "ninja all"... [1/4] cd /Users/dhendrickson/esp-va-sd...*****" Partition table binary generated. Contents:


Espressif ESP32 Partition Table

Name, Type, SubType, Offset, Size, Flags

nvs,data,nvs,0x9000,24K, phy_init,data,phy,0xf000,4K, fctry_aia,data,nvs,0x10000,24K, fctry,data,nvs,0x16000,24K, otadata,data,ota,0x1c000,8K, ota_0,app,ota_0,0x20000,4032K, ota_1,app,ota_1,0x410000,4032K,


[2/4] Performing build step for 'bootloader' ninja: no work to do. Executing action: flash Running esptool.py in directory /Users/dhendrickson/esp-va-sdk/examples/amazon_aia/build Executing "/Users/dhendrickson/.espressif/python_env/idf4.0_py3.9_env/bin/python /Users/dhendrickson/esp-idf/components/esptool_py/esptool/esptool.py -p /dev/cu.usbserial-110 -b 460800 --before default_reset --after hard_reset write_flash @flash_project_args"... esptool.py -p /dev/cu.usbserial-110 -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size 8MB 0x8000 partition_table/partition-table.bin 0x1c000 ota_data_initial.bin 0x1000 bootloader/bootloader.bin 0x20000 aia.bin esptool.py v2.9-dev Serial port /dev/cu.usbserial-110 Connecting..... Detecting chip type... ESP32 Chip is ESP32-D0WD-V3 (revision 3) Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None Crystal is 40MHz MAC: 24:0a:c4:e6:ce:80 Uploading stub... Running stub... Stub running... Changing baud rate to 460800 Changed. Configuring flash size... Compressed 3072 bytes to 149... Wrote 3072 bytes (149 compressed) at 0x00008000 in 0.1 seconds (effective 423.2 kbit/s)... Hash of data verified. Compressed 8192 bytes to 31... Wrote 8192 bytes (31 compressed) at 0x0001c000 in 0.1 seconds (effective 1191.4 kbit/s)... Hash of data verified. Compressed 24576 bytes to 15090... Wrote 24576 bytes (15090 compressed) at 0x00001000 in 0.4 seconds (effective 501.7 kbit/s)... Hash of data verified. Compressed 3417664 bytes to 2472117... Wrote 3417664 bytes (2472117 compressed) at 0x00020000 in 63.6 seconds (effective 429.9 kbit/s)... Hash of data verified.

Leaving... Hard resetting via RTS pin... Executing action: monitor Running idf_monitor in directory /Users/dhendrickson/esp-va-sdk/examples/amazon_aia Executing "/Users/dhendrickson/.espressif/python_env/idf4.0_py3.9_env/bin/python /Users/dhendrickson/esp-idf/tools/idf_monitor.py -p /dev/cu.usbserial-110 -b 115200 /Users/dhendrickson/esp-va-sdk/examples/amazon_aia/build/aia.elf -m '/Users/dhendrickson/.espressif/python_env/idf4.0_py3.9_env/bin/python' '/Users/dhendrickson/esp-idf/tools/idf.py'"... --- idf_monitor on /dev/cu.usbserial-110 115200 --- --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- dr=0x3f400020 size=0x1fa10c (2072844) map ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:1 load:0x3fff0018,len:4 load:0x3fff001c,len:12 load:0x3fff0028,len:7020 ho 0 tail 12 room 4 load:0x40078000,len:13992 ho 0 tail 12 room 4 load:0x40080400,len:3436 entry 0x40080650 I (75) boot: Chip Revision: 3 I (83) boot_comm: chip revision: 3, min. bootloader chip revision: 0 I (46) boot: ESP-IDF v4.0.3-170-g0a8e7be7cc-dirty 2nd stage bootloader I (46) boot: compile time 20:34:34 I (47) boot: Enabling RNG early entropy source... I (52) boot: SPI Speed : 80MHz I (56) boot: SPI Mode : DIO I (60) boot: SPI Flash Size : 8MB I (64) boot: Partition Table: I (68) boot: ## Label Usage Type ST Offset Length I (75) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (83) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (90) boot: 2 fctry_aia WiFi data 01 02 00010000 00006000 I (98) boot: 3 fctry WiFi data 01 02 00016000 00006000 I (105) boot: 4 otadata OTA data 01 00 0001c000 00002000 I (113) boot: 5 ota_0 OTA app 00 10 00020000 003f0000 I (120) boot: 6 ota_1 OTA app 00 11 00410000 003f0000 I (128) boot: End of partition table I (132) boot: No factory image, trying OTA 0 I (137) boot_comm: chip revision: 3, min. application chip revision: 0 I (144) esp_image: segment 0: paddr=0x00020020 vaddr=0x3f400020 size=0x1fa10c (2072844) map I (875) esp_image: segment 1: paddr=0x0021a134 vaddr=0x3ffbdb60 size=0x046d0 ( 18128) load I (882) esp_image: segment 2: paddr=0x0021e80c vaddr=0x40080000 size=0x00400 ( 1024) load 0x40080000: _WindowOverflow4 at /Users/dhendrickson/esp-idf/components/freertos/xtensa_vectors.S:1778

I (882) esp_image: segment 3: paddr=0x0021ec14 vaddr=0x40080400 size=0x013fc ( 5116) load I (892) esp_image: segment 4: paddr=0x00220018 vaddr=0x400d0018 size=0x1261d0 (1204688) map 0x400d0018: _stext at ??:?

I (1319) esp_image: segment 5: paddr=0x003461f0 vaddr=0x400817fc size=0x1c428 (115752) load 0x400817fc: call_start_cpu1 at /Users/dhendrickson/esp-idf/components/esp32/cpu_start.c:291

I (1382) boot: Loaded app from partition at offset 0x20000 I (1400) boot: Set actual ota_seq=1 in otadata[0] I (1400) boot: Disabling RNG early entropy source... I (1401) psram: This chip is ESP32-D0WD I (1405) spiram: Found 64MBit SPI RAM device I (1409) spiram: SPI RAM mode: flash 80m sram 80m I (1415) spiram: PSRAM initialized, cache is in low/high (2-core) mode. I (1422) cpu_start: Pro cpu up. I (1426) cpu_start: Application information: I (1431) cpu_start: Project name: aia I (1436) cpu_start: App version: 1.0 I (1440) cpu_start: Compile time: Sep 12 2021 20:34:31 I (1446) cpu_start: ELF file SHA256: aa57c4fb6fc85142... I (1452) cpu_start: ESP-IDF: v4.0.3-170-g0a8e7be7cc-dirty I (1459) cpu_start: Starting app cpu, entry point is 0x40081794 0x40081794: call_start_cpu1 at /Users/dhendrickson/esp-idf/components/esp32/cpu_start.c:272

I (0) cpu_start: App cpu up. I (1969) spiram: SPI SRAM memory test OK I (1973) heap_init: Initializing. RAM available for dynamic allocation: I (1973) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM I (1975) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM I (1982) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM I (1988) heap_init: At 3FFBDB5C len 00000004 (0 KiB): DRAM I (1994) heap_init: At 3FFC8478 len 00017B88 (94 KiB): DRAM I (2000) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM I (2007) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (2013) heap_init: At 4009DC24 len 000023DC (8 KiB): IRAM I (2019) cpu_start: Pro cpu start user code I (2024) spiram: Adding pool of 4037K of external SPI memory to heap allocator I (2045) spi_flash: detected chip: gd I (2046) spi_flash: flash io: dio W (2046) spi_flash: Detected size(16384k) larger than the size in the binary image header(8192k). Using the size in the binary image header. I (2056) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. I (2067) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations I (2077) [app_main]: ==== Voice Assistant SDK version: v1.2.2 ==== I (2127) wifi:wifi driver task: 3ffd671c, prio:23, stack:6656, core=0 I (2127) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (2127) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (2147) wifi:wifi firmware version: 0f541cf I (2147) wifi:config NVS flash: enabled I (2147) wifi:config nano formating: disabled I (2147) wifi:Init data frame dynamic rx buffer num: 32 I (2157) wifi:Init management frame dynamic rx buffer num: 32 I (2157) wifi:Init management short buffer num: 32 I (2167) wifi:Init static tx buffer num: 32 I (2167) wifi:Init tx cache buffer num: 32 I (2177) wifi:Init static rx buffer size: 1600 I (2177) wifi:Init static rx buffer num: 10 I (2187) wifi:Init dynamic rx buffer num: 32 I (2187) wifi_init: rx ba win: 16 I (2187) wifi_init: tcpip mbox: 32 I (2197) wifi_init: udp mbox: 6 I (2197) wifi_init: tcp mbox: 12 I (2207) wifi_init: tcp tx win: 14360 I (2207) wifi_init: tcp rx win: 14360 I (2207) wifi_init: tcp mss: 1440 I (2217) wifi_init: WiFi/LWIP prefer SPIRAM I (2217) [app_smart_home]: Registering command: smart-home [app_smart_home]: Light's Power turned ON [app_smart_home]: Light's Brightness changed to 100 I (2237) wifi_prov_scheme_ble: BT memory released E (2247) [app_main]: NVS open failed with error 4354 E (2247) [app_main]: NVS open failed with error 4354 E (2257) [app_main]: NVS open failed with error 4354 E (2257) [app_main]: NVS open failed with error 4354 [app_main]: Using the non-NVS aws_endpoint: XXX E (2267) [app_main]: NVS open failed with error 4354 [app_main]: Using the non-NVS aws_account_id: XXX E (2277) [app_main]: NVS open failed with error 4354 [app_main]: Using the non-NVS client_id: 240ac4e6ce80 E (2297) [app_main]: AIA device certificates not found. Please flash the certificates at the correct location and reboot the device to proceed.

danielhendrickson commented 3 years ago

Nevermind I think I have it figured out

PaulAnurag commented 2 years ago

@danielhendrickson What was the issue? do you remember?

chiragatal commented 2 years ago

@PaulAnurag The issue would have been that the AIA device certificates have not been flashed on the device. Check the Project Setup section in the readme for AIA: https://github.com/espressif/esp-va-sdk/tree/master/examples/amazon_aia#1-project-setup.

PaulAnurag commented 2 years ago

@chiragatal Got it. Thanks. After flashing the certificates, I encounter a new issue in the firmware. Can you please help me out in this regard. Issue3 .

chiragatal commented 2 years ago

@PaulAnurag Could you please open a new issue for this, and share the complete device logs from the start?