esp-idf 断言失败:spinlock_acquire

问题描述 投票:0回答:2

我的代码如下:

#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
c esp32 freertos esp-idf
2个回答
1
投票

看起来是内存问题。我已将 IPC 任务堆栈大小从 1024 更改为 1536,现在可以正常工作了


-1
投票

您在哪里/如何更改堆栈大小?

© www.soinside.com 2019 - 2024. All rights reserved.