我的代码如下:
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#define GPIO_MPU_INTERRUPT GPIO_NUM_4
#define ESP_INTR_FLAG_DEFAULT 0
void app_main(void)
{
gpio_config_t io_conf = {};
io_conf.intr_type = GPIO_INTR_POSEDGE;
io_conf.pin_bit_mask = 1ULL<<GPIO_MPU_INTERRUPT;
io_conf.mode = GPIO_MODE_INPUT;
io_conf.pull_up_en = GPIO_PULLUP_ENABLE;
gpio_config(&io_conf);
gpio_set_intr_type(GPIO_MPU_INTERRUPT, GPIO_INTR_ANYEDGE);
gpio_install_isr_service(ESP_INTR_FLAG_DEFAULT);
}如果我用优化进行编译--它工作得很好。但是,在没有优化的情况下进行编译时--我得到了一个错误:
IDF/components/freertos/queue.c:821 (xQueueGenericSend)- assert failed!
assert failed: spinlock_acquire spinlock.h:122 (result == core_id || result == SPINLOCK_FREE)
...
0x4008b58f: spinlock_acquire at C:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_hw_support/include/soc/spinlock.h:122
(inlined by) xPortEnterCriticalTimeout at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/port.c:288
0x400882a4: vPortEnterCritical at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/include/freertos/portmacro.h:578
(inlined by) xQueueGenericSend at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/queue.c:840发布于 2022-07-30 10:32:48
看来这是个记忆问题。我已将IPC任务堆栈大小从1024更改为1536,现在正在工作。
发布于 2022-08-05 21:51:00
在我的例子中,存在字符串或char缓冲区溢出。尝试扩展缓冲区大小。
https://stackoverflow.com/questions/73174790
复制相似问题