FreeRTOS Support Archive

The FreeRTOS support forum can be used for active support both from Amazon Web Services
and the community. In return for using our software for
free, we request you play fair and do your bit to help others! Sign up
to receive notifications of new support topics then help where you can.

This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.

Issue with serial interrupt with FreeRTOS

I am using renesas RX62N platform.
My application is as below :
I have a task that is running at 50ms and it is sending serial data to a slave device.Slave device is giving response after receiving this serial data. I have setup a interrupt service routine with priority level 5 in renesas platform.
My ISR is receving each byte and putting it into RAM buffer when buffer exceed 21 byte then i am giving a semaphore to my task(50 ms task) to use that buffer data.

Apart from i have two more task and two more pheripheral ISR.
Please help me to know if i am missing anything to configure pheripheral ISR with FreeRTOS.

My code is running for some seconds and after that it is giving below exception:
void Excep_BRK(void){ wait(); }

ucSlaveID = 1;
ucFunctionCode =4;
usStartAddress = 1;
usRegisterCount = 8;
gucTxBuffer[0] = ucSlaveID;
gucTxBuffer[1] = ucFunctionCode;
gucTxBuffer[2] = ((usStartAddress >> 8) & 0xFF);
gucTxBuffer[3] = ((usStartAddress ) & 0xFF);
gucTxBuffer[4] = ((usRegisterCount >> 8) & 0xFF);
gucTxBuffer[5] = ((usRegisterCount ) & 0xFF);
( void ) pvParameters;
portTickType xNextWakeTime;
/// Initialise xNextWakeTime - this only needs to be done once
xNextWakeTime = xTaskGetTickCount();
///intialise modbus master
MMT_Init();
/// We are using the semaphore for synchronisation so we create a binary
///semaphore rather than a mutex. We must make sure that the interrupt
///does not attempt to use the semaphore before it is created.
xSemaphore = xSemaphoreCreateBinary();
for( ;; )
{
/// Place this task in the blocked state until it is time to run again
///The block state is specified in ticks, the constant used converts ticks to ms
vTaskDelayUntil( &xNextWakeTime, configMODBUS_MASTER_FREQUENCY_50MS );
usQueryCrc = MMT_CRC16(gucTxBuffer,6);
gucTxBuffer[6] = (usQueryCrc & 0xFF);
gucTxBuffer[7] = ((usQueryCrc >> 8)&0xFF);
/// Send modbus rtu query
R_SCI_Send
(
2,
PDL_NO_DATA,
gucTxBuffer,
8,
PDL_NO_FUNC
);
/// Block waiting for the semaphore to become available
if( xSemaphoreTake( xSemaphore, 1 / portTICK_RATE_MS ) == pdTRUE )
{
///do this work
}
/// We have finished our task. Return to the top of the loop where
///we will block on the semaphore until it is time to execute
///again. Note when using the semaphore for synchronisation with an
///ISR in this manner there is no need to 'give' the semaphore back.
}
}