cancel
Showing results for 
Search instead for 
Did you mean: 

X-NUCLEO-NFC06A1 doesn't read and write any tag, "NDEF NOT DETECTED" error

Wladimir
Associate II

Hello to all!

I have boards - NUCLEOL476RG and X-NUCLEO-NFC06A1 with project "STM32L476RG-Nucleo_PollingTagDetectNdef" running on it.

And got an error when trying to read any tag:

0693W000008xIJLQA2.pngWhen debugging program i found that error, its here in the code, doesn't match

apduParam->statusWord == RFAL_T4T_ISO7816_STATUS_COMPLETE

The walue of statusWord is 27266 instead of 36864 (0x9000)

0693W000008xILRQA2.jpgAppreciate for help and sorry for my english))

34 REPLIES 34

Hi,

this one seems to be a tag from Shanghai Feiju Microelectronics (Manufacturer 0x53). Not a real NTAG but claims to be compatible to NFC Forum T2T. The memory contents looks correct from first glimpse, should be detected as T2T. However I would need to perform some experiments and it can also be that the tag content may be correct but on the RF layer it does not comply (timings, etc.).

If you write e.g. an URI to it and present it to an Android phone without any app opened, does it then ask to open the web page?

Regards, Ulysses

Hi,

this tag looks like a Mifare Classic tag or a clone of it. This type of tag uses a proprietary and in the meantime broken crypto. It is not part of NFC Forum, however on some phones (typically with NXP NFC chipset) it is supported. I cannot recommend to use such tags.

If you look around in this community you will find further hints on it.

Regards, Ulysses

Hi,

I don't have this Pro version and cannot try. However this code of 6A82 means that the NDEF applet is not supported.

Similar to the T2T below I would try to use a second phone to read this emulated tag (Please make sure to de-activated Android Beam and if available on your mobile settings switch to Card Emulation mode only option)

Regards, Ulysses

Hi,

can you tell what Android app is able to data exchanging with X-NUCLEO-NFC06A1?

I actually need not tags (tags for practice, its useful:) ) but data exchange (read and write) between phone and ST NFC board. P2P mode - the best option for me)

I've tried "NDEF Tag emulator" android app and magic happens - "READ-ONLY NDEF detected." See picture below.

But read-only doesn't fit to me, i need read and write capabylities.

Here is the output:

Initialization succeeded..

1. Tap a tag to read its content

NFCA Passive ISO-DEP device found. UID: 080630C2

NDEF NOT DETECTED (ndefPollerNdefDetect returns 4)

Operation completed

Tag can be removed from the field

1. Tap a tag to read its content

NFCA Passive ISO-DEP device found. UID: 083B0C62

READ-ONLY NDEF detected.

NDEF Capability Container

 * CCLEN: 15 T4T_VNo: 20h MLe: 59 MLc: 52 FileId: e104h FileSize: 4095

 * readAccess: 00h writeAccess: ffh

 CC File Raw Data (length 15)

 [0000] 00 0F 20 00 3B 00 34 04 | . .  . ; . 4 . |

 [0008] 06 E1 04 0F FF 00 FF  | . . . . . . .  |

NDEF Len: 21, Offset=2

 NDEF Content (length 21)

 [0000] D1 01 11 54 02 65 6E 48 | . . . T . e n H |

 [0008] 65 6C 6C 6F 20 57 6F 72 | e l l o  W o r |

 [0010] 6C 64 21 21 20     | l d ! !     |

Decoding NDEF message

Record #1 - Short Record

 Text: "Hello World!! " (UTF8, language code "en")

 MB ME CF SR IL TNF

 1 1 0 1 0  1

 Type Name Format: NFC Forum well-known type [NFC RTD]

 Type: "T"

 Payload: (length 17)

 [0000] 02 65 6E 48 65 6C 6C 6F | . e n H e l l o |

 [0008] 20 57 6F 72 6C 64 21 21 |  W o r l d ! ! |

 [0010] 20           |         |

Operation completed

Tag can be removed from the field

1. Tap a tag to read its content

I will answer on your other questions later. appreciate for your help

Wladimir
Associate II

Another question - how can I use Emulate Card Mode​ on X-NUCLEO-NFC06A1 board?

Hi,

X-CUBE-NFC6 supports card emulation. However if you use a phone which does act as Reader/Writer and as card against another device which acts also in both roles it is somewhat random which one ends up in which mode. In X-CUBE-NFC6 you could remove all PCD/reader/writer modes from techs2find param. Or use the bluetooth pairing demo in STSW-ST25R-LIB. The demo is built to not require any app on the phone but rather rely on the built-in NFC forum support of Android.

For P2P: Its support is disappearing in recent phones. Iphone never adopted and recent Android phones are dropping it (e.g. Samsung Galaxy S20, S21, Pixel, etc. ).

Reading through your requests it does not look like that you are interested in NDEF itself. But rather you want a bi-directional communication with phones. If this is true then I would implement an own protocol based on smartcard/ISODEP. Create an Android app similar to above mentioned "NDEF Tag Emulator". Register it with your own Application ID in the system. Then on top of ISODEP you can exchange arbitrary APDUs (You may want to follow ISO7816 (-4ff ) style).

On X-NUCLEO-NFC06 I would use the polling for NFC-A and maybe NFC-B, use the example for reading T4T but instead reading NDEF, select your own application ID (defined above) and implement the counter part of your protocol.

An example which could help you on Android side is the SwipeYours app. Its source code is available and it implements VISA payment as example. But you should be able to easily exchange the payment part with your own stuff.

Best Regards, Ulysses

Wladimir
Associate II

Hello, Ulysses!

I set up Card Emulation mode on X-NUCLEO-NFC06A1 board by adding

#define ST25R3916

#define DEMO_CARD_EMULATION_ONLY true

in demo.h file.

Phone polling for NFC-A and NFC-F technologies both, so i commented

//case RFAL_NFC_POLL_TYPE_NFCA:

in demoCycle() function, so i have only NFC-F enabled in CE mode.

( Besides, when i commenting

//case RFAL_NFC_POLL_TYPE_NFCF:

i.e. setting up only NFC-A its not working, NFC Tools recognizing it as NFC-F and writing on "tag" (board) doesn't working. )

And what's happening in NFC-F mode. Its not working properly.

After board reset reading board as tag showing info in NFC Tools:

0693W000008xghHQAQ.jpgWhen i trying to write plain text ("hello!!") first time - there is success info message in NFC Tools. Second time (and subsequent) - i got fail info message.

After writing on "tag" 1st time, reading "tag" gives another results:

0693W000008xgkGQAQ.jpg 

So there is no message on the label that I wanted to record.

Looking in debug mode function demoCeT3TUpdate(), cmdData[13] - there is data lenght to read, its only = 1, but got to be more....

Best regards.

Wladimir
Associate II

Hello!

(Maybe should to start new topic about Card Emulation)

Here is interesting detail, when X-NUCLEO-NFC06A1 board starting after reset, ndefFile buffer is empty (observing via debug):

0693W000008xkfoQAA.jpgWhen reading a "tag" (board in CE mode) 1st time its initializing by default value:

0693W000008xkcaQAA.jpgMaybe its because CE mode initializing when reading "tag" happens.

Ok, whats happens next - i writing message on "tag", and its ok:

0693W000008xkkUQAQ.jpgAlthough we also see leftovers from the previous package.

But the problem is that this recorded message cannot be read, the reading ends with an error in NFC Tools app.

I also compared the content of the InformationBlock before and after writing a "tag", it does not change except for the size of the payload and NDEF mapping version (don't know what it is).

Perhaps this problem, when it is not possible to read the NFC tag, that is, the useful information written to it, is similar to the one when it is not possible to read the information from the NFC-A tag. But with the NFC-A tag, the information cannot be read immediately after the board is started.

Hi VIVAN.1,

I have reproduced your symptoms and I fear that there are bugs in the implementation for writing to the emulated T3T/T4T storage.

As this code is regarded as demo/application code we seem to have only performed limited testing. The write support was implemented, maybe tested in a limited scenario, but not the way you are using now. I have triggered an internal ticket for investigating/fixing.

Are you actually considering the T3T emulation for your application or are you merely exploring the options?

Regards, Ulysses