Type2Tag.sector_select makes tag unresponsive

Bug #1549405 reported by Stephen Tiedemann
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nfcpy
Fix Released
Medium
Stephen Tiedemann

Bug Description

Originally raised as question https://answers.launchpad.net/nfcpy/+question/285533.

With an NXP NTAG I2C, when selecting sector 3 and then reading into the session register pages yields unrecoverable timeout error. Also just selecting sector 3 and then selecting sector 0 yields unrecoverable timeout error, here in the first half of the sector_select(0) call.

Related branches

Revision history for this message
Stephen Tiedemann (stephen-tiedemann) wrote :

Verified with a just received NTAG I2C 1K demo board.

Changed in nfcpy:
assignee: nobody → Stephen Tiedemann (stephen-tiedemann)
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Stephen Tiedemann (stephen-tiedemann) wrote :

Identified root cause: the Type2Tag.transceive() method makes two retransmissions when a command times out. This is usually the right thing to do but not in case of the obscure "passive ack", aka just don't answer, invented by a drunk engineer. Will add a retries parameter to transceive() so that it can be configured for this special case.

Changed in nfcpy:
status: Triaged → In Progress
Revision history for this message
James (jamescgmatthews) wrote :

If it helps your development I made the following changes to test the fix:

tty2.py:

Line 532: Added an optional 'tries' parameter to the trasceive argument list:

def transceive(self, data, timeout=0.1, tries=3):

Line 549: Use this parameter for the number of retries:

for retry in range(tries):

Line 518 in the sector_select command set the optional parameter to 1:

self.transceive(chr(sector)+"\0\0\0", timeout=0.001, tries=1)

Some simple code to test reading the NXP 1K with the SCL3711:

        resp = tag.sector_select(3)
        print "Sector select: " + str(resp)

        r1 = tag.read(248)

        self.__logger.info("Read registers: " + binascii.hexlify(r1))

Successfully sets the sector to 3 and reads the session registers

For reference the output is:

Read registers: 7d00f848080121000000000000000000

I can confirm that this agrees with reading the tag using the Android application provide by NXP for this eval board.

Revision history for this message
Stephen Tiedemann (stephen-tiedemann) wrote :
Changed in nfcpy:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.