configASSERT(( pxQueue )); error

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

configASSERT(( pxQueue )); error

1,129 次查看
robertholm73
Contributor II

 

 

void vMenuTask(void* pvParameters) {
/* The parameter value is expected to be 1 as 1 is passed in the
   pvParameters value in the call to xTaskCreate() below. */
//configASSERT(((uintptr_t)pvParameters) == 1);
 
for (;;) {
        printf("Test\n\n");
        vTaskDelay(pdMS_TO_TICKS(100));
 
}
 
}void vInitMenuTask(void) {
 
// Create the task dynamically
BaseType_t xTaskCreated = xTaskCreate(vMenuTask,              // Task function
"Menu Task",           // Task name
MENU_TASK_STACK_SIZE, // Stack size
(void*)1,              // Task parameter
MENU_TASK_PRIORITY, // Priority
&xMenuTaskHandle  // Task handle
);
 
if (xTaskCreated == pdPASS) {
safePrintf("Menu task created successfully.\n");
}
else {
safeFprintf(stderr, "Failed to create menu task. Not enough heap RAM.\n");
}
}

vInitMenuTask();

safePrintf("FreeRTOS initialization complete.\n");

vTaskStartScheduler();
/* vTaskStartScheduler should not return, but if it does, enter an infinite loop: */
for (;;) {

}

}

 

Hi, I have a strange problem with a MKV59F24F24C. I am running he latest edition of FreeRTOS and trying to create a very simple task. The debugger gets stuck at configASSERT(( pxQueue )); in queue.c.  My code is shown above.

 

 

Any insights from anyone please?

 

标签 (2)
0 项奖励
回复
2 回复数

1,035 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

H

This is configASSERT(x) definition in FreeRTOSConfig.h

/* Define to trap errors during development. */

#define configASSERT(x) if(( x) == 0) {taskDISABLE_INTERRUPTS(); for (;;);}

It means that  when the x is zero, it is a wrong case, the core will trap error.

But I think this is a wrong calling configASSERT(((uintptr_t)pvParameters) == 1);, you should call it as

configASSERT(pvParameters);

Pls have a check.

But I do not see the configASSERT(((uintptr_t)pvParameters) == 1); in queue.c,

can you post a screen shot for the configASSERT(((uintptr_t)pvParameters) == 1);?

 

 

xiangjun_rong_0-1730699910507.png

 

Hope it can help you

BR

XiangJun Rong

 

0 项奖励
回复

1,122 次查看
robertholm73
Contributor II
P.S. Apologies for not typesetting the code, but the web app ignored me when I tried.
0 项奖励
回复