cancel
Showing results for 
Search instead for 
Did you mean: 

HALT only single tag in field

RMuiz.1
Associate III

Hi!

I have a case where I want to read all tags in area one by one. Issue is that if I call `HLTA` command, even after selecting a tag, all tags in area go to sleep. Is this intended behavior in ISO 14443A protocol or I am doing something wrong?

Hlta -> https://github.com/jspngh/st25r3911b/blob/master/src/lib.rs#L275
Select -> https://github.com/xpresshd/st25r3911b/blob/master/src/lib.rs#L575

Thanks!

 

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions
Brian TIDAL
ST Employee

Hi,

Thanks for the trace. If I understand properly,

  1. you just want to retrieve the various UID i.e. you do not want to read the content of the physical memory of the the tags, right? And you don't want to do individual tag activation to read/write the memory of the various tag, right?
  2. you just want to repeat UID retrieval activity regularly (timer based or gun machine). 

In that case, the Field has to be set to the off condition for a duration of tFIELD_OFF (5.1ms) before repeating the UID retrieval.

If you repeat twice the collision resolution activity without a field reset between the 2 collision resolution, the first time all tags will be found (because all tags are initially in Idle state), the second time only one tag will be found (because all tags are in SLEEP_A, then move to READY_A* when the ALL_REQ/WUPA is issued and as soon as a SEL_REQ is sent to a given tag, the other tags returns to SLEEP_A).

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

11 REPLIES 11
Brian TIDAL
ST Employee

Hi,

tags enter in SLEEP_A or SLEEP_AF state only

  • after receiving HLTA/SLP_REQ in ACTIVE_A/ACTIVE_A* states
  • or after receiving a DESELECT COMMAND in CARD EMULATOR 4A state (ISO_DEP case) 
  • or after receiving a DSL_REQ in ATR_READY_A/TARGET_A states (NFC_DEP case)

Can you elaborate on " if I call `HLTA` command, even after selecting a tag, all tags in area go to sleep"?

If you want to "read" all tags in the operating field, I would suggest

  1. to perform the NFC Forum Collision Resolution Activity to detects the presence of multiple devices and enumerates the different identifiers
  2. then to perform the NFC Forum Device Activation Activity to activate a particular device and read its content
  3. then to perform the NFC Forum Device Deactivation Activity to deactivate this device to end communication and to enable possible activation of another device

The Collision Resolution Activity is a loop that selects one device after the other. Multiple devices can be identified by selecting all cascade levels of one device before restarting the algorithm to select the next device. Before restarting the algorithm, the device identified is sent to SLEEP_A State to exclude it from the remaining collision resolution process.

The Device Activation Activity activates one device out of the set of devices identified during the Collision Resolution Activity. Other identified NFC-A devices stay in SLEEP_A.

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.

Thanks for a response!

> Can you elaborate on " if I call `HLTA` command, even after selecting a tag, all tags in area go to sleep"?

I want to read all tags in area. If I don't use `HLTA` call then there is a chance that I will be stuck in loop reading just few tags. Now if I send `HLTA` then all of tags in area don't respond to my `REQA` request anymore.


  1. to perform the NFC Forum Collision Resolution Activity to detects the presence of multiple devices and enumerates the different identifiers
  2. then to perform the NFC Forum Device Activation Activity to activate a particular device and read its content
  3. then to perform the NFC Forum Device Deactivation Activity to deactivate this device to end communication and to enable possible activation of another device

So I do 1. step and using anticollision find 1 tag identifier. What do you mean by "NFC Forum Device Activation Activity"? Do I need to read its content for it to be selected?

From what I understand I miss a step between running my anticollision loop and calling a hlta instruction. But what is this step?

Brian TIDAL
ST Employee

Hi,

You can find a C implementation of those activities inside X-CUBE-NFC5 Firmware package (functions rfalNfcaPollerStartFullCollisionResolution/rfalNfcaPollerGetFullCollisionResolutionStatus and rfalNfcaPollerStartSelect/rfalNfcaPollerGetSelectStatus). This can be a basis for your own  implementation in Rust Programming Language.

Basically, for the Collision Resolution:

  1. send a WUPA/ALL_REQ
  2. loop on sending the Anticollision frame (SDD_REQ) until there is no collision (in case of collision, use the valid bits received before the collision, followed by 1)
  3. send the select command (SEL_REQ). If the UID is not complete, perform step 2 with the next cascade level (2 and then if needed 3)
  4. store the UID
  5. send HLTA/SLP_REQ to move the current selected tag into SLEEP state
  6. send REQA/SENS_REQ and perform step 2 starting with cascade level 1 to find the next tag until there is no other tag (or until you have reached the maximun number of tags in your application)

At the end of the collision resolution, you will have a list of tag with their UID/NFCID1. All those tags will be in SLEEP state (except maybe the last one if you skip the step #5 for the last tag). So, none of those tags will reply to REQA/SENS_REQ. 

For the activation of a given tag from the list of sleeping tags:

  1. send a WUPA/ALL_REQ
  2. send the select command (SEL_REQ) using the known UID of the tag with the various cascade level until the UID is complete
  3. send the RATS command if using a T4T tag 

Then you can send your commands to read the tag.

To deactivate a tag:

  1. send a HLTA/SLP_REQ if using a T2T tag or a DESELECT is using a T4T tag

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.

6 steps listed is what I do now in Rust library.

Issue is that if I have 2+ tags in field and I do WUPA -> select with anti collision -> get UID -> HLTA -> REQA -> select with anti collision -> no response ( Here I would expect to get next tag UID)

So it seems to me that HLTA put all tags in sleep state.

Brian TIDAL
ST Employee

Hi,

in the step #6 (REQA), do you receive an answer from the second tag?

Can you describe your HW setup:

  • do you use your own custom board or a X-NUCLEO-NFC05A1? 
  • can you connect a X-NUCLEO-NFC05A1 on a NUCLEO-L476RG and run the poller demo with discParam.devLimit=2 and make sure your 2 tags can be discovered ?
  • which kind of tag do you use (IC manufacturer and model) and which kind of antenna (credit card format or smaller ones)?
  • can you detect each tag individually?

"So it seems to me that HLTA put all tags in sleep state." this would be none compliant tags...

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.
> in the step #6 (REQA), do you receive an answer from the second tag?

No response from second tag

> do you use your own custom board or a X-NUCLEO-NFC05A1?
I use my own board

> can you connect a X-NUCLEO-NFC05A1 on a NUCLEO-L476RG and run the poller demo with discParam.devLimit=2 and make sure your 2 tags can be discovered ?
RMuiz1_0-1692608012839.png

I tried with disco board and windows gui software and it seems to run fine.




> which kind of tag do you use (IC manufacturer and model) and which kind of antenna (credit card format or smaller ones)?
Playing card format. Have to search for spec, but I don't think issue is there

> can you detect each tag individually?
Yes I can


Maybe I need to turn off field after every read?

Brian TIDAL
ST Employee

Hi,

if you toggle the field On/Off/On, all tags will return to Idle state and it is likely that you will detect the same tag again and again.

Can you connect a logic analyzer on SPI (CLK/MOSI/MISO/CS) and ST25R3911B_IRQ pins and send me the trace file from initialization up to tag reading/ Sleep/ 2nd tag select?

Thanks

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.

Actually if I replace wupa with field restart it solves my issue.

Here is capture where I keep field on. My tags are already on antenna from the start. First it reads both tags and then just one even after WUPA call

RMuiz1_0-1692625123007.png

Capture

https://drive.google.com/file/d/1o9rzkzOWnQP6sZISLM1s_lf89QjXph5u/view?usp=sharing

Brian TIDAL
ST Employee

Hi,

Thanks for the trace. If I understand properly,

  1. you just want to retrieve the various UID i.e. you do not want to read the content of the physical memory of the the tags, right? And you don't want to do individual tag activation to read/write the memory of the various tag, right?
  2. you just want to repeat UID retrieval activity regularly (timer based or gun machine). 

In that case, the Field has to be set to the off condition for a duration of tFIELD_OFF (5.1ms) before repeating the UID retrieval.

If you repeat twice the collision resolution activity without a field reset between the 2 collision resolution, the first time all tags will be found (because all tags are initially in Idle state), the second time only one tag will be found (because all tags are in SLEEP_A, then move to READY_A* when the ALL_REQ/WUPA is issued and as soon as a SEL_REQ is sent to a given tag, the other tags returns to SLEEP_A).

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.