Hello,
I'm using i.MX6DL processor with QNX RTOS. I've develop the Flexcan driver by myself. Everything seems to work correctly but I'm experiencing some performance problem.
In my system, I have to send each 5ms a CAN frame. The frame has the corresponding IMASK set to generate an interruption when transmission is done.
Most of the time, this transmission sequence is working well :
1. Application send data to driver
2. Driver checks if respective interruption bit is set and clear it
3. Driver checks if MB is Inactive
4. Driver writes id,data,dlc,CS word
5. MB is activated, CAN frame is transmitted
6. Interruption 0x8E (IRQ 142 - FLEXCAN1) is fired, driver catch it and handle it
7. Driver answers to application to say it's OK you can continue, frame is sent.
This transmission sequence is during around 200-300 microseconds. But randomly like 5 minutes after starting the application, it's taking 4-5ms...
After a lot of verification, it seems that the interruption is fired with a 4ms delay instead of 200us and I don't understand why ? Am I missing something here ? Is there a mecanism to add in order to protect the MB, for example check ESR1[TX] register to be sure transmission is finished ?
The question is why the interruption delay since activation of MB is taking randomly milliseconds instead of microseconds ?
If you have ideas, it will be a great help for me.
Thank you.