* The queue handle has been passed as a task parameter. ( void * ) xQueueHandle, 2, &xTaskHandle ) XTaskCreate( vTxQueueFunction, "rxDataQueue", 80, XQueueHandle = xQueueCreate( 1, sizeof(uint8_t) ) message task will wait forever for queue to clear The address of this handle is passed to xTaskCreate which fills in the handle of the newly created task. It also declares TaskHandle_t xTaskHandle. You can pass any data of the size of a pointer. Here below the queue handle is passed as a task parameter to the vTxQueueFunction. Heinbali01 wrote on Thursday, October 22, 2015: If( xQueueSendToBack(xQueueTask, &typeVal, rxQueueRATE ) != pdPASS ) Printf("Could not receive from queue\n") Printf("Rcvd in signal active queue: %i\n", rxValue) } xStatus = xQueueReceive( xQueueTask, &rxValue, rxQueueRATE ) /printf(“Queue should be empty, but %i messages in queue\n”, uxQueueMessagesWaiting( xQueueTask ) ) If( uxQueueMessagesWaiting( xQueueTask ) != 0 ) Static void vTxQueueFunction( void *pvParameters ) For the purpose of this tutorial, we will be testing two C functions running on a STM3210E-EVAL evaluation board from. Atollic TrueSTUDIO® for STMicroelectronics® STM32 Lite.
Printf("Scheduler starting, free heap size = %i\n", xPortGetFreeHeapSize()) Atollic TrueSTUDIO® for STMicroelectronics® STM32 Professional, and a demo version is bundled with. If( xTaskCreate( vTxQueueFunction, "rxDataQueue", 80, NULL, 2, &xQueueTask ) != pdPASS ) XQueueTask = xQueueCreate( 1, sizeof(uint8_t) ) QueueHandle_t xQueueTask //create transmit queue It must be crashing before it even gets to the first call to queue, because it never prints the message just before it - see code.Ĭan someone please advise as to where the issue might be? I really need this to work, and I can’t beleive that it is not functioning as it should - again, having used it in other applications I know it works very well. I have also set the queue delay to some other value, i.e., ( TickType_t ) 10, but no luck there. From the debug code, it never reaches there, as it appears to crash somewhere between the start of the scheduler and before queueing the message. The task I am currently calling it from cycles every 225ms, and if there’s a new message to send, it places it (or tries to) on the queue. I have tried queueing messages from different tasks, but the same result. Please see below for how I am using the calls. This is being compiled in Atollic TrueStudio. I checked the FreeRTOS config file, and all looks OK, including stack size.
I am using the same, identical code in other applications and it works fine there. My function and/or call to the queue task is crashing, and I cannot understand why.
Groger57 wrote on Thursday, October 22, 2015: