2021-03-18 08:15 AM
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:
When 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)
Appreciate for help and sorry for my english))
Solved! Go to Solution.
2021-03-19 11:07 AM
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
2021-03-18 08:41 AM
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
2021-03-18 08:58 AM
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.
2021-03-18 09:08 AM
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
2021-03-18 09:27 AM
NTAG213 have factory supporting NDEF .
See NXP site
I have successfully reading 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).
2021-03-19 12:35 AM
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
2021-03-19 06:16 AM
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:
ISO-DEP its my phone.
OK Data: 6A82 it means that "Select NDEF Application" command failed (result must be 0x9000). See the code:
2021-03-19 06:32 AM
I copied content of my clean tag.
memory 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
2021-03-19 06:33 AM
sorry, don't know how to hide in a spoiler here...
2021-03-19 06:38 AM
and another tag
[ 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