cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in lib NFC ?

JulienD
Senior
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

1 ACCEPTED SOLUTION

Accepted Solutions
Rene Lenerve
ST Employee
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.

View solution in original post

2 REPLIES 2
Rene Lenerve
ST Employee
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.

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