Hello,
I'm handling interrupts generated by FlexRay controller at the start of a FR frame. My handler is set as FIQ. The problem is that for some reason every third FR cycle the interrupt is not generated. Sometimes it leaves out even more often. I have no other interrupts set as FIQ, so it should always have a top priority. I have checked that all the frames in all the cycles are succesfully trasmitted on the bus. Here is a sample of my code:
The FR interrupt handler is in one .c file:
#pragma INTERRUPT(FR_interrupt, FIQ)void FR_interrupt(void){ clear_status_interrupt_register(); FR_rcv_flg = 1U;}
The ISR is in another:
while (running) { lwipPeriodicHandle(s_timestamp); if (FR_rcv_flg) { FR_to_udp(); } if (eth_rcv_flg) { decode_udp_runtime(); } }
I know for a fact that every interrupt which is generated is also serviced in "FR_to_udp()" so the problem lies in the interrupt not being generated at all. Does anyone have an idea what might be causing this?
Best regards
Martin
Hello Martin:
In order to try and help you get a quick resolution to your issue with the FlexRay interrupts, I am forwarding your post to our FlexRay expert. He should respond shortly.
Regards,
Chuck Davenport
Thanks and Regards,
If this response answers your question, please indicate it by verifying the suggested answer when provided.
Hello Peter,
thanks for your suggestions, however I'm not using the start of cycle interrupt but the received frame interrupt. The function clear_status_interrupt_register() indeed does nothing else but clear the whole SIR like this:
void clear_status_interrupt_register(void){ frayREG->SIR_UN.SIR_UL = 0xFFFFFFFF;}
Clearing right in the interrupt handler is a good idea, thanks for the suggestion, but it didn't prove to be the cause. After doing some testing I can rule out that FR_to_udp() not entered. Every time an interrupt is generated it is also serviced in FR_to_udp(). The FR_rcv_flg gets reset the first thing in the FR_to_UDP().
I'm starting to think that the problem might have to do with some of the FR controller parameters. I have 2 nodes with freescale controllers whose parameters are known to me, so I set my tms570ls3137 E-ray controller according to those parameters. I presumed that the parameters are flawless, which they might be, I'm just not certain. The only thing that comes to my mind right now is that the rate correction is applied in every third cycle. That might have something to do with it...
Hello Martin,
As of your last posting, it seems you were still having some issues with your FlexRay setup. Were you able to resolve your issue? If so, it might be helpful if you could post your final resolution or simply that it was resolved. If you still need additional help on this topic, please let us know.