st25ru3993 st uhf library - user manual...the second project is for arm platforms running on linux...

23
Introduction The ST UHF library (STSW-ST25RU-SDK) is a middleware software stack written in ANSI C, to build RAIN ® RFID enabled applications for reader devices based on ST25RU3993. This document describes the usage of the ST UHF library software API. Along with this package, a comprehensive demonstration source code is available to illustrate the usage of the ST UHF library for Windows ® and Linux ® platforms. The complete software stack is ANSI C and POSIX compatible and enables fast and straightforward porting to other operating systems and/or toolchains. UHF application STUHFL Standards EPC UHF Gen2V2 ... Device Protocol Bus ST25RU3993EVAL board firmware HAL ST25RU3993 ST UHF library UM2618 User manual UM2618 - Rev 3 - June 2020 For further information contact your local STMicroelectronics sales office. www.st.com

Upload: others

Post on 29-Sep-2020

36 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

IntroductionThe ST UHF library (STSW-ST25RU-SDK) is a middleware software stack written in ANSI C, to build RAIN® RFID enabledapplications for reader devices based on ST25RU3993. This document describes the usage of the ST UHF library software API.

Along with this package, a comprehensive demonstration source code is available to illustrate the usage of the ST UHF libraryfor Windows® and Linux® platforms. The complete software stack is ANSI C and POSIX compatible and enables fast andstraightforward porting to other operating systems and/or toolchains.

UHF application

STUHFL

Standards EPC UHFGen2V2 ...

Device

Protocol

Bus

ST25RU3993EVAL board firmware

HAL

ST25RU3993 ST UHF library

UM2618

User manual

UM2618 - Rev 3 - June 2020For further information contact your local STMicroelectronics sales office.

www.st.com

Page 2: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

1 System overview

The ST UHF library (STUHFL) design is a classic middleware software stack running on a host system. Itprovides a simple software API to abstract low-level communication details. As shown in the simplified systemoverview the system is made up of two hardware components running the involved software components.

Figure 1. System overview

Hos

t

STUHFL

UHF application

IRQSPI

ST25RU3993 firmware

Dev

ice/

read

er m

odul

e

ST25RU3993

STUHFL EVAL API

The first component (device/reader module) runs the firmware with low-level driver implementation to operate theST25RU3993 reader IC and various protocols. The firmware implements a software interface to the ST UHFlibrary.The second component (host side) runs the ST UHF library and abstracts the low-level functionality. It provides aclean software API for UHF applications.The ST UHF library runs on host systems with an operating system as well as on embedded systems (with OS ornative), with limited resources. Even a design without a dedicated host module is possible, where the completesystem runs on the reader module only.

1.1 General information

The software described in this document supports Arm®-based device.

Note: Arm is a registered trademark of Arm Limited (or its subsidiaries) in the US and/or elsewhere.

1.2 Features

• Comprehensive middleware to build RAIN® RFID enabled applications for reader devices based onST25RU3993

• Mirrored host and device library API• Written in pure ANSI C99• POSIX compatible

UM2618System overview

UM2618 - Rev 3 page 2/23

Page 3: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

• Straightforward portability across different platforms (MCUs/RTOSs/OSs)• Compatible with main UHF standards

– EPC UHF Gen2v2– GB/T 29768

• Source code example implementation available– Windows®

– Linux® (Raspberry Pi 3B)– Further sample platform implementations underway

1.3 Hardware requirements

The main purpose of the ST UHF library is to simplify the ST25RU3993 low-level hardware driver, and to providean easy-to-use software interface. Therefore, the ST UHF software library operates only with the ST25RU3993-based demonstration boards listed below and their corresponding firmware:• ST25RU3993 EVAL board• ST25RU3993 ELANCE module

It is anyway possible to port the low-level hardware driver to other devices hosting a suitable MCU to drive thefirmware.

1.4 Building environment

Currently all host side software components and demonstration codes are generated by using Microsoft VisualStudio 2017 (VS2017). The package contains a VS2017 solution hosting projects for two different platforms. Thefirst project for Win32 platforms is suitable for generating code running on Windows 7 platform (and newer ones).The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to doremote compilation with VS2017. This requires a properly configured Arm device accessible in the same network.

Note: The available ST UHF library project for Arm and the corresponding example project use Raspberry Pi 3Bhardware for development. For more details about project configuration, refer to the appropriate project solutionfiles.

UM2618Hardware requirements

UM2618 - Rev 3 page 3/23

Page 4: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

2 Software architecture

The ST UHF library follows a classic stacked middleware software design and consists of components that run ona reader module and on a host system as the default use case.The complete ST UHF library is ANSI-C and POSIX compliant, resulting in easy porting to several other operatingsystems and platforms.The ST UHF library currently supports the most common UHF standards. Extensions and more protocols will bereleased in upcoming versions.Working sample source code is available for Windows and Linux, to use different library modules.

2.1 ST UHF library API

The exposed ST UHF library API allows the user to build RAIN applications on ST25RU3993 reader devices.Three stacked layers represent the complete exposed ST UHF library API.• Activity• Session• Device

In this arrangement abstraction and complexity increase starting from device moving up to activity. The purpose ofthe device layer is to abstract the hardware specific functionalities, such as direct register access. The sessionlayer uses the device layer to implement entire protocols such as the EPC Gen2V2 standard or other UHFstandards and protocols. The activity layer uses the device and session layers to abstract functionalities forautomated inventory of tags running in the background.

Table 1. Main layers

Layer Description

Activity Functionality like background inventory lookup via a build-in "Inventory Runner"

Session Implementation of different standards or protocols like EPC Gen2V2

Device Abstraction of hardware specific functionalities like register access

2.2 STUHFL EVAL API

On the device/reader module side the STUHFL EVAL API provides a basic software interface to ST25RU3993low-level drivers. The ST UHF library builds on top of this low-level interface and derives its ST25RU3993dependent functionalities. Applications where no host system is involved directly call the low-level STUHFL EVALAPI on reader/device side.

Note: Applications not using the ST UHF library stack may be directly attached to this interface.

2.3 ST UHF library wrappers

On top of the ST UHF library host interface, two wrappers are available for fast prototyping.• Java/C#/Python (under development)• ST EVAL API

Java, C# and Python are state of the art programming languages and enable software developers to implementfast and efficiently different kinds of UHF application. In addition to wrappers for different software developmentlanguages it is also possible to implement other custom interface wrapper like ST EVAL API wrapper.

Note: Software wrappers for others languages can easily be implemented when these programming languagessupport calling native C code.

UM2618Software architecture

UM2618 - Rev 3 page 4/23

Page 5: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

The STUHFL EVAL API wrapper (host side) fully emulates the STUHFL EVAL API on the device side. This allowsusers to start developing firmware applications on host systems and finish their task by porting the firmware to thedevice/reader side. The advantage of this approach is that the host side offers debuggers, advanced code tracersand many other host system development features. These host tools speed-up and simplify code development.When the firmware code development on the host side is completed, simply "copy and paste" the firmwareapplication code to the device/reader side. No additional source code modifications are required to run thefirmware on the MCU.

Note: The STUHFL EVAL API wrapper fully emulates the STUHFL EVAL API, exactly as available on the device side.

2.4 Not exposed layers

Underneath the exposed ST UHF library layer, several other layers work on the host with their counterparts on thedevice side. This layer stack is taking care of the data transfer between the host and the reader device.• Dispatcher• Protocol• Bus

These layers follow a stack design and depend only on their direct neighbours. The main purpose of thedispatcher layer is to bundle the ST UHF library API function calls in one single module and to forward it to theprotocol layer.The protocol layer transfers the abstracted function calls into transferable data chunks and forwards these datapackets to the bus layer.Finally, the bus layer sends the data chunks over a physical interface and receives them on the device/readermodule side. For the data transfer in the opposite direction from device/reader side to the host side, the protocoland the dispatcher layers do their task inversely.

Table 2. Not exposed layers

Layer Description

Dispatcher Merge and divide from API layers

Protocol Encodes and decodes data into TLV formatted data chunks ready for transfer between host and device

Bus Platform depended transfer layer handling data exchange

2.4.1 Support and helperIn addition to the above mentioned not exposed layers the library implements support and helper layers, whichprovide relevant functionalities and expose their interface to almost all other modules.

Table 3. Helper modules

Layer Description

TLV Tag-Length-Value encoding and decoding support

Logging Logging helper

UM2618Not exposed layers

UM2618 - Rev 3 page 5/23

Page 6: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

Figure 2. ST UHFL library system architectureD

evic

e/re

ader

mod

ule

side

Host

side

STUHFL wrappers

STUHFL EVA API Java/C#/... ...

STUHFL API

Dispatcher

ST25RU3993 EVAL board

ST25RU3993 module ...

Device layer

Inventory runner ... ...

Activity layer

Gen2V2 GB/T 29768 ...

Session layer

· STUHFL_F_Start(…)· STUHFL_F_Stop(…)· STUHFL_F_RegisterHandler(…)· …

· STUHFL_F_Gen2Inventory(…)· STUHFL_F_Gen2Select(…)· STUHFL_F_Gen2Read(…)· …

· STUHFL_F_GB29768Inventory(…)· …

· STUHFL_F_Gen2Inventory(…)· STUHFL_F_Gen2Select(…)· STUHFL_F_gen2Read(…)· …· STUHFL_F_GBT29768Inventory(…)· …

· STUHFL_F_Connect(…)· STUHFL_F_SetParam(…)· STUHFL_F_GetParam(…)· STUHFL_F_Reboot(…)· ... Protocol layer

Bus layerUART ... ... ...

DispatcherProtocol layer

Bus layer

STUHFL EVAL API

SPI TIMER GPIO ...

Platform dependent drivers

Platform dependentST25RU3993 low level drivers

Supp

ort a

nd h

elpe

rsTL

VLo

ggin

g...

...

UM2618Not exposed layers

UM2618 - Rev 3 page 6/23

Page 7: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

2.5 Host side usage

The functionality exposed by the ST UHF library API enables the development of RAIN applications based onST25RU3993 reader IC devices or modules on host devices. Host systems running the OS Windows or Linux aresupported by default. As the whole library is ANSI-C and POSIX compatible, it also easily builds for other POSIXcompatible platform.The following figure shows an example of host side usage.

Figure 3. ST UHF library usage overview

Hos

te.

g. R

Pi

STUHFL

UHF application

IRQSPI

ST25

RU

3993

devi

ce fi

rmw

are STUHFL EVAL API

Device drivers

ST25RU3993 drivers

Dev

ice/

read

er m

odul

ee.

g. S

TM32

L476

bas

ed E

VAL

boar

d

ST25RU3993

UM2618Host side usage

UM2618 - Rev 3 page 7/23

Page 8: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

2.6 Device side usage

The functionalities exposed by STUHFL EVAL API provide an abstract interface to the full UHF functionalitiesprovided by the ST25RU3993 reader IC, without the burden of manually handling low-level register access.Therefore, this interface is device-independent and enables the implementation of any abstract UHF application.The following figure shows an example of device side usage.

Figure 4. ST UHF library EVAL API device side usage

IRQSPI

ST25

RU

3993

mod

ule

base

d fir

mw

are

Device drivers

ST25RU3993 drivers

Dev

ice/

read

er m

odul

ee.

g. S

TM32

L476

bas

ed E

VAL

boar

d

ST25RU3993

STUHFL EVAL API

UHF application

UM2618Device side usage

UM2618 - Rev 3 page 8/23

Page 9: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

3 Source code

The complete source code (including sample sources for Windows and Linux) is available for download fromwww.st.com.

3.1 Directory and file structure

The package comes as zip file, with the following directory structure.

Figure 5. Directory structure

Table 4. Directory description

Directory Description

Application Several demonstration project source code

Firmware Several firmware projects

Middleware The ST UHF library projects for Windows and Linux as source code

Note: For correct operation the user must choose one of the appropriate firmware packages, delivered along with thelibrary.The “STUHFL” folder is located inside the “middleware/clib” folder.It contains the following folders:• “doc”: contains a detailed API description as Windows chm file.• “inc”: contains all relevant interface files• “src”: contains all implementation files

Figure 6. STUHFL directory structure

UM2618Source code

UM2618 - Rev 3 page 9/23

Page 10: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

The “inc” directory contains all relevant interface files and a subfolder containing platform specific files.

Figure 7. "inc" structure

Table 5. API headers

Filename Description Note

stuhfl.h Basis header file, containing main typedefs anddefines STUHFL API

stuhfl_al.h Application module STUHFL API

stuhfl_dl.h Generic part of device module STUHFL API

stuhfl_dl_ST25RU3993.h ST25RU3993 IC depending device module layer Not exposed as STUHFL API, internalusage

stuhfl_err.h Definition of error codes STUHFL API

stuhfl_evalAPI.hSTUHFL EVAL API definition. Used by STUHFLenabled firmware implementation and as STUHFLwrapper implementation

STUHFL wrapper - STUHFL EVAL API

stuhfl_helpers.h Helper module Not exposed as STUHFL API, internalusage

stuhfl_log.h Logging module definition Not exposed as STUHFL API, internalusage

stuhfl_pl.h Protocol layer definition Not exposed as STUHFL API, internalusage

stuhfl_sl.h Session layer STUHFL API

The “platform” directory contains all relevant files that are important when porting to other platforms.

Figure 8. "Platform" directory

UM2618Directory and file structure

UM2618 - Rev 3 page 10/23

Page 11: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

Table 6. Platform dependent headers

Filename Description

Stuhfl_bl_posix.h POSIX compatible bus layer for UART communication

stuhfl_bl_win32.h UART communication implementation for Windows

stuhfl_platform.h Implementation of generic functionality for platform independency

stuhfl_dl_ST25RU3993.h ST25RU3993 IC depending device module layer Not exposed as STUHFL API, internal usage

3.2 ST UHF library solution location

The solution to build a Win32 dynamic link library or Arm based shared object library is located at ./Middleware/clib/STUHFL.sln.

Note: For software development based on STUHFL the STUHFL demonstration solution contains the STUHFL projectand a complete demonstration application. This allows the user to build and debug at the same time both forWin32 and for Raspberry Pi platforms.

UM2618ST UHF library solution location

UM2618 - Rev 3 page 11/23

Page 12: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

3.2.1 Build STUHFL for Windows (DLL only)The user must execute the following steps:1. Open the VS2017 solution .\Middleware\clib\STUHFL.sln2. Right-click on the STUHFL project and click rebuild

Note: This generates a Win32 dynamic link library ready to use to communicate to ST25RU3993 reader IC baseddemonstantion boards (Windows host systems only).

3.2.2 Build STUHFL for Linux with Raspberry Pi 3B (shared object only)The user must execute the following steps:1. Open the VS2017 solution .\Middleware\clib\STUHFL.sln2. Add the IP address of your Raspberry Pi in the Tools/Options/Cross platform options3. In the STUHFL (Linux) project properties set this as your remote machine4. Right-click on the STUHFL(Linux) project and click rebuild

Note: This generates a Linux complete shared object to communicate to ST25RU3993 reader IC baseddemonstrantion boards (Linux host systems only).

3.3 Implementation of sample source code

3.3.1 Build STUHFL-demo for WindowsThe user must execute the following steps:1. Open the VS2017 solution ./Applications/STUHFL_demo/STUHFL_demo.sln2. Rebuild solution3. Start debugging to debug the demonstration

Note: For further information about the available demonstration check the documentation of the STUHFL_demoproject.

3.3.2 Build STUHFL-demo for LinuxThe user must execute the following steps:1. Open the VS2017 solution ./Applications/STUHFL_demo/STUHFL_demo_rpi.sln2. Add the IP address of your Raspberry Pi in the Tools\Options\Cross platform options.3. In the STUHFL and STUHFL demonstration project properties set this as your remote machine4. Update the communication port location (default: /dev/ttyUSB0) where to ST25RU3993 EVAL board is

connected to Raspberry Pi.5. See STUHFL_demo.c and adjust the COM_PORT define6. Rebuild solution7. Start debugging

Note: For further information about the available demonstrations check the documentation of the STUHFL_demoproject.

3.4 ST UHF library portability

The ST UHF library is ANSI-C and POSIX compatible. To port the library to other platforms or operating systemsa simple cross-compilation or remote-compilation is sufficient. Exceptions are the low-level communication driversfor the host to device and the reverse communication, always platform dependent. All platform dependentcomponents that need to be reworked before successful porting are located in ./Middleware/clib/STUHFL/src/platform

Note: To port the ST UHF library to other platforms and/or operating system add the low-level communication driversfor your platform to the ./Middleware/clib/STUHFL/src/platform folder before compilation.

UM2618Implementation of sample source code

UM2618 - Rev 3 page 12/23

Page 13: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

4 Software interface description

For detailed API description check the available documentation, which is part of the source code package and isavailable in compiled HTML file format (chm). Only a short overview of the different API functionalities for thedifferent modules is given in the following sections.

Note: For detailed information, refer to the file “./Middleware/clib/STUHFL/ doc/STUHFL.chm”

4.1 Device layer

Device layer exposed functionality.

4.1.1 ConnectionsThe table below gives an overview of the connectivity functions.

Table 7. STUHFL connection functionality

Function Description

STUHFL_F_Connect Connect to a device via STUHFL

STUHFL_F_Disconnect Disconnect from current connected device via STUHFL

STUHFL_F_GetCtx Get device context of current attached device

STUHFL_F_Reset Reset current attached device

4.1.2 Parmeter accessThe table below gives an overview of the parameter access functions.

Table 8. STUHFL parameter access functionality

Function Description

STUHFL_F_SetParam Generic set parameter function to set value of configuration

STUHFL_F_GetParam Generic get parameter function to get value of configuration

STUHFL_F_GetParamInfo Get parameter information

STUHFL_F_SetMultipleParams Set list of multiple parameters

STUHFL_F_GetMultipleParams Get list of multiple parameters

4.1.3 Data exchangeThe table below gives an overview of the data exchange functions.

Table 9. STUHFL data exchange functionality

Function Description

STUHFL_F_SendCmd Send command to device

STUHFL_F_ReceiveCmdData Receive command to device

STUHFL_F_ExecuteCmd Send and receive combination in one call

STUHFL_F_GetRawData Receive raw data from device

UM2618Software interface description

UM2618 - Rev 3 page 13/23

Page 14: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

4.1.4 Generic maintenanceThe table below gives an overview of the generic maintenance functions.

Table 10. STUHFL maintenance functionality

Function Description

STUHFL_F_GetVersion Get device version information

STUHFL_F_GetInfo Get device info information

STUHFL_F_Upgrade Firmware upgrade

STUHFL_F_EnterBootloader Reboot and enter bootloader

STUHFL_F_Reboot Reboot FW

4.2 Session layer

4.2.1 Gen2V2 of STUHFLThe table below gives an overview of the gen2V2 functions.

Table 11. STUHFL Gen2V2 functionality

Function Description

STUHFL_F_Gen2_Inventory Gen2 Inventory depending on the current inventory and gen2 configuration

STUHFL_F_Gen2_Select Gen2 Select command to select or filter Gen2 transponders

STUHFL_F_Gen2_Read Gen2 Read command to read from the Gen2 transponders

STUHFL_F_Gen2_Write Gen2 Write command to write data to Gen2 transponders

STUHFL_F_Gen2_Lock Gen2 Lock command to lock Gen2 transponders

STUHFL_F_Gen2_Kill Gen2 Kill command to kill Gen2 transponders.

STUHFL_F_Gen2_GenericCmd Generic Gen2 bit exchange

STUHFL_F_Gen2_QueryMeasureRssi RSSI measurement during Gen2 Query command

4.2.2 GB/T 29768 of STUHFLThe table below gives an overview of the GB/T 29768 functions.

Table 12. STUHFL GB/T 29768 functionality

Function Description

STUHFL_F_Gb29768_Inventory GB/T 29768 Inventory depending on the current inventory and GB/T 29768 configuration

STUHFL_F_Gb29768_Sort GB/T 29768 Sort command to select or filter GB/T 29768 transponders

STUHFL_F_Gb29768_Read GB/T 29768 Read command to read from the GB/T 29768 transponders

STUHFL_F_Gb29768_Write GB/T 29768 Write command to write data to GB/T 29768 transponders

STUHFL_F_Gb29768_Lock GB/T 29768 Lock command to lock GB/T 29768 transponders

STUHFL_F_Gb29768_Kill GB/T 29768 Kill command to kill GB/T 29768 transponders.

STUHFL_F_Gb29768_Erase GB/T 29768 Erase command to erase GB/T 29768 transponders.

UM2618Session layer

UM2618 - Rev 3 page 14/23

Page 15: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

4.3 Activity layer

4.3.1 ActionsThe table below gives an overview of the action functions.

Table 13. STUHFL action functionality

Function Description

STUHFL_F_Start Start foreground or background action

STUHFL_F_Stop Start action

4.4 STUHFL EVAL API wrapper

4.4.1 ConfigurationThe table below gives an overview of the configuration functions.

Table 14. STUHFL EVAL API configuration functionality

Function Description

SetRegister Writes the value to ST25RU3993 register at address

GetRegister Reads one ST25RU3993 register at address and replies the value to the host

SetRwdCfg Set reader configuration

GetRwdCfg Get reader configuration

SetAntennaPower Set antenna power

GetAntennaPower Get antenna power

SetGen2Cfg Set Gen2 configuration

SetTxRxCfg Set TxRx configuration

SetPA_Cfg Set power amplifier configuration

SetInventoryCfg Set general inventory configuration

GetGen2Cfg Get Gen2 configuration

GetGBT29768Cfg Get GBT29768 configuration

GetTxRxCfg Get TxRx configuration

GetPA_Cfg Get power amplifier configuration

GetInventoryCfg Get general inventory configuration

UM2618Activity layer

UM2618 - Rev 3 page 15/23

Page 16: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

4.4.2 FrequencyThe table below gives an overview of the frequency configuration functions.

Table 15. STUHFL EVAL API frequency settings functionality

Function Description

SetFreqProfile Set frequency profile

SetFreqProfileCustomAppend Set append frequency to profile

SetFreqHop Set frequency hopping time

SetFreqLBT Set listen before talk configuration

SetFreqCondMod Set continuous modulation configuration

GetFreqRSSI Get frequency RSSI

GetFreqReflectedPower Get append frequency to profile

GetFreqProfileInfo Get frequency hopping time

GetFreqHop Get listen before talk configuration

GetFreqLBT Get continuous modulation configuration

4.4.3 TuningThe table below gives an overview of the tuning functions.

Table 16. STUHFL EVAL API tuning functionality

Function Description

SetTuning Set Cin, Clen and Cout

SetTuningTableEntry Set tuning table entry

SetTuningTableDefault Revert to default tuning

SetTuningTableSave2Flash Save current configured tuning table to flash

SetTuningTableEmpty Delete tuning table entries

GetTuning Get Cin, Clen and Cout configuration

GetTuningTableEntry Get tuning table entry

GetTuningTableInfo Set current tuning table info

Tune Start tuning

4.4.4 Gen2V2The tables below gives an overview of the gen2V2 functions.

Table 17. STUHFL EVAL API Gen2V2 functionality

Function Description

Gen2_Inventory Gen2 Inventory depending on the current inventory and gen2 configuration

Gen2_Select Gen2 Select command to select or filter Gen2 transponders

Gen2_Read Gen2 Read command to read from the Gen2 transponders

Gen2_Write Gen2 Write command to write data to Gen2 transponders

Gen2_Lock Gen2 Lock command to lock Gen2 transponders

Gen2_Kill Gen2 Kill command to kill Gen2 transponders.

UM2618STUHFL EVAL API wrapper

UM2618 - Rev 3 page 16/23

Page 17: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

Function Description

Gen2_GenericCmd Generic Gen2 bit exchange

Gen2_QueryMeasureRssi RSSI measurement during Gen2 Query command

4.4.5 GB/T 29768The table below gives an overview of the GB/T 29768 functions.

Table 18. STUHFL EVAL API GB/T 29768 functionality

Function Description

Gb29768_Inventory GB/T 29768 Inventory depending on the current inventory and GB/T 29768 configuration

Gb29768_Sort GB/T 29768 Sort command to select or filter GB/T 29768 transponders

Gb29768_Read GB/T 29768 Read command to read from the GB/T 29768 transponders

Gb29768_Write GB/T 29768 Write command to write data to GB/T 29768 transponders

Gb29768_Lock GB/T 29768 Lock command to lock GB/T 29768 transponders

Gb29768_Kill GB/T 29768 Kill command to kill GB/T 29768 transponders.

Gb29768_Erase GB/T 29768 Erase command to erase GB/T 29768 transponders.

4.4.6 Inventory runnerThe table below gives an overview of the inventory runner functions.

Table 19. STUHFL EVAL API inventory runner functionality

Function Description

InventoryRunnerStart Start inventory runner

InventoryRunnerStop Stop current inventory runner

UM2618STUHFL EVAL API wrapper

UM2618 - Rev 3 page 17/23

Page 18: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

Revision history

Table 20. Document revision history

Date Version Changes

17-Sep-2019 1 Initial release.

26-Nov-2019 2Updated document title and Section Introduction.

Minor text edits across the whole document.

03-Jun-2020 3

Updated:• Section Introduction, Section 1.2 Features, Section 1.3 Hardware

requirements, Section 2.3 ST UHF library wrappers• Figure 2. ST UHFL library system architecture• title of Section 4.2.2 GB/T 29768 of STUHFL and of Section 4.4.5 GB/T

29768• Table 12. STUHFL GB/T 29768 functionality, Table 18. STUHFL EVAL

API GB/T 29768 functionality

Removed Table 1. Hardware requirement

UM2618

UM2618 - Rev 3 page 18/23

Page 19: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

Contents

1 System overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2

1.1 General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.3 Hardware requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

1.4 Building environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Software architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4

2.1 ST UHF library API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.2 STUHFL EVAL API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.3 ST UHF library wrappers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.4 Not exposed layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.4.1 Support and helper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.5 Host side usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.6 Device side usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3 Source code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9

3.1 Directory and file structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3.2 ST UHF library solution location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3.2.1 Build STUHFL for Windows (DLL only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.2.2 Build STUHFL for Linux with Raspberry Pi 3B (shared object only). . . . . . . . . . . . . . . . . . 12

3.3 Implementation of sample source code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.3.1 Build STUHFL-demo for Windows. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.3.2 Build STUHFL-demo for Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.4 ST UHF library portability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

4 Software interface description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13

4.1 Device layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

4.1.1 Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

4.1.2 Parmeter access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

4.1.3 Data exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

4.1.4 Generic maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

4.2 Session layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

UM2618Contents

UM2618 - Rev 3 page 19/23

Page 20: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

4.2.1 Gen2V2 of STUHFL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

4.2.2 GB/T 29768 of STUHFL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

4.3 Activity layer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

4.3.1 Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

4.4 STUHFL EVAL API wrapper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

4.4.1 Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

4.4.2 Frequency. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

4.4.3 Tuning. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

4.4.4 Gen2V2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

4.4.5 GB/T 29768 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

4.4.6 Inventory runner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18

UM2618Contents

UM2618 - Rev 3 page 20/23

Page 21: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

List of tablesTable 1. Main layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Table 2. Not exposed layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Table 3. Helper modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Table 4. Directory description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Table 5. API headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Table 6. Platform dependent headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Table 7. STUHFL connection functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Table 8. STUHFL parameter access functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Table 9. STUHFL data exchange functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Table 10. STUHFL maintenance functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Table 11. STUHFL Gen2V2 functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Table 12. STUHFL GB/T 29768 functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Table 13. STUHFL action functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Table 14. STUHFL EVAL API configuration functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Table 15. STUHFL EVAL API frequency settings functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Table 16. STUHFL EVAL API tuning functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Table 17. STUHFL EVAL API Gen2V2 functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Table 18. STUHFL EVAL API GB/T 29768 functionality. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17Table 19. STUHFL EVAL API inventory runner functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17Table 20. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

UM2618List of tables

UM2618 - Rev 3 page 21/23

Page 22: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

List of figuresFigure 1. System overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Figure 2. ST UHFL library system architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6Figure 3. ST UHF library usage overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Figure 4. ST UHF library EVAL API device side usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Figure 5. Directory structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Figure 6. STUHFL directory structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Figure 7. "inc" structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Figure 8. "Platform" directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

UM2618List of figures

UM2618 - Rev 3 page 22/23

Page 23: ST25RU3993 ST UHF library - User manual...The second project is for Arm platforms running on Linux devices. The Arm project uses the possibility to do remote compilation with VS2017

IMPORTANT NOTICE – PLEASE READ CAREFULLY

STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and improvements to STproducts and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. STproducts are sold pursuant to ST’s terms and conditions of sale in place at the time of order acknowledgement.

Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design ofPurchasers’ products.

No license, express or implied, to any intellectual property right is granted by ST herein.

Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.

ST and the ST logo are trademarks of ST. For additional information about ST trademarks, please refer to www.st.com/trademarks. All other product or servicenames are the property of their respective owners.

Information in this document supersedes and replaces information previously supplied in any prior versions of this document.

© 2020 STMicroelectronics – All rights reserved

UM2618

UM2618 - Rev 3 page 23/23