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.

TMS320F28388D: DCAN's API function CAN_initModule will never reture when using SYSBIOS

Part Number: TMS320F28388D
Other Parts Discussed in Thread: SYSBIOS

Hi expert,

My customer is experiencing driverlib API failure when calling CAN_initModule(CANA_BASE); in SYSBIOS project on CM core. I have go through some threads but not sure if it is the same case:

https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/877942

https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/577233

I have also tested this issue at my side on EVM and perfectly reproduced it.

I don't know if this failure is anything related to CM_init(); call in none-BIOS code. In my test, I configure C28x using example project "can_config_c28x" and tested example code "can_ex2_loopback_interrupts" and my code based on BIOS.

My code structure is something in below sequence and it goes to stuck in the while loop in function call CAN_initRAM().

main(){

CAN_initModule(CANA_BASE);

.......

BIOS_start(); 

return(0);

}

If I do something I should not do, means adding CM_init(); in the front, then I can get to the OS scheduler with hard fault occured later.

main(){

CM_init();

CAN_initModule(CANA_BASE);

.......

BIOS_start(); 

return(0);

}

I am not sure what happens here and how to use this API correctly when using a BIOS?

My code is attached here.

SYSBIOS_CM_CAN.zip

Thanks

Sheldon

  • Hi Sheldon,

    The CAN_InitModule() API expects the clocks to be turned on to the API before calling it. 

    When you call CM_Init(). It initializes turns on/enables all periperals. Hence CM_Init should be called, 

    else you can call. 

    SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_CAN_A);

    SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_CAN_B);

    to turn on only the CAN Peripheral. 

    Hope it helps.

    Regards,

    Sudharsanan