The FlexCAN driver in RTD4.0.0p01 hits an assert in FreeRTOS vPortEnterCritical().
When processing a CAN Tx complete interrupt, the device hangs. After halting, this is the observed call stack:
SchM_Enter_Can_43_FLEXCAN_CAN_EXCLUSIVE_AREA_18() is invoking OsIf_SuspendAllInterrupts(), which in previous versions of RTD was ultimately an asm "cspid i" instruction.
In RTD4.0.0, this is now as follows:
Which hits this configASSERT() because it has been invoked in an interrupt context:
configASSERT( ( portNVIC_INT_CTRL_REG & portVECTACTIVE_MASK ) == 0 );
portNVIC_INT_CTRL_REG is 0x447b87e (in the middle of handling interrupt 0x7E).
Solved! Go to Solution.
Hello @nehalp,
Could you try to configure Minimal Stack Size equal to 512 and re-test?
Best regards,
Dan
Making this change (and only this change) avoids the configASSERT and allows the application (a port of the MR-CANHUBK344 demo app to RTD4.0.0) to create and send and receive CAN and Ethernet messages.
In OsIf_Internal.h at line 245:
Hello @nehalp,
Could you try to configure Minimal Stack Size equal to 512 and re-test?
Best regards,
Dan
Hello @nehalp,
Yes, interrupt handler function of RTD request stack size larger than default configuration of FreeRTOS.
Best regards,
Dan