2022-03-28 02:11 AM
Hi ST,
We are trying to integrate a ST25ru3993 with a new µC. We managed to detect and list tags using inventoryGen2() command, but we are struggling with the gen2ReadFromTag() one:
In the doxygen embedded in gen2.h code, we can see the following example:
n = gen2SearchForTags(tags+1, 1, 0, continueAlways, 1);
if(n == 0) return;
//Pick one of the tags based on the contents of tags. Here we use the very first tag
if(gen2ReadFromTag(tags+0, MEM_USER, 0, 2, buf))
return;
The gen2SearchForTags() command outputs a list of tags with type STUHFL_T_InventoryTag that doesn't have the necessary handle saved to communicate later with the tags, and which is not compatible with the tag_t structure needed by gen2ReadFromTag.
We tried to add the handle to the STUHFL_T_InventoryTag structure and to create a tag_t
based on what was saved in the tags of type STUHFL_T_InventoryTag , but we did not manage to call gen2ReadFromTag successfully, we always have error code -33 (STUHFL_ERR_CHIP_NORESP).
Remark: When setting global variable readTIDinInventoryRound to true, we can see that gen2ReadFromTag is called successfully to retrieve the TID inside the gen2SearchForTags() function.
Can you help us understand how to use the gen2ReadFromTag() function ?
Best Regards,
Thomas.
Solved! Go to Solution.
2022-04-12 01:15 AM
Hello Crav.1
ST introduced provides the stuhfl_evalAPI interface that can be used either in host mode (development on host systems by using the STUHFL SDK) or in device mode (development/extending the EVAL FW)
Although it is still possible on device side to call the functions direct from gen2.h it is better to use the stuhfl_evalAPI.h functions, as these care keep internal state correct.
For example, the correct RN16 that is used by the Gen2_Read function.
An example of searching for TAGs, select one and do a Gen2Read and Gen2Write can be found in the STUHFL_demo project. See File:STUHFL_demoEvalAPI.c, Function: void demo_evalAPI_Gen2RdWr()
There the eval_API is used to do this. This code works in host and device mode.
BR
2022-04-12 01:15 AM
Hello Crav.1
ST introduced provides the stuhfl_evalAPI interface that can be used either in host mode (development on host systems by using the STUHFL SDK) or in device mode (development/extending the EVAL FW)
Although it is still possible on device side to call the functions direct from gen2.h it is better to use the stuhfl_evalAPI.h functions, as these care keep internal state correct.
For example, the correct RN16 that is used by the Gen2_Read function.
An example of searching for TAGs, select one and do a Gen2Read and Gen2Write can be found in the STUHFL_demo project. See File:STUHFL_demoEvalAPI.c, Function: void demo_evalAPI_Gen2RdWr()
There the eval_API is used to do this. This code works in host and device mode.
BR