2017-01-12 12:44 AM
Hello,
we are currently working on a LIN-Slave Driver for the SPC560D40L1. The use of the hardware-id-filter have made it easy so far but now we fail in one last test where we must distinguish whether the framing error has occurred in the header or in the response.
Is there a way to distinguish these two events in the framing error interrupt with id-filtering activated?
Thank you in advance!
Best regards
Torben
#lin #spc560d #framing-error #linflex2017-01-19 12:28 AM
Erwan Y schrieb:
FEF is the flag relative to Framing Error.
SFEF or BDEF or IDPEF bit is the flag relative to Header Error.
Hello Erwan,
that's right but the SFEF, BDEF or IDPEF are not set when only a framing error occurred in the Header.
What we have done is following:
First we activated all of these above mentioned Interrupts and used our Vector tool to sent a frame with a framing error in the Identifier Field, which is in the Header:
This raised an error Interrupt and the framing error flag was set. But no other flag. According to LIN 2.1 spec we must ignore this error.
In a second step we sent a frame with a framing error in the first data field. The SPC showed exactly the same behaviour. But according to Lin 2.1 spec we must set the response error bit.
Our tests showed that the SFEF, BDEF or IDPEF Flags are set when there are bit errors in one of the header fields but this is not what we need for this particular case.
The only opotunity we see, would be not to use the hardware-lin-id-filter, handle the id Interrupt without activated framing error and activate it afterwards. If possible, we would like to avoid this, because of higher Interrupt load and more complexity in the code.
Best Regards
Torben
2017-01-24 06:15 AM
Hello Auhagen ,
you need to check that in the register
LINESR :
if SFEF, SDEF, IDPEF, the error is the header.
if BEF or NF, the error is in the answer of the slave.
if OCF,CEF,FEF or NF, the error is in the answer of the master.
if BOF, means that you have not read the answer master before that the next answer is coming
Best regards
Erwan