groger57 wrote on Thursday, July 14, 2016:
Hello:
I’ve created a queue send and receive function near-identical as per the example in the newest FreeRTOS guide, from page 157.
The only difference being that I have a structure defined and that’s what I am passing in. The structure is 34 bytes, and I havea queue size of 5.
When I send a structure pointer to xQueueSendToBack, the function xQueueReceive gets the pointer and structure correctly, as the debugger shows the contents.
Also in the program, I have a function I use to send data out the UART. After formatting a string, I call the function:
USART_GetResponseStr( scrnBfr );
From the task that performs xQueueSendToBack, I can call this function with a formatted string and the function performs as expected, I get a graphic item on the target screen. However, when I use the same function call from xQueueReceive, (upon pdPASS TRUE) the function appears to break, and nothing gets to the screen.
uint16_t USART_GetResponseStr( char *s )
{
uint16_t getData = 0x0;
//send string out
OutString( s );
while(1) // poll response
{
getData = USART_FetchChar();
if( getData == 0x3E )
{
//one more for 0xD
getData = USART_FetchChar();
break;
}
}
return getData;
}
By printing out the formatting string in xQueueReceive, it’s identical to the same call in the task xQueueSendToBack. Can someone please provide some insight as to why this might happen? The only thing I could think of is the task size, it’s set at 200. Adjusting it up made no differnce.
Thanks for any help you can provide!
Gary