Hello,
We are using MPC5747C controller for Gateway ECU.
For our testing purpose we want to capture error frames received or generated by FlexCAN modules.
And also we want to log the Message ID for which error frames are received/generated.
But in ECC register we did not get Message ID field.
Could you please let us know where can we get the Message ID for which error frames are received/generated?
Please reply asap. Its urgent.
Best Regards,
Niraj Gulave,
RBEI/EAP4, Robert Bosch Engineering and Business Solutions Private Limited,
Elnath (B Wing), 2nd Floor, Prestige Tech Park, Outer Ring Road, Kadubisanahalli,
Marathahalli, Bengaluru, Karnataka - 560 037
Tel: +91-80-6738-1520
Hi,
This is not possible on FlexCAN module. The Error frames cannot be captured. There is only ESR register to indicate type of error detected and a ECR register where TX/RX error counters increases or decreases according to protocol states and rules.
If during message receiving an error is detected the message is not stored in. For the message being transmitted, in case of error, the CODE field stays the same, so you can indicate the “source” MB, if you do not have more MBs prepared for transmitting.
BR, Petr
Hi,
Thanks for the quick reply.
As you said “The Error frames cannot be captured.” But interrupt is generated for error frames, right?
So in ISR we can read ESR and ECR registers and do further processing.
Is our understanding correct?
And to Log Message ID, our understanding as per your mail is-
1. It is not possible if message is being received
2. For being transmitted message, once CODE is set to DATA and error frame interrupt is generated for TX Error then we can consider that ID as not transmitted.
Is our understanding correct?
Best Regards,
Niraj Gulave,
RBEI/EAP4, Robert Bosch Engineering and Business Solutions Private Limited,
Elnath (B Wing), 2nd Floor, Prestige Tech Park, Outer Ring Road, Kadubisanahalli,
Marathahalli, Bengaluru, Karnataka - 560 037
Tel: +91-80-6738-1520
Yes, in general the error frame is transmitted whenever error is detected. So if the Error Interrupt Mask (CTRL1[ERRMSK]) bit is enabled then once the ESR1[ERRINT] flag is set the interrupt request is generated. Within an interrupt you should read the ESR1 register to to capture all error condition and status bits. The read action clears the respective bits that were set since the last read access.
For the ID loging you are right. It is not possible if message is being received. For the TX message, once CODE is set to DATA it will change to INACTIVE after successful transmission (also corresponding BUFxI flag is set in IFLAGx register). If the error is detected during transmission the CODE stays set to DATA so the message can be send again automatically on first opportunity window on the bus.
BR, Petr