I'm using freertos and flexcan. In the send function of can(FlexCAN_Ip_Send), FlexCAN_SetMsgBuffIntCmd is called to enable the message buffer interrupt. In the FlexCAN_SetMsgBuffIntCmd function, we call SchM_Enter_Can_43_FLEXCAN_CAN_EXCLUSIVE_AREA_18 fun for Start critical section, This function ends up calling taskEXIT_CRITICAL, which is not interrupt-safe, causing the program to get stuck in the vPortEnterCritical function. What should be set up to avoid this situation?
Attached my project
void vPortEnterCritical( void )
{
portDISABLE_INTERRUPTS();
uxCriticalNesting++;
/* This is not the interrupt safe version of the enter critical function so
* assert() if it is being called from an interrupt context. Only API
* functions that end in "FromISR" can be used in an interrupt. Only assert if
* the critical nesting count is 1 to protect against recursive calls if the
* assert function also uses a critical section. */
if( uxCriticalNesting == 1 )
{
configASSERT( ( portNVIC_INT_CTRL_REG & portVECTACTIVE_MASK ) == 0 );
}
}