This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM263P4: ISR not triggering when HSMClent function is called inside the ISR

Part Number: AM263P4

Hi,

I have mcan example with Receiving in ISR and calling funcion say func1() after reading the data.

In func1(), I am trying to call HsmClient functions example HsmClientgenerateRandomNum().

They both work fine independently as Receiving in ISR and func1() running and HsmClient.

When they are integrated as stated above, im not able to get triggered by the ISR in mcan for receiving.

Could you help me understand what am i missing here?

 

Geetha

 

  • Hi Geetha,

    May I know what is the priority set for both ISRs? 

    Thanks and Regards,

    Nikhil Dasan

  • Hi Nikhil,

    Its is set 3 and 4 for MCAN Tx and Rx, for HSM it is 7.

  • Hi Geetha, 
    Let me check this and get back to you

  • Hi,

    When I was using hsmclient functions, the hsm isr triggers, the hsm responds and gives response , but on R5 side, the isr never triggers.

    I have changed the hsm priority to 2 and for mcan it stays the same. Then R5 core receives interrupt.

    My code flow is, through CAN i receive data from external tool, the R5 core receives data and sends data to HSM for processing and if it is success from HSM, then it will respond to the Tool.
    The tool also sends data after receiving the data from LaunchPad. Here I dont have dependency for HSM ISR for not being triggered. But why does it get effected?

    Also, sometimes the R5 core interrupt is not triggered from HSM at random times, Can you help me understand what am I missing here?

    Thanks and Regards,

    Geetha

  • Hi Geetha,

    Is the project based on FreeRTOS or NoRTOS? 
    The HSM Client API is called from interrupt contxt (from MCAN ISR) so the priority of the HSM Client ISR should be higher for it to preempt the MCAN ISR. 

    There is the HsmClient_SendAndRecv() function that is called. This function sends a request to HSM and then waits for it. The wait is basically a Semaphore Pend wait. The SempahoreP_Pend() function behavior depends on the OS. If Freertos, it would return error. But in nortos it would wait in a loop, since we are calling semaphore pend with WAIT_FOREVER as timeout. That is why I wanted to know the OS configuration

    Most importantly I think it is safe to call this function (HSM Client Function) outside the ISR to keep the ISR short and fast.

    Thanks & Regards,

    Aswin