cancel
Showing results for 
Search instead for 
Did you mean: 

Problem writing data to ISO15693 memory using ST25R95

Nkama
Associate II

I want to write data to ISO15693 memory using ST25R95.

However ST25R95 returns error.

 

Below is my communicating data.

 

Get UID

PlotocolSelect
0x00, 0x02, 0x02, 0x01, 0x0D

WrReg
0x00, 0x09, 0x04, 0x68, 0x01, 0x01, 0x53

SendRecv(Get UID)
0x00, 0x04, 0x03, 0x26, 0x01, 0x00

I got the UID.

Write Data

PlotocolSelect
0x00, 0x02, 0x02, 0x01, 0x0D

WrReg
0x00, 0x09, 0x04, 0x68, 0x01, 0x01, 0x53

SendRecv(Write Data to memory)
0x00, 0x04, 0x13(data length), 0x22(flag byte), 0x21(write single block command), 
0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX,(UID 8byte)
0x01,(block number)
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08(write data 8byte)

Response of SendRecv(Write Data to memory)
0x0E, 0x87, 0x00

Why ST25R95 returns error?

 

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,

0x87 0x00 means timeout i.e. no response from the tag. See ST25R95 datasheet table 6. This can be due to different causes:

  1. the UID encoded in the Write Multiple Block is not correct: see ISO/IEC 15693-3 §7.1 "A multiple-byte field is transmitted LSByte first, each byte is transmitted LSB first". If the UID received in the Inventory response is for example D2 A5 A4 18 00 23 02 E0 then the UID encoded inside the Write Multiple Block shall be D2 A5 A4 18 00 23 02 E0. Can you try to send the write command in non-addressed mode?
  2. the tag requires the option flag for write alike commands: see ISO/IEC 15693-3 §9.6. An EOF has to be sent by the reader in [10ms ; 20ms]; This can be achieved with a sendReceived command with an empty data payload. Can you check the datasheet of the tag? Feel free to share details about tag manufacturer and tag model
  3. the command is not properly encoded. For example, writing 8 bytes is quite unusual as most tags have a 4 bytes block layout. Can you check the block size in the datasheet of the tag?

ST provides a portable NFC communication stack (see STSW-ST25R017 in ST25 embedded NFC library). It includes a complete demo with tag polling and sample code to read/write various type of tags. I would recommend to use this firmware package to develop your own application.

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

2 REPLIES 2
Brian TIDAL
ST Employee

Hi,

0x87 0x00 means timeout i.e. no response from the tag. See ST25R95 datasheet table 6. This can be due to different causes:

  1. the UID encoded in the Write Multiple Block is not correct: see ISO/IEC 15693-3 §7.1 "A multiple-byte field is transmitted LSByte first, each byte is transmitted LSB first". If the UID received in the Inventory response is for example D2 A5 A4 18 00 23 02 E0 then the UID encoded inside the Write Multiple Block shall be D2 A5 A4 18 00 23 02 E0. Can you try to send the write command in non-addressed mode?
  2. the tag requires the option flag for write alike commands: see ISO/IEC 15693-3 §9.6. An EOF has to be sent by the reader in [10ms ; 20ms]; This can be achieved with a sendReceived command with an empty data payload. Can you check the datasheet of the tag? Feel free to share details about tag manufacturer and tag model
  3. the command is not properly encoded. For example, writing 8 bytes is quite unusual as most tags have a 4 bytes block layout. Can you check the block size in the datasheet of the tag?

ST provides a portable NFC communication stack (see STSW-ST25R017 in ST25 embedded NFC library). It includes a complete demo with tag polling and sample code to read/write various type of tags. I would recommend to use this firmware package to develop your own application.

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.

Thank you.

I mistaked number of bytes.

4 bytes is correct.