cancel
Showing results for 
Search instead for 
Did you mean: 

Write NDEF with CR95HF

Mickaël Bucher
Associate II

Hello,

I downloaded STM32CubeExpansion_NFC3_V1.4.0.

I use the example projectCR95HF_TagDetect with the board X-NUCLEO-NFC03A1 and the board NUCLEO-F103RB.

I use smartphone Sony Xperia L1 (TT4B) an Samsung Galaxy S7 (TT4A).

I want test the function NDEF_WriteURI(&url);

the sub-function ISO7816_SendReceiveAPDU don't return the right argument.

I have always the same result .

APDUresponse.SW1 = 0x6A and APDUresponse.SW2= 0x82 instead of APDUresponse.SW1 = 0x90 and APDUresponse.SW2= 0x00.

Is this mistak cause by the smartphones or by the CR95HF or by software ?

Can you help me to solve this mistak ?

Best regards

1 ACCEPTED SOLUTION

Accepted Solutions

​Hi Mickaël,

from Datasheet point of view,

  • CR95HF supports reader mode over UART or SPI interfaces
  • ST95HF supports reader mode and Card Emulation mode over SPI only
  • ST25R95 supports reader mode and Card Emulation mode over SPI only

Card Emulation mode cannot be used over UART due to transmission latencies not compatible with Frame Response Time. This is why CR95HF Datasheet does not support the Card Emulation mode.

As the X-NUCLEO-NFC03A1 is also the expansion board for the ST25R95, feel free to use Card Emulation mode over SPI.

Regarding Android phones behavior:

  • the phones has a loop where it seen as a active P2P device and then seen as a passive tag. Depending on the timing, it may be seen as NFCB tag not supporting NDEF application
  • if I am not wrong, when unlocking the screen of the phone, it restarts its loop and you will have a chance to see it as an Active P2P device.

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

9 REPLIES 9
Brian TIDAL
ST Employee

Hi Mickaël,

Write_URI is an API for writing a URI in a tag supporting the NDEF application.

As per NFC Forum Type 4 Tag Technical Specification Version 1.0 § 7.2.1 symbol 1, a Select NDEF Tag Application APDU is sent. Here, the reply from the smartphone is 6Ah 82h "NDEF Tag Application not found" which means that the NDEF application is not supported by the smartphone. Usually, smartphones emulates NFCA or NFCB tags for payment applications, not for the NDEF application.

If you want to use Write_URI, you have to use Type 4 tags such ST25TA.

If you want to send an URI to a smartphone, you have to use the Simple NDEF Exchange Protocol (SNEP) which is not available in  STM32CubeExpansion_NFC3_V1.4.0

Feel free to give more information about your application, in particular why you need to send an URI to a smart phone.

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.
Mickaël Bucher
Associate II

Hi Brian,

For my application, I want :

  • read differents type of Tags and simulate tag with smartphone
  • send NDEF message to NFC smartphones ( NDEF text or NDEF URI).

Have you example of SNEP with CR95HF ?

Must I use ST25R95 for emulate a tag with NDEF message ?

If not possible, can i couple a M24lR04 to CR95HF antenna to make this functions ?

I try P2P mode (NDEF message) with X-nucleo-NFC05A1

Sony Xperia L1 works but not Samsung S7.

Rgds

Mickaël

Hi Brian,

For my application, I want :

  • read differents type of Tags and simulate tag with smartphone
  • send NDEF message to NFC smartphones ( NDEF text or NDEF URI).

Have you example of SNEP with CR95HF ?

Must I use ST25R95 for emulate a tag with NDEF message ?

If not possible, can i couple a M24lR04 to CR95HF antenna to make this functions ?

I try P2P mode (NDEF message) with X-nucleo-NFC05A1

Sony Xperia L1 works but not Samsung S7.

Rgds

Mickaël

Brian TIDAL
ST Employee

Hi Mickaël,

CR95HF does not support Active P2P mode so P2P can only be used with smartphone seen as Passive P2P device:

  • for NFCA devices, SAK / SEL_RES shall indicate support of NFC-DEP
  • for NFCF device, the NFCID2 in SENSF_RES shall indicate support of NFC-DEP

I guess Samsung S7 is seen as a NFCB device so P2P fails.

I do not have SNEP examples for X-CUBE-NFC3 V1.4.0. An SNEP example (with hardcoded values) is available in X-CUBE-NFC3 2.0.0 based on ST RF Abstraction Layer (RFAL), basically the same example as the one in X-CUBE-NFC5.

I will dig into more details tomorrow.

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.
Brian TIDAL
ST Employee

Hi Mickaël,

Basically:

  • CR95HF can read A, B, F, V tags or smartphones emulating such.
  • CR95HF can write NDEF to T1, T2, T3, T4 and T5 tags when tag is properly formatted to support NDEF
  • CR95HF can send NDEF messages to smartphone seen as Passive Device
  • CR95HF can emulate a T4AT tag that a smartphone can read

Hope this clarifies the various cases.

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.
Mickaël Bucher
Associate II

Hi Brian,

  • CR95HF can send NDEF messages to smartphone seen as Passive Device
    • Have you an example software ?
  • CR95HF can emulate a T4AT tag that a smartphone can read
    • for emulate a tag, I must use ST25R95 instead of CR95HF ?
    • Can I emulate a Tag with NDEF message ?
    • Have you an example software ?

Rgds

Mickaël

Brian TIDAL
ST Employee

Hi Mickaël,

  • CR95HF can send NDEF messages to smartphone seen as Passive Device
    • Have you an example software ? ==> When a device indicates the support NFC-DEP, you can reuse and adapt the demoSendNdefUri() from X-CUBE_NFC5
  • CR95HF can emulate a T4AT tag that a smartphone can read
    • for emulate a tag, I must use ST25R95 instead of CR95HF ? ==> ST25R95 is the new name of CR95HF/ST95HF. You can use the CR95HF
    • Can I emulate a Tag with NDEF message ? Yes
    • Have you an example software ? ==> STSW-ST95HF001 contains some card emulation code for ST95HF

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.
Mickaël Bucher
Associate II

Hi Brian,

I read the datasheet of CR95HF,ST25R95 and ST95HF.

For me, the CR95HF not allows to emulate a card or a tag.

If I use demoSendNdefUri() from X-Cube_NFC5, I use P2P mode and this function is not recognize by Samsung S7 for example.

If I use the EVAL-ST95HF_FW_V3.7.0, I emulate a card or a tag with NDEF message.

If I understand in this mode (emulate card), all NFC smartphones read NDEF without P2P mode.

Rgds.

Mickaël

​Hi Mickaël,

from Datasheet point of view,

  • CR95HF supports reader mode over UART or SPI interfaces
  • ST95HF supports reader mode and Card Emulation mode over SPI only
  • ST25R95 supports reader mode and Card Emulation mode over SPI only

Card Emulation mode cannot be used over UART due to transmission latencies not compatible with Frame Response Time. This is why CR95HF Datasheet does not support the Card Emulation mode.

As the X-NUCLEO-NFC03A1 is also the expansion board for the ST25R95, feel free to use Card Emulation mode over SPI.

Regarding Android phones behavior:

  • the phones has a loop where it seen as a active P2P device and then seen as a passive tag. Depending on the timing, it may be seen as NFCB tag not supporting NDEF application
  • if I am not wrong, when unlocking the screen of the phone, it restarts its loop and you will have a chance to see it as an Active P2P device.

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.