Dear community members,
I have a peculiar problem I'm not sure how I should go around to debug it. I am currently using the Hercules to interface with 2 other Freescale Kinetis boards. The Kinetis boards are responsible for sending out CAN messages to Hercules.
On Hercules, I am running FreeRTOS, of which I have created tasks which runs periodically and preempts using its OS API - vTaskDelayUntil(). In particular, the CAN task which does the processing of the message receive is running on a period of 40ms. My CAN message receive on Hercules runs on the interrupt method; for every CAN message received, the interrupt is triggered which then calls the canMessageNotification who then provides a semaphore for the CAN task to run.
I've setup the Hercules through Halcogen 04.06.00 to run in two ways. I've first tried to have a single message object for each CAN message ID. Then I tried having a FIFO buffer for each of the CAN message IDs with a buffer size of 4. For both configurations, I have set the EOB bit on the message objects.
The problem I am encountering is that the system runs for a period of time before it gets stuck within the CAN task when it calls for "while(!canIsRxMessageArrived(canREG1, canMESSAGE_BOX10));". For some reason, it is always returning a 0 when a CAN message under that ID should have been received which is why the function was called in the first place. I verified that the CAN interrupts are still coming through for the other message IDs but the system is stuck @ the while loop when it returns to the CAN task.
How should I go about to solve this problem?
Any help would be greatly appreciated and thank you for reading such a lengthy post.
Best regards,
Daniel