2022-01-31 06:59 AM
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.
Solved! Go to Solution.
2022-02-03 09:59 AM
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
2022-02-02 08:14 AM
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
2022-02-03 06:55 AM
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?
2022-02-03 09:18 AM
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
2022-02-03 09:59 AM
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