cancel
Showing results for 
Search instead for 
Did you mean: 

Hi, I'm intrestid in developing using st25ru3993 (without eval board) So, onestly, ST oficcial code example is... difficult for understanding in some cases. I'll I will be grateful if smd will give me some code example of read/write process Thank you

MLust.1
Associate

It's my first experience of web question, so I hope for your understanding

1 ACCEPTED SOLUTION

Accepted Solutions
Cedric Dalban
ST Employee

​Hello MLust,

Reading/Writing and more generally accessing a tag is really simple.

The example code is provided in function demo_evalAPI_Gen2RdWr() from file STUHFL_demoEvalApi.c.

Let me explain the code:

  •    printGen2InventoryInfo(&invData); 

=> lists all tags available in antenna range

=> invData contains the full list of all inventoried tags

=> the first entry (the first tag) will be used for reading/writing

  • gen2Select(invData.tagList[0].epc.data, invData.tagList[0].epc.len);

=> by default, the read/writes/all access will be done on first visible tag

=> the Gen2_Select() call creates filters to ensure all susequent read/writes will be done on same tag

=> as mentioned above the first entry is used for subsequent accesses thus the ceration of filter on tagList[0]

  • void gen2Read(uint8_t *data)

=> prepares readData parameters that follows Gen2 specifications

  • membank: bank from which data will be read
    • wordPtr: start pointer (in words) from which data will be read
    • bytes2read: number of bytes to read
    • pwd: access password (if any, by default must be set to 0x00000000)

=> launches data read:

  • data : contains data read from tag

  • void gen2Write(uint16_t data)

=> prepares writeData parameters that follows Gen2 specifications

  • membank: bank to which data will be written
    • wordPtr: start pointer (in words) to which data will be written
    • data: data to be written (can only write word per word)
    • pwd: access password (if any, by default must be set to 0x00000000)

That's all you need to write/read data to/from tag,

similar functions can be called to lock, kill, ... the tags.

best regards,

Cedric

View solution in original post

1 REPLY 1
Cedric Dalban
ST Employee

​Hello MLust,

Reading/Writing and more generally accessing a tag is really simple.

The example code is provided in function demo_evalAPI_Gen2RdWr() from file STUHFL_demoEvalApi.c.

Let me explain the code:

  •    printGen2InventoryInfo(&invData); 

=> lists all tags available in antenna range

=> invData contains the full list of all inventoried tags

=> the first entry (the first tag) will be used for reading/writing

  • gen2Select(invData.tagList[0].epc.data, invData.tagList[0].epc.len);

=> by default, the read/writes/all access will be done on first visible tag

=> the Gen2_Select() call creates filters to ensure all susequent read/writes will be done on same tag

=> as mentioned above the first entry is used for subsequent accesses thus the ceration of filter on tagList[0]

  • void gen2Read(uint8_t *data)

=> prepares readData parameters that follows Gen2 specifications

  • membank: bank from which data will be read
    • wordPtr: start pointer (in words) from which data will be read
    • bytes2read: number of bytes to read
    • pwd: access password (if any, by default must be set to 0x00000000)

=> launches data read:

  • data : contains data read from tag

  • void gen2Write(uint16_t data)

=> prepares writeData parameters that follows Gen2 specifications

  • membank: bank to which data will be written
    • wordPtr: start pointer (in words) to which data will be written
    • data: data to be written (can only write word per word)
    • pwd: access password (if any, by default must be set to 0x00000000)

That's all you need to write/read data to/from tag,

similar functions can be called to lock, kill, ... the tags.

best regards,

Cedric