Skip to main content
Graduate
April 11, 2018
Solved

Bug in lib NFC ?

  • April 11, 2018
  • 1 reply
  • 684 views
Posted on April 11, 2018 at 17:33

Hello

In lib_iso15693pcd.c :  function ISO15693_WriteSingleBlock.

It seems that the return value of PCD_SendRecv is not handled. The function 

ISO15693_WriteSingleBlock

returns always success.

I can see many other places where the behaviour is similar.

Juilen

    This topic has been closed for replies.
    Best answer by Rene Lenerve
    Posted on April 20, 2018 at 10:35

    Hi Julien,

    Thanks for reporting this bug.

    The firmware checks the answer from the CR95HF/ST95HF with the wrong error code, for example :

    if (PCD_IsReaderResultCodeOk (SEND_RECEIVE,pResponse) == ISO15693_ERRORCODE_DEFAULT) return ISO15693_ERRORCODE_DEFAULT;�?�?�?

    It should be replaced by this code:

    if (PCD_IsReaderResultCodeOk (SEND_RECEIVE,pResponse) != PCD_SUCCESSCODE)
     return ISO15693_ERRORCODE_DEFAULT;�?�?

    This appears also in the lib_nfctype5pcd.c file.

    This will be fixed in a next release.

    Thank you again for your feedback.

    Best Regards.

    1 reply

    ST Employee
    April 20, 2018
    Posted on April 20, 2018 at 10:35

    Hi Julien,

    Thanks for reporting this bug.

    The firmware checks the answer from the CR95HF/ST95HF with the wrong error code, for example :

    if (PCD_IsReaderResultCodeOk (SEND_RECEIVE,pResponse) == ISO15693_ERRORCODE_DEFAULT) return ISO15693_ERRORCODE_DEFAULT;�?�?�?

    It should be replaced by this code:

    if (PCD_IsReaderResultCodeOk (SEND_RECEIVE,pResponse) != PCD_SUCCESSCODE)
     return ISO15693_ERRORCODE_DEFAULT;�?�?

    This appears also in the lib_nfctype5pcd.c file.

    This will be fixed in a next release.

    Thank you again for your feedback.

    Best Regards.

    JulienDAuthor
    Graduate
    April 20, 2018
    Posted on April 20, 2018 at 11:21

    Hi,

    Yes, but in some places, this code does not exist. It is commented out. For example line 517 in lib_iso_15693pcd.c  in CubeExpansion_NFC3_V1.2.0.

    That's more specifically what I am talking about.

    In two words, error code is not always checked and when it is, it is badly done. 

    :)

    regards

    Julien