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.

AM2634-Q1: AM2634 MCAL CAN Module Interrupt Mode Issue: Unable to Enter Interrupt After First Data Transmission

Part Number: AM2634-Q1
Other Parts Discussed in Thread: AM2634

Tool/software:

I am currently using the AM2634 development board and working with the MCAL CAN module. Initially, I used polling mode, and it worked without issues. Later, I wanted to try interrupt mode, but after executing the following code to send data, it only successfully sends data the first time and cannot enter the interrupt handler. Could you please help me identify what might be missing in my configuration? Thank you.

Additionally, I am using the MCAL version MCAL_AM263X_10.00.00.

The configuration of MCAN is shown below.

Here is my code:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void CanExample_InterruptConfig(void)
{
vimInit();
Vim_IntCfg Can_IntCfg;
Can_IntCfg.map = VIM_INTTYPE_IRQ;
Can_IntCfg.type = VIM_INTTRIGTYPE_LEVEL;
Can_IntCfg.intNum = MCAN0_MCAN_LVL_INT_0;
Can_IntCfg.intNum = MCAN0_MCAN_LVL_INT_0;
Can_IntCfg.handler = Can_0_Int0ISR;
Can_IntCfg.priority = VIM_PRIORITY_0;
vimRegisterInterrupt(&Can_IntCfg);
}
Mcu_Init(&McuModuleConfiguration);
Mcu_InitClock(McuConf_McuClockSettingConfig_McuClockSettingConfig_MCAN0);
while ( MCU_PLL_LOCKED != Mcu_GetPllStatus() )
{
/* wait until all enabled PLLs are locked */
}
Mcu_DistributePllClock();
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Additionally, I have included some register values during runtime. It appears that the MCAN interrupt is enabled and gets triggered.

  • Hello,

    Please share your generated configuration files, so that we can review at our end.

    Thanks,
    Gunjan

  • Hi Gunjan,

              I am currently working with the AM263Px Control Card using the CCS Theia environment and MCU+ SDK version 10.0.0.35 with example file of mcan_external_read_write. I can be able to transmit data bytes with extended CAN IDs with mcan_external_read_write example for MCU + SDK 10.0.0.35 from AM263Px Control Card. But while recieving data bytes code is getting stuck at vApplicationIdleHook function.

    Attached my code for your reference

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /*
    * Copyright (C) 2023 Texas Instruments Incorporated
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the
    * distribution.
    *
    * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Regards,

    Tarun

  • Hi Gunjan, 

    Thank you for your reply. Attached are my configurations using EB, including the generated configurations. Additionally, I am using MCAL version 10.00.00. Thank you.

     am263mcal10.zip

    Regards,

    ph tseng

  • Hi Gunjan,
    Is there any update?

    Also, when using the GPT module, I encounter a similar situation where, after the GPT expires, it triggers an interrupt, but the CPU does not jump to execute the interrupt handler and keeps the interrupt in a pending state.
    Thank you for your reply.
     

    Regards,

    ph tseng

  • I have solved this problem. I am using the TI Clang v4.0.0.LTS compiler, and when using the VIM driver, the TI Clang compiler cannot apply any optimizations. Otherwise, it causes the VIM driver's dispatcher to enter an error. Additionally, when I switched the compiler to TI v20.2.7.LTS, optimizations could be used.

    I am not sure if the inability to use any optimizations with the VIM driver when using the TI Clang compiler counts as a bug.