Skip to main content
torben
Associate
January 12, 2017
Question

Distinguish occurrence of framing error in LINflex Module

  • January 12, 2017
  • 4 replies
  • 2532 views
Posted on January 12, 2017 at 09:44

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 #linflex
    This topic has been closed for replies.

    4 replies

    Erwan YVIN
    ST Employee
    January 12, 2017
    Posted on January 12, 2017 at 11:19

    Hello Torben,

    Yes you can.

    in the chapter 20 from the RM0045

    you should enable the corresponding interrupt0690X00000605O0QAI.png

       Best regards

                         Erwan

    torben
    torbenAuthor
    Associate
    January 12, 2017
    Posted on January 12, 2017 at 11:46

    Hello Erwan,

    thanks for the quick response.

    We have noticed the header error enable flag as well but we can't find the corresponding flag, like mentioned here:

    0690X000006062HQAQ.png

    Best Regards

    Torben

    Erwan YVIN
    ST Employee
    January 12, 2017
    Posted on January 12, 2017 at 16:13

    Hello Torben ,

    the RM is not clear.

    maybe , the Header error Interrupt is triggered in IDPEF Flag for SPC560Dxx Family

    0690X00000605xTQAQ.png

    Could you try this ?

        Best Regards

                         Erwan

    Erwan YVIN
    ST Employee
    January 17, 2017
    Posted on January 17, 2017 at 09:41

    Hello Torben ,

    Did you check in your Interruption handler the associated flag ?

    Anyway , i am checking with experts.

          Best Regards

                Erwan

    torben
    torbenAuthor
    Associate
    January 17, 2017
    Posted on January 17, 2017 at 10:37

    Hello Erwan,

    yes, we checked it.

    It seems like the IDPEF flag, for example,  is only for parity errors and is not related to a framing errror.

    Parity errors must be handled differently according to the LIN spec.

    Best Regards,

    Torben

    Erwan YVIN
    ST Employee
    January 18, 2017
    Posted on January 18, 2017 at 16:43

    According to the RM ,

    FEF is the flag relative to Framing Error.

    SFEF or BDEF or IDPEF bit is the flag relative to Header Error.

    Did you check the others flags ?

       BR 

                     Erwan

    torben
    torbenAuthor
    Associate
    January 19, 2017
    Posted on January 19, 2017 at 08:28

    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

    Erwan YVIN
    ST Employee
    January 24, 2017
    Posted on January 24, 2017 at 15:15

    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