Skip to main content
Visitor II
February 5, 2021
Solved

ST25R3911B errors when combination of two tags

  • February 5, 2021
  • 2 replies
  • 1651 views

What I'm doing is to perform anticollision with 1 or 2 NFCA tags present.

When performing anticollision with just one tag, the function does never report an error and allways find 1 tag correctly.

When performing anticollisiion with two tags:

  • There are combinations of two NFCA tags that allways work perfectly (ERR_NONE) and found all the tags.
  • There are combinations of two NFCA tags that allways fails.

When a combination allways fails:

  • If I have optimize for size (-Os) error is allways ERR_FRAMING (in the same place as PDe), and if I call anticollision function again, it just found 1 tag (but there are two!).
  • If I have optimize most (-O3) error is allways ERR_INCOMPLETE_BYTE, if I call anticollision function again, error is ERR_TIMEOUT, if I call it again, ERR_INCOMPLETE_BYTE, ...
  • All tags works fine, when just one is present.

0693W000007E3p3QAC.png-----------------------------------------------------------------------------------------------------------------------------------

Ulysses HERNIOSUS

Open Ulysses HERNIOSUS Preview

 (ST Employee)

Hi EBadi.2,

I propose you create a separate ticket for this behavior. I have some ideas but would also need some more information which you could post in this separate ticket:

  • Which functions are you calling with which parameter?
  • At which frames do yo observe this behavior? REQA/SENS_REQ or anticollision/SDD_REQ or SELECT/SEL_REQ? Our collision resolution functions are built to be able to cope with multiple tags.

-----------------------------------------------------------------------------------------------------------------------------------

err = rfalNfcaPollerInitialize();  /* Initialize for NFC-A */

err = rfalFieldOnAndStartGT();   /* Turns the Field On if not already and start GT timer

err = rfalNfcaPollerTechnologyDetection( RFAL_COMPLIANCE_MODE_NFC, &sensRes );

err = rfalNfcaPollerInitialize();

err = rfalFieldOnAndStartGT();   /* Turns the Field On if not already and start GT

err = rfalNfcaPollerFullCollisionResolution( RFAL_COMPLIANCE_MODE_NFC, (MAX_TAGS_TO_READ), nfcaDevList, &totalTags );

The errors I see are in this last call, is that what you were asking?

Where to find these: REQA/SENS_REQ or anticollision/SDD_REQ or SELECT/SEL_REQ?

    This topic has been closed for replies.
    Best answer by EBadi.2

    Hi Ulysses HERNIOSUS ,

    I finally find out where the issue was. There were a few items to fix, mostly related to configuration GPIO and SPI:

    • SPI was set on 80MHz/128 and now 80MHz/16
    • SPI GPIO's were set FREQ_LOW, now FREQ_VERY_HIGH
    • SPI interrupt has now more priority
    • RFID Interrupt GPIO didn't have any pulldown, now is configured internally in the microcontroller.

    Thanks for your support.

    2 replies

    Technical Moderator
    February 5, 2021

    Hi EBadi.2,

    What is your value of MAX_TAGS_TO_READ?

    The issues described in st25r3911b-error-framing-in-reception consistently explains the issues you observe with -Os. You may fall into this problematic timing. You may actually also be able to shift the problematic point by adding a small delay (few us) into the ISR instead of speeding up with -O3.

    However I am a bit puzzled by the ERR_INCOMPLETE_BYTE - it should have received ST25R3911_IRQ_MASK_COL and return ERR_RF_COLLISION in these cases.

    When you see this ERR_INCOMPLETE_BYTE: Can you tell me the stacktrace? Alternatively the values of gRFAL.TxRx.ctx.

    I would also be interested in a logic analyzer trace in this case: MISO,MOSI,SCLK,/SS,INT.

    In general there can always be positions of two cards where it gets tricky from an analog standpoint to correctly identify collisions between two cards. One card may be much stronger than the other one and then only one card is read. However in our experience this should be working well with our readers in most positions.

    Best Regards, Ulysses

    EBadi.2Author
    Visitor II
    February 5, 2021

    Hi Ulysses HERNIOSUS,

    MAX_TAGS_TO_READ is set to 2.

    Issue get not fixed adding a delay on the ISR.

    With -Os, when I get ERR_INCOMPLETE_BYTE, the value of gRFAL.TxRx.ctx is allways: 536872912.

    Unfortunatelly I do not have a logic analyzer.

    When I found a combination of two tags, they never work, in any position on the antena. But they can work with other tags with no problem.

    Technical Moderator
    February 5, 2021

    Hi,

    Sorry I wasn't clear about the details: I would be interested in the content of gRFAL.TxRx.ctx. Especially in the fields:

    gRFAL.TxRx.ctx.txBufLen and gRFAL.TxRx.ctx.txBuf[0..(gRFAL.TxRx.ctx.txBufLen+7)/8].

    This would tell me where in the sequence the error happens and if a collision error would be expected at this frame.

    Also can you give me details about the 2 tags which you have in the field: ATQA and UID? Please provide also the content of gRFAL.fifo.status[] when this happened.

    Best Regards, Ulysses

    Technical Moderator
    February 5, 2021

    Hi,

    reading this I find:

    • gRFAL.TxRx.ctx.txbufLen = 16 : 16 bits = 2 bytes to be sent
    • gRFAL.TxRx.ctx.txbuf = 0x93 0x20 : Anticollision command of first Cascade Level
    • gRFAL.fifo.status [0] = 3 = 0x3 : FIFO status register 1, denoting 3 bytes not yet read from the FIFO
    • gRFAL.fifo.status [1] = 22 = 0x16 : : FIFO status register 2, last byte not complete, 3 bits valid

    IMO this 2 bytes 3 bits are the bits which are in common for both of the tags (Cascade Tag 0x88 then 0x04 and the the three 1 bits from 0xEC and 0xF4.

    I have the feeling that by increasing the speed of the code you shifted the point of timing issues to somewhere else.

    Can you check your interrupt handling and possibly speed it further up? What is your SPI speed? Did you look at the SPI stream to verify its throughput and latency ?

    Best Regards, Ulysses

    EBadi.2AuthorAnswer
    Visitor II
    February 9, 2021

    Hi Ulysses HERNIOSUS ,

    I finally find out where the issue was. There were a few items to fix, mostly related to configuration GPIO and SPI:

    • SPI was set on 80MHz/128 and now 80MHz/16
    • SPI GPIO's were set FREQ_LOW, now FREQ_VERY_HIGH
    • SPI interrupt has now more priority
    • RFID Interrupt GPIO didn't have any pulldown, now is configured internally in the microcontroller.

    Thanks for your support.