New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only two SPI, usb, and sdmmc interfaces can be initialized, and the third one fails. (IDFGH-11567) #12688
Comments
1、初始化了2个SPI后(或1个SDMMC和1个SPI),初始化2个UART,第二个UART失败,只是初始化1个SPI后(或一个SDMMC),2个UART可以成功: 2、先初始化SDMMC(1个),后初始化SPI(2个),再初始化UART(2个),前3个可以成功(SDMMC+2个SPI),两个UART都失败: 3、先初始化SDMMC(1个),后初始化UART(2个),最后初始化SPI(2个),前3个可以成功(SDMMC+2个UART),后面SPI失败: file: "../main/src/Sys/w5500.c" line 159 abort() was called at PC 0x40383b1f on core 0 4、先初始化SDMMC(1个),后初始化SPI(2个),再初始化USB,最后初始化UART(2个),最前3个可以成功(SDMMC+2个SPI),后面USB和UART失败: 以上测试在初始化第一个设备前还初始化了一个I2C的RTC,如果我把RTC初始化注释了,重新运行第4个程序,则第一个UART可以正常初始化,从以上情况基本可以看出前4个设备驱动可以正常初始化,之后的就会失败,我需要用到1个I2C、2个SPI、3个UART(其中一个作为刷程序和日志输出)、1个SDMMC、1个USB,共8个设备,如果刷程序和日志输出的也算成功的话,那也就是idf只可以初始化5个设备。我还使用到了蓝牙,但不管蓝牙是先初始化还是后初始化都不受影响。 |
Please check out this section: https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32/api-reference/system/intr_alloc.html#id7 |
你好,按照这个说明,我把不同的设备分别加载在两个CPU上,确实驱动加载不再报错了,但也有新的问题,出现了3种情况: Core 0 register dump: A2 : 0x3731368d A3 : 0xb33fffff A4 : 0x0000cdcd A5 : 0x3fca9ae0 0x40056f72: memcpy in ROM Backtrace: 0x40381258:0x3fca8110 0x4038706d:0x3fca8130 0x40384774:0x3fca8160 0x4200dce3:0x3fca81a0 0x42008b3e:0x3fca81c0 0x42008b91:0x3fca81f0 0x40386f05:0x3fca8210 0x4038706d: spinlock_acquire at /home/user /esp/esp-idf/components/esp_hw_support/include/spinlock.h:103 0x40384774: vPortEnterCritical at /home/user /esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:575 0x4200dce3: led_timer_cb at /home/user /esp-projects/IoT-Station-ESP32-S3-New/build/../main/src/Sys/blink.c:28 0x42008b3e: timer_process_alarm at /home/user /esp/esp-idf/components/esp_timer/src/esp_timer.c:451 0x42008b91: timer_task at /home/user /esp/esp-idf/components/esp_timer/src/esp_timer.c:477 (discriminator 1) 0x40386f05: vPortTaskWrapper at /home/user /esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:162 2、在Core1上启动UART(有数据传入),并使用QueueHandle_t接收uart数据,报如下错误 Core 1 register dump: A2 : 0x7379735e A3 : 0xb33fffff A4 : 0x0000abab A5 : 0x00002463 0x400570f3: memset in ROM Backtrace: 0x40381258:0x3fcbd330 0x4038706d:0x3fcbd350 0x40384677:0x3fcbd380 0x4200d577:0x3fcbd3c0 0x40386f05:0x3fcbd400 0x4038706d: spinlock_acquire at /home/user /esp/esp-idf/components/esp_hw_support/include/spinlock.h:103 0x40384677: vPortEnterCritical at /home/user /esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:575 0x4200d577: uart_event_task at /home/user /esp-projects/IoT-Station-ESP32-S3-New/build/../main/src/Sensor/gps_embed.c:189 0x40386f05: vPortTaskWrapper at /home/user /esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:162 3、在Core1上启动UART(无数据传入),并使用QueueHandle_t接收uart数据,会不停的重启,日志显示的是看门狗重置: SPIWP:0xee 以上程序是在cpu0上初始化了gpio_install_isr_service,在cpu1上有个spi设备使用到了gpio中断,如果把cpu1上的这个spi设备停用了也就没问题了,如果启用了这个spi设备,不启用UART则这个spi设备工作正常,中断也正常,这是有什么冲突吗?应该如何解决呢? |
Thanks, I've fixed this issue, it's true that the interrupt on cpu0 has run out, the weird issue I'm having above is because xTaskCreate is non-thread-safe, the problem caused by both cpus creating the task. But there is a strange problem, I now use cpu0 to create a subtask to run on cpu1, and then this task to load all the devices and run, it works well, but now cpu0 can't load a device, it can still load 3 before, why is this? Is there any way to see what task each interrupt on the cpu is occupied? |
Answers checklist.
IDF version.
v5.1.2
Espressif SoC revision.
ESP32-S3-N8R2
Operating System used.
Linux
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
None
Development Kit.
Custom board
Power Supply used.
USB
What is the expected behavior?
I need to use 2 spi ports (one to W5500 and one to WK2124), USB port (SIMCom A7670) and SDMMC (SDIO), a total of 4 devices, and these 4 devices will be used at the same time.
What is the actual behavior?
However, no matter what the initialization order of these 4 devices is, only the first 2 will be initialized successfully, and the later ones will report ESP_ERR_NOT_FOUND errors.
Steps to reproduce.
...
Debug Logs.
More Information.
No response
The text was updated successfully, but these errors were encountered: