1
votes

I'm using X-NUCLEO-NFC05A1 with STM32 NUCLEO-F401RE board to read an NFC-A (ISO14443A) tag. I couldn't find any function for reading the tag. Can anyone help me?

I tried the sample given by ST, I could find write function from there. But I couldn't find any reading function from there.

1
Maybe you need to write one yourself?0___________

1 Answers

0
votes

You can simply use rfalTransceiveBlockingTxRx() from rfal_rf.h provided by the RFAL library. That transceive mechanism applies to all RF technologies.

Since there is no generic commandset for interacting with NFC-A tags, the exact coding of the READ command will depend on your specific tag type. For instance, for a Type 2 tag, the READ command would consist of two bytes: 0x30 <BLOCK-ADDRESS-AS-SINGLE-BYTE>

For such a tag, you could, for instance, use something like this:

uint8_t bufferTx[2];
uint16_t lenTx;
uint8_t bufferRx[16];
uint16_t lenRxMax, lenRx;
ReturnCode status;

lenTx = 0;
bufferTx[lenTx++] = 0x30;
bufferTx[lenTx++] = 0;  // TODO: change this to the read offset

lenRxMax = 16;
lenRx = 0;
status = rfalTransceiveBlockingTxRx(&bufferTx[0], lenTx, &bufferRx[0], lenRxMax, &lenRx, RFAL_TXRX_FLAGS_DEFAULT, rfalConvMsTo1fc(5));

// if status does not indicate error,
// you will now find the response in bufferRx,
// the actual response length is lenRx