cancel
Showing results for 
Search instead for 
Did you mean: 

How to read/write block of NFC-A card using STM32CubeExpansion_NFC5_V1.3.0 Library?

RP
Associate II

0690X000006D8gbQAC.bmpWe are trying to evaluate ST25R3911B for our application. I have installed STM32CubeExpansion_NFC5_V1.3.0 Library. I tried an example code for STM32L476RG-Nucleo from this library (\STM32CubeExpansion_NFC5_V1.3.0\Projects\Multi\Applications\Polling\SW4STM32\STM32L476RG-Nucleo\STM32L4xx-Nucleo-Polling). I can see the tag type & ID on serial terminal as shown in image.

Now I am trying to read & write the memory block of tag. But unable to find the API sequence necessary to perform read/write. can anyone please suggest?

1 ACCEPTED SOLUTION

Accepted Solutions
Ulysses HERNIOSUS
ST Employee

Please use all the rfal files from ST25R3911B_DISCO_FW_v1_2_8 package to have a consistent package.

View solution in original post

8 REPLIES 8
Ulysses HERNIOSUS
ST Employee

Hi RP,

how to read and write the an NFC-A card heavily depends on its subtype: e.g NFC Forum ***, T2T, T4T and a plethora of related and proprietary cards.

Please provide information on which exact type of card you are trying to read/write.

Regards, Ulysses

RP
Associate II
Hi Ulysses,
Thanks for your reply.
I tried to debug the example code to get the type of the RFID tag which I have,the value of variable nfcaDevList[devIt].type I got isRFAL_NFCA_T2T. To read the tag,can I use function demoSendAPDUs() in
demo.c file included in STM32CubeExpansion_NFC5_V1.3.0Library. But in
that file, the function demoSendAPDUs is used only for RFAL_NFCA_T4T.Any
idea how to read RFAL_NFCA_T2T type tag?
Thanks & Regards,
Radhika.
On 28-01-2019 08:44 PM, ST Community wrote:
Ulysses HERNIOSUS
ST Employee

​Hi Radhika,

APDU is a term of smartcards - used by T4T only. You may want to have a look at STSW-ST25R002 which has an updated RFAL with the source code file rfal_t2t.c.

Regards, Ulysses

Hi,

I have downloaded STSW-ST25R002 package. And included rfal_t2t.c & .h files in my project. The project gets build successfully. But when I debug it, it doesn't detect RFID Tag,the function rfalNfcaPollerTechnologyDetection( RFAL_COMPLIANCE_MODE_NFC, &sensRes ); returns error code 33 (ERR_WRONG_STATE). What is missing in initialization? Attaching main.c file for your reference.

I am not getting where the exact problem is.

Ulysses HERNIOSUS
ST Employee

Hi Radhika,

not seeing much in the main(). My guess would be that you lack either a rfalSetMode() or a rfalFieldOnAndStartGT() .

Did you only move over the rfal_t2t files? If so please use all the rfal files to have a consistent package.

Regards, Ulysses

Hi Ulysses,
I have included the files shown in image.
On 12-02-2019 06:31 PM, ST Community wrote:
RP
Associate II

I used all the files from STM32CubeExpansion_NFC5_V1.3.0 package. Only rfal_t2t files from ST25R3911B_DISCO_FW_v1_2_8 package.

Ulysses HERNIOSUS
ST Employee

Please use all the rfal files from ST25R3911B_DISCO_FW_v1_2_8 package to have a consistent package.