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.

interrupts

Other Parts Discussed in Thread: TMS570LS20216, HALCOGEN

Hi,

I am trying to trigger flexray interrupts and I'm having problems. In the attached project I have modified the code from the 5 node CCSv5 example to add flexray interrupts, I have also added real time interrupts from a halcogen generated project as a test from something I know works. I have compared the sys_startup and can't see anything I have missed. Currently both the interrupts trigger once and then the controller crashes, going to either _undefined or _prefetchAbort system interrupts; I tried this with only one, or the other, or both of the interrupt sources (RTI/Flexray) enabled in vimREG->REQMASKSET within the startup code, to the same effect. There must be something I am missing to cause this to happen, as the RTI code works fine in the other project, but I can't find what. The hardware I am using is the TMS570LS20216 MDK. Without the interrupts, and line 75 in sys_main uncommented, the flexray code works perfectly.

Project:

4670.Antares_FlexRay_CCSv5_example_code_nodeA.zip

Flexray settings header file linked from another project

0410.Flexray_Settings.h

Paul

  • Hi Paul,

          We have got your problem. We will look into this and get back to you soon. Thanks for your support. 

    Best Regards,
    Shelford

  • Hi Paul,

    the problem ending up in _undefined or _prefetchAbort is, that you use a library which supports the device floating-point (FPU), but your code does not enable the FPU. At the beginning of an interrupt routine a write to the FPU happens, which causes the _undefined or _prefetchAbort, if the FPU is disabled The easiest way to fix the issue is to enable the FPU by calling the following function at the beginning of _c_int00() in sys_startup.. 

    ;-------------------------------------------------------------------------------

    ; Enable VFP Unit

    .def _coreEnableVfp_

    .asmfunc

    _coreEnableVfp_

    mrc p15, #0x00, r0, c1, c0, #0x02

    orr r0, r0, #0xF00000

    mcr p15, #0x00, r0, c1, c0, #0x02

    mov r0, #0x40000000

    fmxr fpexc, r0

    bx lr

    .endasmfunc

    ;-------------------------------------------------------------------------------

    Further-on, when looking to the interrupt setup for the FlexRay interrupts in FRay.c, I have one concern:

    it looks as if all Status Interrupts are mapped to CC_int0, but CC_int1 gets enabled at the last line of the interrupt initialization.

    // Initialize Interrupts

    Fray_PST-> EIR_UN.EIR_UL = 0xFFFFFFFF; // Clear Error Int.

    Fray_PST-> SIR_UN.SIR_UL = 0xFFFFFFFF; // Clear Status Int.

    Fray_PST-> SILS_UN.SILS_UL = 0x00000000; // all Status Int. to eray_int0

    Fray_PST-> SIER_UN.SIER_UL = 0xFFFFFFFF; // Disable all Status Int.

    Fray_PST-> SIES_UN.SIES_UL = 0x00000004 | 0x00008000; // Enable CYCSE Int. and SDS Int.

    Fray_PST-> ILE_UN.ILE_UL = 0x00000002; // enable eray_int1It

     

    Best Regards,

    Peter

  • Thanks that has fixed the problem and everything is now functioning as expected.