AnsweredAssumed Answered

ST25R3911B calls to read/write block (after successful inventory/get ID)

Question asked by Guilherme dePaula on May 18, 2018
Latest reply on May 24, 2018 by Grégoire Poulain

As previously reported on another post I can do an "inventory" and get a tag ID back successfully.  I did that by getting the example application for STM32F401RE-Nucleo and X-NUCLEO-NFC0A1 boards ==>>  code is STM32CubeExpansion_NFC5_V1.2.0

 

I am now trying to read and write to the tag.  Unfortunately the above example code stops at getting an "inventory".

 

After getting the inventory here:

 

  rfalNfcvPollerInitialize();           /* Initialize for NFC-F */
  rfalFieldOnAndStartGT();              /* Turns the Field On if not already and start GT timer */
 
  err = rfalNfcvPollerCollisionResolution(1, &nfcvDev, &devCnt);
  if( (err == ERR_NONE) && (devCnt > 0) )
  {
    /******************************************************/
    /* NFC-V card found                                   */
    /* NFCID/UID is contained in: invRes.UID */
    REVERSE_BYTES(nfcvDev.InvRes.UID, RFAL_NFCV_UID_LEN);
    
    found = true;
  }

I am continuing with this:

 

    uint8_t rxBuf[1] = {0x55}, wrData = 0xAA;
    uint16_t rcvLen = 1;
    uint8_t flags = RFAL_NFCV_REQ_FLAG_DEFAULT;
    
    err = rfalNfvReadSingleBlock( flags, nfcvDev.InvRes.UID, 1, rxBuf, 1, &rcvLen );
 
    err = rfalNfvWriteSingleBlock( flags, nfcvDev.InvRes.UID, 1, &wrData, 1 );
 
    err = rfalNfvReadSingleBlock( flags, nfcvDev.InvRes.UID, 1, rxBuf, 1, &rcvLen );
 
    if (rxBuf[1] == wrData)
    {
        sys_delay_ms(100);
    }
    else
    {
        sys_delay_ms(200);
    }

But the calls to read/write always return a timeout error.

 

Is it OK to just continue after getting the ID from a tag?  

Should I have to turn the antenna off, then back on first?

Are there additional steps after rfalNfcvPollerCollisionResolution() and before rfalNfvReadSingleBlock()?

Maybe the flags value has to be more than just the default?

Etc...

 

Is there an example SW that actually does read/write operations and does not stop at getting inventory?

 

Thanks and regards,
Gil

Outcomes