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文件时就不能使用吗?
  1. [/
  2. E (498) gpio: gpio_install_isr_service(394): GPIO isr service already installed
  3. /home/yejianhui/esp/esp-idf/components/freertos/queue.c:1157 (xQueueGenericSendFromISR)- assert failed!
  4. abort() was called at PC 0x4008617c on core 1
  5. 0x4008617c: xQueueGenericSendFromISR at /home/yejianhui/esp/esp-idf/components/freertos/queue.c:1996
  6.  
  7.  
  8. Backtrace: 0x400895ac:0x3ffbace0 0x400897d9:0x3ffbad00 0x4008617c:0x3ffbad20 0x400e6903:0x3ffbad40 0x400e7265:0x3ffbad70 0x40086695:0x3ffbadb0
  9. 0x400895ac: invoke_abort at /home/yejianhui/esp/esp-idf/components/esp32/panic.c:707
  10.  
  11. 0x400897d9: abort at /home/yejianhui/esp/esp-idf/components/esp32/panic.c:707
  12.  
  13. 0x4008617c: xQueueGenericSendFromISR at /home/yejianhui/esp/esp-idf/components/freertos/queue.c:1996
  14.  
  15. 0x400e6903: report_music_num at /home/yejianhui/esp/DaXia/components/daxia_main.c:357
  16.  
  17. 0x400e7265: daxia_main at /home/yejianhui/esp/DaXia/components/daxia_main.c:397
  18.  
  19. 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信息:
  1. [
  2. /home/yejianhui/esp/esp-idf/components/freertos/queue.c:1157 (xQueueGenericSendFromISR)- assert failed!
  3. Guru Meditation Error: Core  1 panic'ed (StoreProhibited). Exception was unhandled.
  4. Core 1 register dump:
  5. PC      : 0x40086ea4  PS      : 0x00060d33  A0      : 0x800860fe  A1      : 0x3ffbb890  
  6. 0x40086ea4: uxPortCompareSet at /home/yejianhui/esp/esp-idf/components/freertos/tasks.c:3507
  7. (inlined by) vPortCPUAcquireMutexIntsDisabledInternal at /home/yejianhui/esp/esp-idf/components/freertos/portmux_impl.inc.h:86
  8. (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/yejianhui/esp/esp-idf/components/freertos/portmux_impl.h:98
  9. (inlined by) vTaskEnterCritical at /home/yejianhui/esp/esp-idf/components/freertos/tasks.c:4201
  10.  
  11. A2      : 0x00000048  A3      : 0x00000068  A4      : 0x00000010  A5      : 0xffffffff  
  12. A6      : 0x00000000  A7      : 0xffffffe7  A8      : 0x0000abab  A9      : 0x0000abab  
  13. A10     : 0xb33fffff  A11     : 0x0000cdcd  A12     : 0x3ffbb7cf  A13     : 0x00000001  
  14. A14     : 0x00060d23  A15     : 0x3ffbb7d5  SAR     : 0x00000004  EXCCAUSE: 0x0000001d  
  15. EXCVADDR: 0x00000048  LBEG    : 0x4000c46c  LEND    : 0x4000c477  LCOUNT  : 0x00000000  
  16.  
  17. Backtrace: 0x40086ea4:0x3ffbb890 0x400860fb:0x3ffbb8b0 0x400e690b:0x3ffbb8d0 0x400e726d:0x3ffbb900 0x400865a9:0x3ffbb940
  18. 0x40086ea4: uxPortCompareSet at /home/yejianhui/esp/esp-idf/components/freertos/tasks.c:3507
  19. (inlined by) vPortCPUAcquireMutexIntsDisabledInternal at /home/yejianhui/esp/esp-idf/components/freertos/portmux_impl.inc.h:86
  20. (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/yejianhui/esp/esp-idf/components/freertos/portmux_impl.h:98
  21. (inlined by) vTaskEnterCritical at /home/yejianhui/esp/esp-idf/components/freertos/tasks.c:4201
  22.  
  23. 0x400860fb: xQueueGenericSendFromISR at /home/yejianhui/esp/esp-idf/components/freertos/queue.c:1996
  24.  
  25. 0x400e690b: report_music_num at /home/yejianhui/esp/DaXia/components/daxia_main.c:357
  26.  
  27. 0x400e726d: daxia_main at /home/yejianhui/esp/DaXia/components/daxia_main.c:397
  28.  
  29. 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: No registered users and 146 guests