IO口重复安装中断 & 使用队列时发生错误

fishman
Posts: 13
Joined: Mon May 20, 2019 8:46 am

IO口重复安装中断 & 使用队列时发生错误

Postby fishman » Thu Jul 18, 2019 8:15 am

1.初始化GPIO时候使用过一次gpio_install_isr_service创建中断服务函数
调用ADF的API时发生install错误...是不是只能单独用gpio_isr_register创建中断

2.使用queue时发生报错...但是单独使用时是正常的(发送和接收都在同一个c文件里)
请问,发送和接收在不同的c文件时就不能使用吗?

Code: Untitled.make Select all

[/
E (498) gpio: gpio_install_isr_service(394): GPIO isr service already installed
/home/yejianhui/esp/esp-idf/components/freertos/queue.c:1157 (xQueueGenericSendFromISR)- assert failed!
abort() was called at PC 0x4008617c on core 1
0x4008617c: xQueueGenericSendFromISR at /home/yejianhui/esp/esp-idf/components/freertos/queue.c:1996


Backtrace: 0x400895ac:0x3ffbace0 0x400897d9:0x3ffbad00 0x4008617c:0x3ffbad20 0x400e6903:0x3ffbad40 0x400e7265:0x3ffbad70 0x40086695:0x3ffbadb0
0x400895ac: invoke_abort at /home/yejianhui/esp/esp-idf/components/esp32/panic.c:707

0x400897d9: abort at /home/yejianhui/esp/esp-idf/components/esp32/panic.c:707

0x4008617c: xQueueGenericSendFromISR at /home/yejianhui/esp/esp-idf/components/freertos/queue.c:1996

0x400e6903: report_music_num at /home/yejianhui/esp/DaXia/components/daxia_main.c:357

0x400e7265: daxia_main at /home/yejianhui/esp/DaXia/components/daxia_main.c:397

0x40086695: vPortTaskWrapper at /home/yejianhui/esp/esp-idf/components/freertos/port.c:403]

fishman
Posts: 13
Joined: Mon May 20, 2019 8:46 am

Re: IO口重复安装中断 & 使用队列时发生错误

Postby fishman » Thu Jul 18, 2019 9:25 am

试了一下 ,重复安装不影响IO口使用

还剩queue报错了

fishman
Posts: 13
Joined: Mon May 20, 2019 8:46 am

Re: IO口重复安装中断 & 使用队列时发生错误

Postby fishman » Thu Jul 18, 2019 11:12 am

更改配置,打印的assert信息:

Code: Untitled.c Select all

[
/home/yejianhui/esp/esp-idf/components/freertos/queue.c:1157 (xQueueGenericSendFromISR)- assert failed!
Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x40086ea4 PS : 0x00060d33 A0 : 0x800860fe A1 : 0x3ffbb890
0x40086ea4: uxPortCompareSet at /home/yejianhui/esp/esp-idf/components/freertos/tasks.c:3507
(inlined by) vPortCPUAcquireMutexIntsDisabledInternal at /home/yejianhui/esp/esp-idf/components/freertos/portmux_impl.inc.h:86
(inlined by) vPortCPUAcquireMutexIntsDisabled at /home/yejianhui/esp/esp-idf/components/freertos/portmux_impl.h:98
(inlined by) vTaskEnterCritical at /home/yejianhui/esp/esp-idf/components/freertos/tasks.c:4201

A2 : 0x00000048 A3 : 0x00000068 A4 : 0x00000010 A5 : 0xffffffff
A6 : 0x00000000 A7 : 0xffffffe7 A8 : 0x0000abab A9 : 0x0000abab
A10 : 0xb33fffff A11 : 0x0000cdcd A12 : 0x3ffbb7cf A13 : 0x00000001
A14 : 0x00060d23 A15 : 0x3ffbb7d5 SAR : 0x00000004 EXCCAUSE: 0x0000001d
EXCVADDR: 0x00000048 LBEG : 0x4000c46c LEND : 0x4000c477 LCOUNT : 0x00000000

Backtrace: 0x40086ea4:0x3ffbb890 0x400860fb:0x3ffbb8b0 0x400e690b:0x3ffbb8d0 0x400e726d:0x3ffbb900 0x400865a9:0x3ffbb940
0x40086ea4: uxPortCompareSet at /home/yejianhui/esp/esp-idf/components/freertos/tasks.c:3507
(inlined by) vPortCPUAcquireMutexIntsDisabledInternal at /home/yejianhui/esp/esp-idf/components/freertos/portmux_impl.inc.h:86
(inlined by) vPortCPUAcquireMutexIntsDisabled at /home/yejianhui/esp/esp-idf/components/freertos/portmux_impl.h:98
(inlined by) vTaskEnterCritical at /home/yejianhui/esp/esp-idf/components/freertos/tasks.c:4201

0x400860fb: xQueueGenericSendFromISR at /home/yejianhui/esp/esp-idf/components/freertos/queue.c:1996

0x400e690b: report_music_num at /home/yejianhui/esp/DaXia/components/daxia_main.c:357

0x400e726d: daxia_main at /home/yejianhui/esp/DaXia/components/daxia_main.c:397

0x400865a9: vPortTaskWrapper at /home/yejianhui/esp/esp-idf/components/freertos/port.c:403]

fishman
Posts: 13
Joined: Mon May 20, 2019 8:46 am

Re: IO口重复安装中断 & 使用队列时发生错误

Postby fishman » Thu Jul 18, 2019 12:06 pm

被自己解决了。。
原因是初始化没有及时给队列分配空间
xQueueCreate放在了别的位置导致XQueueSend的消息没运行空间

Who is online

Users browsing this forum: Google [Bot], PerplexityBot and 1 guest