My application is receiving a CAN message and taking almost 100 ms to respond. This seems a bit too much…
I’m using FreeRTOS 10.3.3 with MPLAB X 5.50 and Harmony 3 on a ATSAMV71-XULT board.
I wonder what are my possibilities in terms of profiling?
Any special plugins available for MPLAB X 5.50?
I think MPLAB X has some FreeRTOS profiling built in - but before that - how are you communicating the arrival of the CAN message to the task that handles it. If the task handling it is Blocked on something like a task notification to wait for the message, and the ISR that signals the receipt of the CAN message sends the notification to the task, then (presuming the task that is unblocked has a high priority) the interrupt should return directly to the task that consumes the CAN messages. If you architect like that it should take sub-millisecond time between message arrival and message processing. This page shows the design pattern: https://www.freertos.org/RTOS_Task_Notification_As_Counting_Semaphore.html
Yes the interrupt routine receives a message and it signals through a semaphore to the receiving task which in turn processes the message.
I have increased the priority by 1 of the receiving task but still the same behaviour. Around 100 ms since reception until sending the response…
Minor point - not the cause of your observation - but xHigherPriorityTaskWoken should be initialised to 0 (pdFALSE). It will then get set to pdTRUE only if a context switch is required, which can save you some cycles.