Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed from November 25 through December 2. Thank you for your patience.

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.

SK-AM62: SK-AM62: Configure MCAN receiving interrupt (forever loop in HwiP_construct() function)

Part Number: SK-AM62

Hi, I am trying to set up an receiving interrupt on the MCAN0 interface of the Arm Cortex- M4F (MCU) which is integrated into the AM62.

The problem now is that i get stuck in the HwiP_construct function which is there to create a Hwi Object. It seams like that I pass the wrong interrupt number to the function (HwiP_Params struct field intNum).

But neither the reference manual nor the mcan loopback example of the SDK could help me to find the right number.

In the SDK example, this interrupt number gets generated out of the .syscfg file: 

I cannot see where this number comes from and which number I have to use that I am able to receive the interrupt.

Maybe i am overlooking something.

  • Hello Dominik,

    I am attaching screenshot from Table 10-18(Interrupt Connections Summary) of AM62x TRM below:

    As you can see, the main domain CAN module's interrupt is not connected to MCUSS(M4F) core and hence interrupt mode would not work from M4F core. MCAN0 ,module can only be accessed in POLLING mode from M4F core.

    You can try using MCU MCAN module instead of MCAN0 module if you want to operate in interrupt mode.

    Regards,

    Nihar Potturu

  • Hi Nihar,
    Thank you for your response.
    Yes sorry, actually I was talking about the MCAN of the MCU (MCU_MCAN0). Very sorry for the misunderstanding here Slight smile.

  • Hello Dominik,

    If you take a look at Table 10-12 of AM62x TRM(attaching screenshot below for reference), the MCU_MCAN0 interrupts have interrupt numbers 42-44.

     

    For M4F, external interrupt #43 at NVIC is
    16 internal interrupts + external interrupt number at NVIC = 59.
    Hence, the interrupt number being generated by syscfg in the screenshot you attached is correct. I have tried running the mcan_loopback_interrupt example from the latest mcu_plus_sdk_am62x_09_00_00_19 version and the example runs without any issues at my end.
    • Did you try running the default provided example first? Are you seeing issues with Hwip_Construct even with the default example?
    • If you are not using the latest version, can you please try using the latest MCU+SDK version?(https://www.ti.com/tool/download/MCU-PLUS-SDK-AM62X/09.00.00.19)
    • Are you using the default TI EVM or is it a custom board?

    Regards,

    Nihar Potturu. 

  • Hi Nihar,
    Thanks again for your response. I think I have figured it out now, but some points still are not 100% clear to me.

    You were right I was using an older version of the SDK example first. As soon as I changed that I was able to run the example on my hardware. 

    But in my code, which should run on the target I still got stuck in the function that constructs the hwi object. I called this function inside a class setup function which seams like was the problem there. The solution was to move the function call into a function inside an anonymous namespace in the .cpp file of the class (move it to static) and this worked (had also some other adjustments to do but this was the main one).

    But what I still do not understand, is why this function to create the hwi object gets stuck into an endless loop if not called from static space but from inside the class.

    Thanks for your support and i wish you a wonderful weekend

  • Hello Dominik,

    Glad to hear that you found the root cause for the issue. Because of the ongoing holiday week in India, many people are out of office. Please give me time till Wednesday this week to look into the possible reason for this issue and get back to you. 

    Regards,

    Nihar Potturu.