cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to write on ISO -15693 card using ST25R3911B reader.

sach.56215330888194E12
Associate II

Hi,

 I'm using RFID reader ST25R3911B to read/write on ISO15693 card. I'm unable to perform a write to the card and i'm using "Writesingleblock" function mentioned in code/lib cube-nfc5(ver 1.2). I followed the steps which was mentioned in an earlier thread "https://community.st.com/s/question/0D50X00009XkWNXSA3/st25r3911b-calls-to-readwrite-block-after-successful-inventoryget-id" but still unable to get through.

In that it was mentioned to use Select mode instead of Address mode but while using Select mode i'm getting Timeout error. But if i switch to Address mode then Read goes through successfully but write ends up in Ignore Error. Then when i try to read back the block to which i have written it remains all zeros. Is there anything which i'm missing out on? Below is my reference code.

#define NFCV_BLOCK_LEN 4

ReturnCode  err1;

uint8_t rxBuf[1+NFCV_BLOCK_LEN+2];

uint16_t rcvLen = 1;

uint8_t wrBuf[NFCV_BLOCK_LEN] = {0x11,0x22,0x33,0x44};

 err = rfalNfcvPollerCollisionResolution(1, &nfcvDev, &devCnt);

 if( (err == ERR_NONE) && (devCnt > 0) )

 {

#if 0 //Select mode

 err1 = rfalNfvSelect(RFAL_NFCV_REQ_FLAG_DEFAULT,nfcvDev.InvRes.UID);

 if(err1 == ERR_NONE))

{

 err1 = rfalNfvReadSingleBlock(RFAL_NFCV_REQ_FLAG_DEFAULT,NULL,3,rxBuf,sizeof(rxBuf),&rcvLen);

 if(err1 == ERR_NONE)

  {

   err1 = rfalNfvWriteSingleBlock(RFAL_NFCV_REQ_FLAG_DEFAULT,NULL,3,wrBuf,sizeof(wrBuf));

 err1 = rfalNfvReadSingleBlock(RFAL_NFCV_REQ_FLAG_DEFAULT,NULL,3,rxBuf,sizeof(rxBuf),&rcvLen);

  }

}

 #else //Address mode

 err1 = rfalNfvReadSingleBlock(RFAL_NFCV_REQ_FLAG_DEFAULT,nfcvDev.InvRes.UID,3,rxBuf,sizeof(rxBuf),&rcvLen);

 if(err1 == ERR_NONE)

  {

   err1 = rfalNfvWriteSingleBlock(RFAL_NFCV_REQ_FLAG_DEFAULT,nfcvDev.InvRes.UID,3,wrBuf,sizeof(wrBuf));

 err1 = rfalNfvReadSingleBlock(RFAL_NFCV_REQ_FLAG_DEFAULT,nfcvDev.InvRes.UID,3,rxBuf,sizeof(rxBuf),&rcvLen);

  }

 #endif

}

1 ACCEPTED SOLUTION

Accepted Solutions
Ulysses HERNIOSUS
ST Employee

Hi Sach,

if you look at the data sheet then you will find that the (optional) Select command is not supported in this tag. So you need to use Adressed mode.

Also in the Supported Command Set table you will find that Write is only supported when using option flag. Please change your flags for write to:

(RFAL_NFCV_REQ_FLAG_OPTION | RFAL_NFCV_REQ_FLAG_DEFAULT)

I still don't understand where you could get ERR_IGNORE. This error is only used in rfal_nfca.c. Maybe you have also an issue on the MCU. Maybe stack too small?

Regards, Ulysses

View solution in original post

12 REPLIES 12
Ulysses HERNIOSUS
ST Employee

Hi,

the code you are referring has been reworked in the meantime. It is probably worth a try of integrating a new version of RFAL for ST25R3911B available from st.com: STSW-ST25RFAL001

Also some more questions:

  • Which exact tag type are you trying to read/write? Manufacturer and model number, ideally with Data sheet.
  • What exactly do you mean by "Ignore error"?

Regards, Ulysses

sach.56215330888194E12
Associate II

Hi Ulysses,

I'll try the new version, in the meantime here are the answers to your queries.

  1. This tag is from TI(RF-HDT-DVBE-N2), i have also attached the datasheet.
  2. When i check the return value from function rfalNfvWriteSingleBlock(), it returns "ERR_IGNORE".

The other details which i forgot to mention in my earlier query is that i'm using STM32F072 as the main processor to interact with ST25R3911B. So far i'm able to read all tags for my project(basically Type-A and Type-V).

Regards,

Sach

Datasheet

Hi Ulysses,

i tried the new version(ST25RFAL001_v2.0.8) but it still did not help. I'm observing the same result as my original code outcome. Is there anything else i need to do?

Regards,

Sach

Ulysses HERNIOSUS
ST Employee

Hi Sach,

if you look at the data sheet then you will find that the (optional) Select command is not supported in this tag. So you need to use Adressed mode.

Also in the Supported Command Set table you will find that Write is only supported when using option flag. Please change your flags for write to:

(RFAL_NFCV_REQ_FLAG_OPTION | RFAL_NFCV_REQ_FLAG_DEFAULT)

I still don't understand where you could get ERR_IGNORE. This error is only used in rfal_nfca.c. Maybe you have also an issue on the MCU. Maybe stack too small?

Regards, Ulysses

Hi Ulysses,

You are right, ERR_IGNORE is used only in nfca.c but it still returns this err code when i try to write in nfcv.:(

After modifying the code with your inputs not the error code changed to timeout.

When you said stack too small, is there any such requirement of stack size?

Any work around?

Regards,

Sach

Ulysses HERNIOSUS
ST Employee

Hi Sach,

typically we use "Stack_Size     EQU   0x800" inside startup_*.s

AFAIK by default CubeMX generates a smaller stack.

Regards, Ulysses

Hi Ulysses,

The stack size we have it here is configured at 0x1000.

Regards,

Sach

Ulysses HERNIOSUS
ST Employee

Hi Sach,

I guess you will need to debug then where this value gets set.

One more hint, probably unrelated to the given issue: We have seen issues with STM32F072 SPI Hal driver requiring the buffers to be 16-bit aligned. You may want to activate USE_FULL_ASSERT for HAL drivers to discover such.

Regards, Ulysses.