espressif / esp-box

The ESP-BOX is a new generation AIoT development platform released by Espressif Systems.
Apache License 2.0
779 stars 182 forks source link

ESP-IDF 5.2.1 and sensor sensor bottom `intr_alloc` factory_demo problem (AEGHB-595) #137

Closed MacWyznawca closed 4 months ago

MacWyznawca commented 6 months ago

The latest version of ESP-BOX factory_demo on the stable wewrsion ESP-IDF 5.2.1 does not have enough interrupts. The error occurs only when using the sensor cradle.

I (19) boot: compile time Mar 20 2024 21:28:14
I (19) boot: Multicore bootloader
I (19) boot: chip revision: v0.2
I (20) qio_mode: Enabling QIO for flash chip GD
I (20) boot.esp32s3: Boot SPI Speed : 80MHz
I (20) boot.esp32s3: SPI Mode       : QIO
I (20) boot.esp32s3: SPI Flash Size : 16MB
I (21) boot: Enabling RNG early entropy source...
I (21) boot: Partition Table:
I (21) boot: ## Label            Usage          Type ST Offset   Length
I (21) boot:  0 sec_cert         Unknown data     01 06 0000d000 00003000
I (22) boot:  1 nvs              WiFi data        01 02 00010000 00006000
I (22) boot:  2 otadata          OTA data         01 00 00016000 00002000
I (23) boot:  3 phy_init         RF data          01 01 00018000 00001000
I (23) boot:  4 fctry            WiFi data        01 02 00019000 00006000
I (23) boot:  5 ota_0            OTA app          00 10 00020000 0041a000
I (24) boot:  6 storage          Unknown data     01 82 0043a000 0028a000
I (24) boot:  7 model            Unknown data     01 82 006c4000 00866000
I (25) boot: End of partition table
I (25) boot: No factory image, trying OTA 0
I (25) esp_image: segment 0: paddr=00020020 vaddr=3c180020 size=2314b0h (2299056) map
I (374) esp_image: segment 1: paddr=002514d8 vaddr=3fca4400 size=08354h ( 33620) load
I (380) esp_image: segment 2: paddr=00259834 vaddr=40378000 size=067e4h ( 26596) load
I (386) esp_image: segment 3: paddr=00260020 vaddr=42000020 size=172ae4h (1518308) map
I (616) esp_image: segment 4: paddr=003d2b0c vaddr=4037e7e4 size=15b78h ( 88952) load
I (633) esp_image: segment 5: paddr=003e868c vaddr=50000000 size=00004h (     4) load
I (634) esp_image: segment 6: paddr=003e8698 vaddr=600fe000 size=0005ch (    92) load
I (646) boot: Loaded app from partition at offset 0x20000
I (670) boot: Set actual ota_seq=1 in otadata[0]
I (670) boot: Disabling RNG early entropy source...
I (670) cpu_start: Multicore app
I (671) octal_psram: vendor id    : 0x0d (AP)
I (671) octal_psram: dev id       : 0x03 (generation 4)
I (671) octal_psram: density      : 0x05 (128 Mbit)
I (672) octal_psram: good-die     : 0x01 (Pass)
I (672) octal_psram: Latency      : 0x01 (Fixed)
I (672) octal_psram: VCC          : 0x00 (1.8V)
I (672) octal_psram: SRF          : 0x01 (Fast Refresh)
I (673) octal_psram: BurstType    : 0x01 (Hybrid Wrap)
I (673) octal_psram: BurstLen     : 0x01 (32 Byte)
I (673) octal_psram: Readlatency  : 0x02 (10 cycles@Fixed)
I (674) octal_psram: DriveStrength: 0x00 (1/1)
I (675) MSPI Timing: PSRAM timing tuning index: 5
I (675) esp_psram: Found 16MB PSRAM device
I (675) esp_psram: Speed: 80MHz
I (1317) esp_psram: SPI SRAM memory test OK
I (1326) cpu_start: Pro cpu start user code
I (1326) cpu_start: cpu freq: 240000000 Hz
I (1326) cpu_start: Application information:
I (1327) cpu_start: Project name:     factory_demo
I (1327) cpu_start: App version:      v0.5.0-57-g9b28a35
I (1327) cpu_start: Compile time:     Mar 20 2024 21:51:21
I (1327) cpu_start: ELF file SHA256:  5adf1f32a...
I (1327) cpu_start: ESP-IDF:          v5.2.1-dirty
I (1328) cpu_start: Min chip rev:     v0.0
I (1328) cpu_start: Max chip rev:     v0.99 
I (1328) cpu_start: Chip rev:         v0.2
I (1328) heap_init: Initializing. RAM available for dynamic allocation:
I (1328) heap_init: At 3FCB3308 len 00036408 (217 KiB): RAM
I (1328) heap_init: At 3FCE9710 len 00005724 (21 KiB): RAM
I (1329) heap_init: At 600FE05C len 00001F8C (7 KiB): RTCRAM
I (1329) esp_psram: Adding pool of 16384K of PSRAM memory to heap allocator
I (1330) spi_flash: detected chip: gd
I (1330) spi_flash: flash io: qio
W (1330) i2c: This driver is an old driver, please migrate your application code to adapt `driver/i2c_master.h`
I (1331) sleep: Configure to isolate all GPIO pins in sleep state
I (1331) sleep: Enable automatic switching of GPIO sleep configuration
I (1331) pm: Frequency switching config: CPU_MAX: 240, APB_MAX: 80, APB_MIN: 40, Light sleep: DISABLED
I (1332) coexist: coex firmware version: 77cd7f8
I (1332) coexist: coexist rom version e7ae62f
I (1333) main_task: Started on CPU0
I (1334) esp_psram: Reserving pool of 8K of internal memory for DMA/internal allocations
I (1334) main_task: Calling app_main()
I (1335) main: Compile time: Mar 20 2024 21:51:36
W (1363) settings: Not found, Set to default
I (1363) settings: Saving settings
I (1573) ESP-BOX-3: Partition size: total: 2439971, used: 1376986
I (1574) LVGL: Starting LVGL task
I (1575) gpio: GPIO[4]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (1575) gpio: GPIO[48]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (1576) ili9341: LCD panel create success, version: 1.2.0
W (1696) ili9341: The 36h command has been used and will be overwritten by external initialization sequence
W (1696) ili9341: The 3Ah command has been used and will be overwritten by external initialization sequence
I (1700) gpio: GPIO[3]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:2 
I (1701) GT911: TouchPad_ID:0x39,0x31,0x31
I (1701) GT911: TouchPad_Config_Version:65
I (1702) button: IoT Button Version: 3.2.0
I (1702) gpio: GPIO[0]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1702) button: IoT Button Version: 3.2.0
I (1702) gpio: GPIO[1]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (1702) button: IoT Button Version: 3.2.0
I (1709) ES8311: Work in Slave mode
I (1714) gpio: GPIO[46]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (1718) ES7210: Work in Slave mode
I (1727) ES7210: Enable ES7210_INPUT_MIC1
I (1730) ES7210: Enable ES7210_INPUT_MIC2
I (1739) I2S_IF: channel mode 0 bits:16/16 channel:2 mask:3
I (1740) I2S_IF: STD Mode 1 bits:16/16 channel:2 sample_rate:16000 mask:3
I (1759) Adev_Codec: Open codec device OK
I (1759) I2S_IF: channel mode 0 bits:16/16 channel:2 mask:3
I (1759) I2S_IF: STD Mode 0 bits:16/16 channel:2 sample_rate:16000 mask:3
I (1761) ES7210: Bits 16
I (1769) ES7210: Enable ES7210_INPUT_MIC1
I (1773) ES7210: Enable ES7210_INPUT_MIC2
I (1783) ES7210: Unmuted
I (1783) Adev_Codec: Open codec device OK
I (1783) pm: Frequency switching config: CPU_MAX: 240, APB_MAX: 80, APB_MIN: 40, Light sleep: ENABLED
I (1784) sleep: Code start at 0x42000020, total 1518307, data start at 0x3c000000, total 33554432 Bytes
0x42000020: _stext at ??:?

I (1784) gpio: GPIO[21]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:1 
I (1785) bsp_sensor: I2C num: 0, [40, 41], speed:400000
W (1785) bsp_sensor: Sensor bottom connected
I (1785) AT581X: MoreSense AT581X: 0.1.0
I (1785) gpio: GPIO[0]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:2 
I (1788) bsp_sensor: Radar init ok
I (1788) AHT20: ASAIR AHT20    : 0.1.0
I (1788) AHT20: SUPPLY_VOLTAGE : 2.2 - 5.5V
I (1789) AHT20: TEMPERATURE    : -40.00 - 125.00℃
I (1789) bsp_sensor: Temp & humidity init ok
I (1789) main: Display LVGL demo
I (1789) ui_main: Input device type have pointer
I (1794) ui_sr: sr animation initialize
I (2307) ESP-BOX-3: Setting LCD backlight: 100%
I (2508) file_iterator: File : Canon.mp3
I (2533) file_iterator: File : Dance with Me.mp3
I (2535) main: mute setting 0, volume:70
I (2536) main: speech recognition start
I (6536) MODEL_LOADER: The storage free size is 12544 KB
I (6536) MODEL_LOADER: The partition size is 8600 KB
I (6537) MODEL_LOADER: Successfully map model partition
I (6537) AFE_SR: afe interface for speech recognition

I (6537) AFE_SR: AFE version: SR_V220727

I (6537) AFE_SR: Initial auido front-end, total channel: 3, mic num: 2, ref num: 1

I (6538) AFE_SR: aec_init: 0, se_init: 1, vad_init: 1

I (6538) AFE_SR: wakenet_init: 1

MC Quantized wakenet9: wakeNet9_v1h24_hiesp_3_0.63_0.635, tigger:v3, mode:2, p:0, (Aug 24 2023 11:56:47)
I (6663) AFE_SR: wake num: 3, mode: 0, (Aug 24 2023 11:56:48)

W (6663) app_sr: Set language to EN
MC Quantized wakenet9: wakeNet9_v1h24_hiesp_3_0.63_0.635, tigger:v3, mode:2, p:0, (Aug 24 2023 11:56:47)
I (6698) AFE_SR: wakenet wn_frame_size = 512

I (6698) app_sr: load wakenet:wn9_hiesp
Build fst from commands.
Quantized MultiNet6:rnnt_ctc_1.0, name:mn6_en, (Aug 24 2023 14:24:02)
Load 49 pre-defined speech commands.
Quantized MultiNet6 search method: 2, time out:5.8 s
I (7323) app_sr: load multinet:mn6_en
I (7327) app_sr: cmd_number=14
Build fst from commands.
I (7356) MN_COMMAND: ---------------------SPEECH COMMANDS---------------------
I (7356) MN_COMMAND: Command ID0, phrase ID0: Turn On the Light
I (7357) MN_COMMAND: Command ID1, phrase ID1: Switch On the Light
I (7357) MN_COMMAND: Command ID2, phrase ID2: Switch Off the Light
I (7357) MN_COMMAND: Command ID3, phrase ID3: Turn Off the Light
I (7357) MN_COMMAND: Command ID4, phrase ID4: Turn Red
I (7357) MN_COMMAND: Command ID5, phrase ID5: Turn Green
I (7358) MN_COMMAND: Command ID6, phrase ID6: Turn Blue
I (7358) MN_COMMAND: Command ID7, phrase ID7: Customize Color
I (7358) MN_COMMAND: Command ID8, phrase ID8: Sing a song
I (7358) MN_COMMAND: Command ID9, phrase ID9: Play Music
I (7358) MN_COMMAND: Command ID10, phrase ID10: Next Song
I (7359) MN_COMMAND: Command ID11, phrase ID11: Pause Playing
I (7359) MN_COMMAND: Command ID12, phrase ID12: Turn on the Air
I (7359) MN_COMMAND: Command ID13, phrase ID13: Turn off the Air
I (7359) MN_COMMAND: ---------------------------------------------------------

I (7360) app_sr: audio_chunksize=1024, feed_channel=3
I (7361) app_sr: ------------detect start------------

I (7361) main_task: Returned from app_main()
I (7363) pp: pp rom version: e7ae62f
I (7363) net80211: net80211 rom version: e7ae62f
I (7365) wifi:wifi driver task: 3fcd1478, prio:23, stack:6144, core=0
I (7367) wifi:wifi firmware version: a9f5b59
I (7368) wifi:wifi certification version: v7.0
I (7368) wifi:config NVS flash: enabled
I (7368) wifi:config nano formating: enabled
I (7368) wifi:Init data frame dynamic rx buffer num: 4
I (7369) wifi:Init static rx mgmt buffer num: 5
I (7369) wifi:Init management short buffer num: 32
I (7369) wifi:Init static tx buffer num: 4
I (7369) wifi:Init tx cache buffer num: 16
I (7370) wifi:Init static tx FG buffer num: 2
I (7370) wifi:Init static rx buffer size: 1600
I (7370) wifi:Init static rx buffer num: 3
I (7370) wifi:Init dynamic rx buffer num: 4
I (7371) wifi:Allocate MAC register memory base addr(0x3fce0210).
I (7371) wifi_init: rx ba win: 4
I (7372) wifi_init: tcpip mbox: 16
I (7372) wifi_init: udp mbox: 6
I (7372) wifi_init: tcp mbox: 6
I (7372) wifi_init: tcp tx win: 5760
I (7372) wifi_init: tcp rx win: 5760
I (7372) wifi_init: tcp mss: 1440
I (7372) wifi_init: WiFi/LWIP prefer SPIRAM
I (7372) wifi_init: WiFi SLP IRAM OP enabled
I (7392) phy_init: phy_version 640,cd64a1a,Jan 24 2024,17:28:12
W (7392) phy_init: failed to load RF calibration data (0x1102), falling back to full calibration
I (7465) wifi:mode : sta (84:fc:e6:64:0a:58)
I (7465) wifi:enable tsf
I (7529) esp_rmaker_work_queue: Work Queue created.
I (7530) esp_claim: Initialising Self Claiming. This may take time.
W (7540) esp_claim: Generating the private key. This may take time.
E (7559) intr_alloc: No free interrupt inputs for RSA interrupt (flags 0xE)
HINT: For troubleshooting instructions related to interrupt allocation, run 'idf.py docs -sp api-reference/system/intr_alloc.html'
E (7561) bignum: Failed to allocate RSA interrupt 261

abort() was called at PC 0x42105452 on core 0
0x42105452: esp_mpi_isr_initialise at /Users/jkk/esp/esp-idf/components/mbedtls/port/bignum/esp_bignum.c:98

Backtrace: 0x40379f1a:0x3fce3080 0x4038aa01:0x3fce30a0 0x4039091d:0x3fce30c0 0x42105452:0x3fce3130 0x421055bb:0x3fce3150 0x421056cd:0x3fce3190 0x420f80eb:0x3fce31b0 0x420f84d9:0x3fce3210 0x420f8635:0x3fce3240 0x42102f0d:0x3fce3280 0x42085a65:0x3fce32d0 0x42085e51:0x3fce34f0 0x42085f78:0x3fce3560 0x4038af7e:0x3fce3580
0x40379f1a: panic_abort at /Users/jkk/esp/esp-idf/components/esp_system/panic.c:472
0x4038aa01: esp_system_abort at /Users/jkk/esp/esp-idf/components/esp_system/port/esp_system_chip.c:93
0x4039091d: abort at /Users/jkk/esp/esp-idf/components/newlib/abort.c:38
0x42105452: esp_mpi_isr_initialise at /Users/jkk/esp/esp-idf/components/mbedtls/port/bignum/esp_bignum.c:98
0x421055bb: esp_mpi_exp_mod at /Users/jkk/esp/esp-idf/components/mbedtls/port/bignum/esp_bignum.c:412
0x421056cd: mbedtls_mpi_exp_mod at /Users/jkk/esp/esp-idf/components/mbedtls/port/bignum/esp_bignum.c:473
0x420f80eb: mpi_miller_rabin at /Users/jkk/esp/esp-idf/components/mbedtls/mbedtls/library/bignum.c:2428
0x420f84d9: mbedtls_mpi_is_prime_ext at /Users/jkk/esp/esp-idf/components/mbedtls/mbedtls/library/bignum.c:2501
0x420f8635: mbedtls_mpi_gen_prime at /Users/jkk/esp/esp-idf/components/mbedtls/mbedtls/library/bignum.c:2571
0x42102f0d: mbedtls_rsa_gen_key at /Users/jkk/esp/esp-idf/components/mbedtls/mbedtls/library/rsa.c:712
0x42085a65: esp_rmaker_claim_generate_key at /Users/jkk/esp/esp-box/examples/factory_demo/managed_components/espressif__esp_rainmaker/src/core/esp_rmaker_claim.c:214 (discriminator 1)
0x42085e51: __esp_rmaker_claim_init at /Users/jkk/esp/esp-box/examples/factory_demo/managed_components/espressif__esp_rainmaker/src/core/esp_rmaker_claim.c:843
0x42085f78: esp_rmaker_claim_task at /Users/jkk/esp/esp-box/examples/factory_demo/managed_components/espressif__esp_rainmaker/src/core/esp_rmaker_claim.c:896
0x4038af7e: vPortTaskWrapper at /Users/jkk/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134
LHYhorion commented 6 months ago

Thank you for your feedback, we have taken note of this issue and have fixed it. The upcoming version update will address this problem.

LHYhorion commented 6 months ago

You can also manually disable the 'Enable hardware MPI acceleration' configuration option to mitigate this issue.

MacWyznawca commented 6 months ago

Thanks @LHYhorion! Workaround works!