cancel
Showing results for 
Search instead for 
Did you mean: 

ST25R3916 - Card Emulation

pagano.paganino
Associate III

Hi all,

how can i send in card emulation mode extended apdu? it's possible?

1 ACCEPTED SOLUTION

Accepted Solutions
Brian TIDAL
ST Employee

Hi,

(ctx).txBufLen = (uint16_t)rfalConvBytesToBits(tBL);

==> 2032 bits = 254 bytes (256 - 2 bytes for CRC)

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

10 REPLIES 10
Brian TIDAL
ST Employee

Hi,

X-CUBE-NFC6 provides support and sample code for Card Emulation mode. See demoTransceiveBlocking() in demoCE() for an example of APDU sending.

Can you elaborate on what you exactly mean by extended APDU? Do you mean extended field coding for Lc and Le fields?

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
pagano.paganino
Associate III

Hi Brian,

to give you some more context ... i am trying to implement fido2 nfc.

This is a trace of mi actual software ...

I receive a err: 37 from mp_st25r3916_transceive_blocking (this is exactly the same as demoTransceiveBlocking() in demoCE())

Some hints?

Thanks,

D.

Brian TIDAL
ST Employee

Hi,

err 37 means ERR_LINK_LOSS. I believe this is caused by the big 965 bytes frame (i.e. reader not being able to receive such a big frame). Can you check the FSD value sent by the reader in the RATS (this should be available in the rfalNfcDevice device structure in proto.isodep.info.FSx)

Do you have traces from the reader side? is the reader able to properly receive the 965 bytes frame or do you see an error code?

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi,

FSx: 256

the reader is an iPhone se 2020 iOS 13.6.1, application is safari with site: https://webauthn.io

Some hints?

Thanks,

D.

Brian TIDAL
ST Employee

Hi,

As the FSD=256, the RFAL lib will fragment the big 965 bytes frame in 4 chained smaller frames and the reader is supposed to de-fragment those 4 chained frame into a complete APDU. Is the reader working properly with a reference device? i.e. is the reader able to perform Fido authentication with an existing device? Do you have any trace on reader side? Is the content of the big frame correct (i.e. if some values are incorrect, the reader may be instructed to switch off the RF field ?

can you provide a SPI trace on ST253916 side? (MISO/MOSI/CS/IRQ_OUT)

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
pagano.paganino
Associate III

Hi,

the RFAL lib will fragment the big 965 bytes? how I can check this?

The reader work properly with a YubiKey (a reference device) as I can see a success registration/authentication.

I haven't any trace on reader side.

Thanks,

D.

Brian TIDAL
ST Employee

Hi,

the fragmentation can be checked in different ways:

  1. use a RF spy (MP007, proxySPY, etc.)
  2. use a logic analyzer to spy the SPI commands on ST25R3916 (SPI +IRQ)
  3. put some trace in rfalStartTransceive to print the txBufLen

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
pagano.paganino
Associate III

Hi,

rfalStartTransceive: 2032, what this mean? I have some configuration parameter wrong?

Thanks, 

D.

Brian TIDAL
ST Employee

Hi,

(ctx).txBufLen = (uint16_t)rfalConvBytesToBits(tBL);

==> 2032 bits = 254 bytes (256 - 2 bytes for CRC)

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.