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.

TMS320F280039C: MCAN Rx Interrupt not working but Tx is working

Part Number: TMS320F280039C

Tool/software:

1. I have a custom bootloader and I am loading a new application code into flash memory (OTA) using Flash Api .
2. After successful loading of application code the code jumps to the starting address of the application so that it start executing application 
3. Out of almost 1700 + OTA attempts, I have found 7 attempts where after application starts running the MCAN Rx interrupt doesnt work but Tx works. 
4. The catch here is if I do power on reset without again loading application in that attempt then issue is solved, Rx interrupt starts working. 
5. I am disabling MCAN Interrupts in bootloader before jumping to application and again enabling it.

What could be the possible reason for this 
 

  • Hi Tanmay,

    Are you able to inspect the MCAN registers on cases where the OTA attempt failed?  Or can you put an ESTOP0 or breakpoint whenever OTA attempt fails so that you can display the MCAN register contents via Code Composer and Emulator?

    Regards,

    Joseph

  • Hi Joseph,  

    I dont have a debugger in the PCB. I will try to publish MCAN registers on CAN Bus directly. Can you help with what registers to attack directly.

    Regards
    Tanmay

  • Hi Tanmay,

    Please check on the MCAN Bit Clock source configuration register CLKSRCCTL2.  For Interrupt status, check for MCANSS_IRS, MCANSS_IES.  Also monitor error counter register MCAN_ECR and check for protocol status register MCAN_PSR.  These are just the minimum registers to look at but also check other configuration registers to make sure what was configured was written to the MCAN register.

    Regards,

    Joseph

  • Hi Joseph,

    I tried to debug and following are my observations ..
    1. Before Jumping to Application from Bootloader .. I am disabling all interrupts and it seems like during that time one of the CAN messages of Bootloader is stored in the Buffer and not cleared. 
    2. I am initialising CAN Mailbox 1 to different CAN ID in Bootloader and Application.
    3. I debugged and found that in NEW DATA register MCAN_NDAT1 the value was 1 (1st Mailbox) when entered in Application without sending any CAN ID's of Application ... which shows Bootloader msg is still stored in Buffer 

    Now I want to clear the all the buffers of bootloader while initializing MCAN again in Application .. What should I do ? I tired only clearing the NEW Data register but didnt help. How to clear interrupt and all buffers  

    Thanks and Regards,
    Tanmay Parekh

  • Hi Tanmay,

    Just wanted to clarify so we are in the same page and apologies, I did not ask this earlier.  When you say you have a custom MCAN bootloader, are you referring to Custom Boot Mode #8 (CAN-FD/MCAN bootmode) and using the flash kernel to program the code?  This would tell us how to go forward and debug your idduse.

    Thanks,

    Joseph

  • Hi Joseph,

    No no .. I am referring to a bootloader designed by me where there is one more TI Microcontroller which sends data over CAN to the bootloader designed TI MCU which here is MCAN and I use flash API library to write the data sent over MCAN in Flash Memory.. Basically a secondary bootloader.. Not using any of the inbuilt TI Boot Modes

    Thanks ,
    Tanmay

  • Hi Tanmay,

    Thanks for the clarification.  Are you perhaps using TX buffer for sending out the mailbox?  There is a known advisory on MCAN in our errata regarding TX buffer:

    Regards,

    Joseph