0.3.3-s1.4.0 • Public • Published


A modified STMicroelectronics library for ST25R3911B, ST25R3916 and ST25R95.

There are many libraries for NFC. The STSW-ST25R-LIB was chosen as the core library with the option to integrate beneficial changes from the other libraries.

STSW-ST25RFAL (v2.6.0)


This library contains just the RFAL (RF Abstraction Layer) found in STSW-ST25R-LIB. It is probably not needed unless the STSW-ST25R-LIB RFAL is lagging behind in versions.

STSW-ST25R-LIB (v1.4.0)



  • STSW-ST25R015: ST25R3911B
  • STSW-ST25R016: ST25R3916
  • STSW-ST25R017: ST25R95

This library contains mostly the same files as STSW-ST25RFAL but has BSP (Board Support Packages), an NDEF layer and some project examples.

Notably, it has extra features:

Additional notes:

  • Drivers/BSP/Components/ST25DV is for communicating with the ST25 dynamic tags via I2C while Middlewares/ST/ST25Tags is for communicating with ST25 dynamic tags via NFC.
  • Headers (*.h files) that appear in a src/source folder are part of a private interface and should not be directly used in application code. Headers in an inc/include folder are part of a public interface and can be used in application code. However, both folders need to be part of the include path for compilation.



  • ST25DV (dynamic tag via I2C) BSP
  • NFC04 and NFC06A BSP
  • Several NDEF record types
  • ST25FTM (Fast Transfer Mode) Support
  • ST25Tags (dynamic tag via RFAL) support

Additional notes:

  • X-CUBE-NFC uses Drivers/BSP/Components/ST25R* for chip driver while STSW-ST25RFAL uses Middlewares/ST/RFAL/source/st25r*. The BSP is designed to support a specific PCB layout. The structure in STSW-ST25RFAL is preferred.
  • X-CUBE-NFC implements NDEF types ndef_types_mime and ndef_types_rtd differently to STSW-ST25R-LIB. The STSW-ST25R-LIB is more recent and thus is the preferred option.
  • X-CUBE-NFC library has oudated docs compared to STSW-ST25R-LIB.


Headers that (1) include the name _template or (2) are not in an inc/include or src/source folder, are considered as templates and should be copied into the application code inc/include folder where they can be edited for the specific application.

  • Drivers/BSP/NFC06A1/nfc03a1_conf_template.h
  • Drivers/BSP/NFC06A1/nfc04a1_conf_template.h
  • Drivers/BSP/NFC06A1/nfc06a1_conf_template.h
  • Middlewares/ST/NDEF/include/ndef_config.h
  • Middlewares/ST/NDEF/include/ndef_config_custom.h
  • Middlewares/ST/RFAL/include/platform_template_st25r95.h
  • Middlewares/ST/RFAL/include/platform_template_st25r3911.h
  • Middlewares/ST/RFAL/include/platform_template_st25r3916.h
  • Middlewares/ST/ST25FTM/st25ftm_config_template.h

Note that the rfal_features.h header is not a template. It contains boolean flags for the capabilities of the RFAL library for a particular chip. Do not attempt to "disable" or "enable" features by modifying this file as these flags do not change the functionality of the library. They should be considered as readonly. Instead, the platform.h file (create from a template) can be used to enable or disable the features provided by a particular chip.

Library Modifications

Additional features

  • Added PDF docs
  • Added BSP for NFC03A1 dev board
  • Added more polling intervals for interrupt card detection
  • Support for SWO logging

Bug fixes

  • Fix bug in RFAL for st25r95 where hard coded wakeup period was used
  • Fix bug in st_errno.h where missing stint header gave compilation errors.



Package Sidebar


npm i @displode/stsw-st25r-lib-xpack

Weekly Downloads





SEE LICENSE IN LICENCES.txt and SLA0052_my_mix.pdf

Unpacked Size

3.61 MB

Total Files


Last publish


  • displode-bot
  • johnmaree
  • nicreuss