-
Notifications
You must be signed in to change notification settings - Fork 929
Open
Description
Answers checklist.
- I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
- I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
- I have searched the issue tracker for a similar issue and not found a similar issue.
IDF version.
5.5.1
Espressif SoC revision.
esp32s3
Operating System used.
Linux
How did you build your project?
Command line with Make
If you are using Windows, please specify command line type.
None
Development Kit.
s3
Steps to reproduce.
红外线学习在创建线程的时候会把这个栈变量的指针传递给线程,但是栈会释放的,线程里面访问的时候就会导致panic,我修改成全局变量后就不会panic了,我是按照例程写的,不知道是不是我的程序有问题
ir_learn_common_param_t learn_param ;
esp_err_t ir_learn_new(const ir_learn_cfg_t *cfg, ir_learn_handle_t *handle_out)
{
ESP_LOGI(TAG, "IR learn Version: %d.%d.%d", IR_LEARN_VER_MAJOR, IR_LEARN_VER_MINOR, IR_LEARN_VER_PATCH);
BaseType_t res;
esp_err_t ret = ESP_OK;
IR_LEARN_CHECK(cfg && handle_out, "invalid argument", ESP_ERR_INVALID_ARG);
IR_LEARN_CHECK(cfg->learn_count < IR_LEARN_STATE_READY, "learn count too larger", ESP_ERR_INVALID_ARG);
ir_learn_t *ir_learn_ctx = calloc(1, sizeof(ir_learn_t));
IR_LEARN_CHECK(ir_learn_ctx, "no mem for ir_learn_ctx", ESP_ERR_NO_MEM);
learn_param.user_cb = cfg->callback;
learn_param.ctx = ir_learn_ctx;
下面创建这个线程的时候会将栈变量的指针做完参数传递给线程,这应该是有问题的
res = xTaskCreatePinnedToCore(ir_learn_task, "ir learn task", cfg->task_stack, &learn_param, cfg->task_priority, NULL, cfg->task_affinity);
Build Logs.
More Information.
No response
Metadata
Metadata
Assignees
Labels
No labels