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.

TMS320F28384S: Running MCAN ISR From Ram

Expert 1700 points
Part Number: TMS320F28384S
Other Parts Discussed in Thread: C2000WARE

Hi Team,

I have a CM code that is using MCAN to communicate with a CAN Master.

it works OK.

I want modify the code and have the MCANIntr1ISR run from RAM instead of running from flash.

I tried setting up #pragma CODE_SECTION(MCANIntr1ISR, ".TI.ramfunc").

 while I can see in the map file that the function had moved , interrupt never happens

is there anything else I need to do ?

what do I need to check ?

  • Inno, 

    We are looking into it and will get back to you very soon.

    Thanks.

  • Inno, 

    There are a couple of things that you can check.

    First, you need to check if your code has a memcpy command (included in the device_init function in all C2000ware examples). All functions are loaded into Flash for the Flash build configuration and this command copies the ramfuncs to RAM and then executes from RAM. 

    Second, check the RUN ADDR for the MCANIntr1ISR function in the map file. Next, whilst in the debug mode in CCS, check the disassembly view, and search for the function name in the search bar at the top to make sure that the run address has the interrupt ISR code.

    If you face any issues with accessing the above checks, please let us know.

    Thanks.

  • thanks for your relpy

    the first line in my code is a call to CM_init(); in which resides the code 

    I verified I am running from flash, as this project has been working for quite some time now.

    I looked at the map file and cam see the MCANInt1ISR resides right next to flash init that myst reside in ram.

    further more , I found these lines of code:

    in CM_init

    could they be related to the issue at hand ?

  • Inno, 

    I tried making that change to an existing example and it works properly.

    #pragma CODE_SECTION(MCANIntr1ISR, ".TI.ramfunc");
    //
    // This is Interrupt Service Routine for MCAN interrupt 1.
    //
    static void MCANIntr1ISR(void)
    {
        uint32_t intrStatus;

    Can you edit the example "mcan_ex1_loopback" as mentioned above and let us know if it works?

    Then we can take it from there.

    Thanks.

  • you are running the example from flash or RAM ?

  • I am running the example from Flash.