Dear All,
I am using latest FreeRTOS version 7.5.2, and having crash in XqueueGenericsendfromisr, my software is pretty complex and include TCIP stack from Microchip, I have few task but the problem is located in Uart1 ISR, my code is derivated fromdemo as follow :
IFS0bits.U1RXIF = serCLEAR_FLAG;
U1STAbits.OERR = 0;
while( U1STAbits.URXDA )
{
cChar = U1RXREG;
xQueueGenericSendFromISR( xUart1RxedChars, &cChar, &xHigherPriorityTaskWoken, queueSEND_TO_BACK );
// xQueueSendFromISR( xUart1RxedChars, &cChar, &xHigherPriorityTaskWoken );
// PORTDbits.RD2 =1;
}
if( xHigherPriorityTaskWoken != pdFALSE )
{
taskYIELD();
}
I discovered the hang is when calling xQueugenericSendFrom ISR, putting some “Led on” trace, I was able to discover the problem was when calling prvCopyDataToQueue (from xqueuegeneric) and exactly on this line :
( void ) memcpy( ( void * ) pxQueue->pcWriteTo, pvItemToQueue, ( size_t ) pxQueue->uxItemSize ); /*lint !e961 !e418 MISRA exception as the casts are only redundant for some ports, plus previous logic ensures a null pointer can only be passed to memcpy() if the copy size is 0. */
I do not see why this memcpy give me hang, but I just saw that few other people on other platform are having pb on xqueuesend or xqueuereceive call.
Any idea welcome.
Regards