【已解决】S2 SPI MASTER assert(desired_dev) 问题

ppacctv
Posts: 1
Joined: Tue May 23, 2023 2:25 am

【已解决】S2 SPI MASTER assert(desired_dev) 问题

Postby ppacctv » Tue May 23, 2023 2:31 am

idf master 5.2

driver/spi_master.c 729 行
assert(desired_dev)出错

驱动lcd,大概4月份git更新master代码后,发生错误,将assert(desired_dev)注销,错误消失。

assert failed: spi_intr spi_master.c:729 (desired_dev)


Backtrace: 0x400254a2:0x3ffc3b50 0x4002b519:0x3ffc3b70 0x400317b9:0x3ffc3b90 0x40027df3:0x3ffc3cb0 0x40026f91:0x3ffc3ce0 0x4001a8d1:0x3ffe4140 0x4002d985:0x3ffe4150 0x400260e4:0x3ffe4170 0x40027bb9:0x3ffe4190 0x40028321:0x3ffe41b0 0x400283d5:0x3ffe41e0 0x40027f0b:0x3ffe4200 0x400a1b9b:0x3ffe4220 0x400a18fe:0x3ffe4270 0x4008b369:0x3ffe42a0 0x400962eb:0x3ffe42c0 0x400963e2:0x3ffe4300 0x4008d7af:0x3ffe4330 0x40094e5a:0x3ffe4370 0x4002d86d:0x3ffe43a0
0x400254a2: panic_abort at D:/Espressif/frameworks/esp-idf-master/components/esp_system/panic.c:452

0x4002b519: esp_system_abort at D:/Espressif/frameworks/esp-idf-master/components/esp_system/port/esp_system_chip.c:90

0x400317b9: __assert_func at D:/Espressif/frameworks/esp-idf-master/components/newlib/assert.c:81

0x40027df3: spi_intr at D:/Espressif/frameworks/esp-idf-master/components/driver/spi/gpspi/spi_master.c:729 (discriminator 1)

0x40026f91: _xt_medint2 at D:/Espressif/frameworks/esp-idf-master/components/xtensa/xtensa_vectors.S:1315

0x4002d985: vPortClearInterruptMaskFromISR at D:/Espressif/frameworks/esp-idf-master/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:568
(inlined by) vPortExitCritical at D:/Espressif/frameworks/esp-idf-master/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:532
(inlined by) vPortExitCritical at D:/Espressif/frameworks/esp-idf-master/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:517

0x400260e4: vPortExitCriticalSafe at D:/Espressif/frameworks/esp-idf-master/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:604
(inlined by) esp_intr_enable at D:/Espressif/frameworks/esp-idf-master/components/esp_hw_support/intr_alloc.c:804

0x40027bb9: spi_bus_intr_enable at D:/Espressif/frameworks/esp-idf-master/components/driver/spi/gpspi/spi_master.c:576

0x40028321: bg_enable at D:/Espressif/frameworks/esp-idf-master/components/driver/spi/spi_bus_lock.c:324
(inlined by) acquire_end_core at D:/Espressif/frameworks/esp-idf-master/components/driver/spi/spi_bus_lock.c:450

0x400283d5: spi_bus_lock_acquire_end at D:/Espressif/frameworks/esp-idf-master/components/driver/spi/spi_bus_lock.c:737 (discriminator 2)

0x40027f0b: spi_device_release_bus at D:/Espressif/frameworks/esp-idf-master/components/driver/spi/gpspi/spi_master.c:1031 (discriminator 15)

0x400a1b9b: panel_io_spi_tx_color at D:/Espressif/frameworks/esp-idf-master/components/esp_lcd/src/esp_lcd_panel_io_spi.c:388

0x400a18fe: esp_lcd_panel_io_tx_color at D:/Espressif/frameworks/esp-idf-master/components/esp_lcd/src/esp_lcd_panel_io.c:29 (discriminator 2)

0x4008b369: lcd_fill_rect at D:/ZMZ/Project/ESP32S2/S2_MIN_CW/main/lcd/lcd.c:232

0x400962eb: gui_draw_region at D:/ZMZ/Project/ESP32S2/S2_MIN_CW/main/gui/gui_com.c:50

0x400963e2: gui_draw_rect at D:/ZMZ/Project/ESP32S2/S2_MIN_CW/main/gui/gui_com.c:26

0x4008d7af: transcribe_custom_refresh at D:/ZMZ/Project/ESP32S2/S2_MIN_CW/main/cw/transcribe_custom.c:179

0x40094e5a: gui_svc_run at D:/ZMZ/Project/ESP32S2/S2_MIN_CW/main/gui/gui_svc.c:147

0x4002d86d: vPortTaskWrapper at D:/Espressif/frameworks/esp-idf-master/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:162

ESP_Yake
Posts: 109
Joined: Mon Mar 06, 2017 12:23 pm

Re: S2 SPI MASTER assert(desired_dev) 问题

Postby ESP_Yake » Tue May 23, 2023 9:39 am

你是从哪个版本升级到master分支的,代码是不是还是复用的原来分支的。
LCD在 v5.0 做了一些改动 (https://docs.espressif.com/projects/esp ... s.html#lcd), 建议你们直接基于master 分支的 demo进行测试

fanatmeta
Posts: 4
Joined: Thu Jun 23, 2022 10:45 pm

Re: S2 SPI MASTER assert(desired_dev) 问题

Postby fanatmeta » Tue May 30, 2023 1:19 am

我们这边观察到同样问题,LCD 随机出现(和 timing 有关)

Code: Select all

D (3089) lcd_panel.st7789: new st7789 panel @0x3fc9cd9c

assert failed: spi_intr spi_master.c:651 (desired_dev)
代码基于的 master 分支的,这个看起来像是锁竞争?按理说 SPI 中断内 desired_dev 怎么会变呢?

yake827
Posts: 43
Joined: Mon Aug 09, 2021 7:51 am

Re: S2 SPI MASTER assert(desired_dev) 问题

Postby yake827 » Tue Jun 06, 2023 8:51 am

我发现 SPI 驱动的工程师已经在 github 上推送了一个 fix 方案 (https://github.com/espressif/esp-idf/co ... 05f7290a1f),请问问题目前还存在吗

fanatmeta
Posts: 4
Joined: Thu Jun 23, 2022 10:45 pm

Re: S2 SPI MASTER assert(desired_dev) 问题

Postby fanatmeta » Sun Jun 18, 2023 8:22 pm

Already fixed on master

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 32 guests