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))

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

34 REPLIES 34
Ulysses HERNIOSUS
ST Employee

Hi VIVAN.1,

NDEF can only be read/written from NFC Forum formatted tags. Not all tags are capable of that. Above indicates you are using NFC-A tags supporting ISODEP/ISO7816 APDUs.

The value 27266=0x6A82 indicates that this tag does not answer success (0x9000) to the command. I think 0x6A82 means "not supported. I assume this to be the response to the "Select NDEF application" command. NFC-A smartcards are available for a plethora of applications, e.g. NFC Forum T4T, EMVCo, Passport, .....

If you use tags like ST25TA which implement T4T it will report success.

Best Regards, Ulysses

Wladimir
Associate II

Thank you for answer.

NDEF is NFC supported data format for exchange ​and isn't all NFC devices have to support NDEF format ?

NFC-A tag isn't NFC Forum tag?

Those messages you see on the picture I got using 2 types of tags: NFС 1К s50 F08///716 Вytеs and ntаg213/137 Bytеs.

But I also used smartphone and app NFC Tools Pro​ and there was again NDEF NOT DETECTED message.

Ulysses HERNIOSUS
ST Employee

Hi,

yes: not all NFC devices support NDEF format. Even if maybe some of the devices you are using actually support NDEF it may still be needed to format them for it. For formatting you need to consult with the manufacturer.

Regards, Ulysses

Wladimir
Associate II

NTAG213 have factory supporting NDEF .

See NXP​ site

I have successfully r​eading and writing these tags using smartphone (NFC Tools app).

But problem is that X-NUCLEO-NFC06A1 board can't read or write these tags, and so my phone in card emulating mode (using NFC Tool app). ​

Ulysses HERNIOSUS
ST Employee

Hi VIVAN.1,

One difference may be that the X-CUBE-NFCx demos are not swiss army knives with built-in knowledge for various available tags. They can read and write pre-formatted NFC Forum tags T2T, T3T, T4T and T5T. They can also format ST25(T/D)V tags as T5T.

The NFC Tools app seems to be more of debugging tool with main support of NXP tags, e.g. not reading an SRTAG64K and not able to format ST25TV.

You mentioned the NFC Tools app to be able to do card emulation. Didn't find this feature. Can you give me some guidance. Is this only available in Pro version?

If an NTAG is formatted - has a correct CC (Capability container) then also our demos should be a able to read/write NDEF onto those tags. If this is not the case then please share it memory content (E.g. NFC Tools: Other -> Read memory).

If a tag is properly formatted as NFC Forum tag then no app is needed to read it - Android will do it. In this case I expect also our X-CUBE-NFCx to read it.

Best Regards, Ulysses

Wladimir
Associate II

Hello Ulysses!

I've tried to format (whatever it means in that case) my tags (NFС 1К s50 F08///716 Вytеs and ntаg213/137 Bytеs) by NFC Tools app but its failed, it doesn't support this tags.

Yes, card emulation is available in Pro version, its in the WRITE menu --> ADDITIONAL OPTIONS.

I also tried project named "STM32L476RG-Nucleo_PollingTagDetect" (without "Ndef" in the end). And have output:

0693W000008xOVcQAM.png 

ISO-DEP its my phone.

OK Data: 6A82 it means that "Select NDEF Application" command failed (result must be 0x9000). See the code:

0693W000008xOXiQAM.png 

Wladimir
Associate II

I copied content of my clean tag.

0693W000008xOg6QAE.jpgmemory content is:

[ 53:99:92:D0 ] Сектор 00 : DATA

[ 34:01:D7:C0 ] Сектор 01 : DATA

[ 22:48:00:00 ] Сектор 02 : DATA

[ E1:10:12:00 ] Сектор 03 : DATA

[ 01:03:A0:0C ] Сектор 04 : DATA

[ 34:03:00:FE ] Сектор 05 : DATA

[ 00:00:00:00 ] Сектор 06 : DATA

[ 00:00:00:00 ] Сектор 07 : DATA

[ 00:00:00:00 ] Сектор 08 : DATA

[ 00:00:00:00 ] Сектор 09 : DATA

[ 00:00:00:00 ] Сектор 0A : DATA

[ 00:00:00:00 ] Сектор 0B : DATA

[ 00:00:00:00 ] Сектор 0C : DATA

[ 00:00:00:00 ] Сектор 0D : DATA

[ 00:00:00:00 ] Сектор 0E : DATA

[ 00:00:00:00 ] Сектор 0F : DATA

[ 00:00:00:00 ] Сектор 10 : DATA

[ 00:00:00:00 ] Сектор 11 : DATA

[ 00:00:00:00 ] Сектор 12 : DATA

[ 00:00:00:00 ] Сектор 13 : DATA

[ 00:00:00:00 ] Сектор 14 : DATA

[ 00:00:00:00 ] Сектор 15 : DATA

[ 00:00:00:00 ] Сектор 16 : DATA

[ 00:00:00:00 ] Сектор 17 : DATA

[ 00:00:00:00 ] Сектор 18 : DATA

[ 00:00:00:00 ] Сектор 19 : DATA

[ 00:00:00:00 ] Сектор 1A : DATA

[ 00:00:00:00 ] Сектор 1B : DATA

[ 00:00:00:00 ] Сектор 1C : DATA

[ 00:00:00:00 ] Сектор 1D : DATA

[ 00:00:00:00 ] Сектор 1E : DATA

[ 00:00:00:00 ] Сектор 1F : DATA

[ 00:00:00:00 ] Сектор 20 : DATA

[ 00:00:00:00 ] Сектор 21 : DATA

[ 00:00:00:00 ] Сектор 22 : DATA

[ 00:00:00:00 ] Сектор 23 : DATA

[ 00:00:00:00 ] Сектор 24 : DATA

[ 00:00:00:00 ] Сектор 25 : DATA

[ 00:00:00:00 ] Сектор 26 : DATA

[ 00:00:00:00 ] Сектор 27 : DATA

[ 00:00:00:BD ] Сектор 28 : DATA

[ 04:00:00:FF ] Сектор 29 : DATA

[ 00:05:00:00 ] Сектор 2A : DATA

[ 00:00:00:00 ] Сектор 2B : DATA

[ 00:00:00:00 ] Сектор 2C : DATA

Wladimir
Associate II

sorry, don't know how to hide in a spoiler here...

Wladimir
Associate II

and another tag

0693W000008xOilQAE.jpg[ 36:80:2A:30:AC:08:04:00:02:97:10:99:8C:B4:C7:1D ] Сектор 00 : UID0-UID3 / MANUFACTURER

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 01 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 02 : DATA

[ 00:00:00:00:00:00:FF:07:80:69:FF:FF:FF:FF:FF:FF ] Сектор 03 : KEYA / ACCESS / KEYB

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 04 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 05 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 06 : DATA

[ 00:00:00:00:00:00:FF:07:80:69:FF:FF:FF:FF:FF:FF ] Сектор 07 : KEYA / ACCESS / KEYB

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 08 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 09 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 0A : DATA

[ 00:00:00:00:00:00:FF:07:80:69:FF:FF:FF:FF:FF:FF ] Сектор 0B : KEYA / ACCESS / KEYB

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 0C : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 0D : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 0E : DATA

[ 00:00:00:00:00:00:FF:07:80:69:FF:FF:FF:FF:FF:FF ] Сектор 0F : KEYA / ACCESS / KEYB

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 10 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 11 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 12 : DATA

[ 00:00:00:00:00:00:FF:07:80:69:FF:FF:FF:FF:FF:FF ] Сектор 13 : KEYA / ACCESS / KEYB

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 14 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 15 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 16 : DATA

[ 00:00:00:00:00:00:FF:07:80:69:FF:FF:FF:FF:FF:FF ] Сектор 17 : KEYA / ACCESS / KEYB

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 18 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 19 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 1A : DATA

[ 00:00:00:00:00:00:FF:07:80:69:FF:FF:FF:FF:FF:FF ] Сектор 1B : KEYA / ACCESS / KEYB

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 1C : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 1D : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 1E : DATA

[ 00:00:00:00:00:00:FF:07:80:69:FF:FF:FF:FF:FF:FF ] Сектор 1F : KEYA / ACCESS / KEYB

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 20 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 21 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 22 : DATA

[ 00:00:00:00:00:00:FF:07:80:69:FF:FF:FF:FF:FF:FF ] Сектор 23 : KEYA / ACCESS / KEYB

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 24 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 25 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 26 : DATA

[ 00:00:00:00:00:00:FF:07:80:69:FF:FF:FF:FF:FF:FF ] Сектор 27 : KEYA / ACCESS / KEYB

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 28 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 29 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 2A : DATA

[ 00:00:00:00:00:00:FF:07:80:69:FF:FF:FF:FF:FF:FF ] Сектор 2B : KEYA / ACCESS / KEYB

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 2C : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 2D : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 2E : DATA

[ 00:00:00:00:00:00:FF:07:80:69:FF:FF:FF:FF:FF:FF ] Сектор 2F : KEYA / ACCESS / KEYB

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 30 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 31 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 32 : DATA

[ 00:00:00:00:00:00:FF:07:80:69:FF:FF:FF:FF:FF:FF ] Сектор 33 : KEYA / ACCESS / KEYB

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 34 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 35 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 36 : DATA

[ 00:00:00:00:00:00:FF:07:80:69:FF:FF:FF:FF:FF:FF ] Сектор 37 : KEYA / ACCESS / KEYB

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 38 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 39 : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 3A : DATA

[ 00:00:00:00:00:00:FF:07:80:69:FF:FF:FF:FF:FF:FF ] Сектор 3B : KEYA / ACCESS / KEYB

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 3C : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 3D : DATA

[ 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 ] Сектор 3E : DATA

[ 00:00:00:00:00:00:FF:07:80:69:FF:FF:FF:FF:FF:FF ] Сектор 3F : KEYA / ACCESS / KEYB