cancel
Showing results for 
Search instead for 
Did you mean: 

Tag write using ST25RU3993-HPEV

Sandhu
Associate II

Tag EPC, User memory Write using STUHFL library. Would like to know the procedure to do the Tag write using ST25RU3993-HPEV. If someone can refer any example project using STUHFL code wrapper of C#, it'll be helpful.

1 ACCEPTED SOLUTION

Accepted Solutions
Nick K
ST Employee

Hello Sandhu,

Please have a look to the API function "Gen2_BlockWrite(STUHFL_T_Gen2_BlockWrite *blockWrite)". This API allows to write 16bytes at once

For writing the EPC, note that the EPC memory starts with the StoredCRC word, and the StoredPC word. You find the memory layout also in the GS1 spec, that is mentioned above. To overwrite the EPC you need to use for memoryBank = STUHFL_D_GEN2_MEMORY_BANK_EPC and set wordPtr = 2 to start writting after StoredCRC and StoredPC. Also note, that if you want to change the length of the EPC you have to update the StoredPC with correct length information

View solution in original post

4 REPLIES 4
Nick K
ST Employee

Hello Sandhu,

in the STUHFL library package you can find C sample source code demonstrate the usage of Gen2_Write. Please have a look into the file function "void demo_evalAPI_Gen2RdWr()" in file "STUHFL_demoEvalAPI.c" from the solution ".\Applications\STUHFL_demo\STUHFL_demo.sln"

This demo code demonstrate how to inventory transponders, select one and access this TAG with a read and write operation.

For C# there is a similar demo for doing inventory TAGs, select one and read a part of its memory. 

This demo could be found in the function "public static void demo_Gen2Read()" of the C# demo code.

The code could be extended to do also a write operation following the same procedure as in the C code

BR

Thanks for the reply. I could able to write 2 byte data to user memory. But the data size to write at single time is 2 bytes. STUHFL_D_MAX_WRITE_DATA_LEN is set to 2. is there any reason behind this? And if we want to write the complete user area, do we need to write each 2 bytes in loop? Or is there any way to write whole memory in single shot?

And If i want to modify EPC, the STUHFL_T_Write memory bank need to select to EPC only or anything else need to check?

Hi Sandhu,

you will find the details of such inside the spec at https://www.gs1.org/standards/rfid/uhf-air-interface-protocol

Table 6-28 tells the Write command is mandatory, BlockWrite is only optional. With the mandatory Write command only 1 word ( 16bits) can be written with one command.

Regards, Ulysses

Nick K
ST Employee

Hello Sandhu,

Please have a look to the API function "Gen2_BlockWrite(STUHFL_T_Gen2_BlockWrite *blockWrite)". This API allows to write 16bytes at once

For writing the EPC, note that the EPC memory starts with the StoredCRC word, and the StoredPC word. You find the memory layout also in the GS1 spec, that is mentioned above. To overwrite the EPC you need to use for memoryBank = STUHFL_D_GEN2_MEMORY_BANK_EPC and set wordPtr = 2 to start writting after StoredCRC and StoredPC. Also note, that if you want to change the length of the EPC you have to update the StoredPC with correct length information