2022-07-18 06:03 AM
Dear Sir,
We are going to write a ST25R3916 driver (only support SO15693) for our platform which use ThreadX RTOS. As a porting reference, could you tell me where I can get the source code of ST25R3916 driver?
best regards
Dai Sai
Solved! Go to Solution.
2022-07-19 02:05 AM
Dear Dai,
I would suggest to use the ST25NFC_Embedded_Lib_ST25R3916_1.4.0\Projects\STM32L476RG-Nucleo\Applications\X-NUCLEO-NFC06A1\FreeRTOS_polling demo from STSW-ST25R016 (ST25 embedded NFC library for ST25R3916 reader and tag products 1.4.0). It is based on the same RFAL version than STSW-ST25RFAL002 (RFAL for ST25R3916ST 2.6.0) but includes an NFC polling demo showing how to use the RFAL API.
Basically, you'll have to include in your project the files from ST25NFC_Embedded_Lib_ST25R3916_1.4.0\Middlewares\ST\RFAL and ST25NFC_Embedded_Lib_ST25R3916_1.4.0\Middlewares\ST\RFAL\source\st25r3916.
In order to use only ISO 15693, you just need to customise the platform.h as follow:
#define RFAL_FEATURE_LISTEN_MODE false /*!< Enable/Disable RFAL support for Listen Mode */
#define RFAL_FEATURE_WAKEUP_MODE false /*!< Enable/Disable RFAL support for the Wake-Up mode */
#define RFAL_FEATURE_LOWPOWER_MODE false /*!< Enable/Disable RFAL support for the Low Power mode */
#define RFAL_FEATURE_NFCA false /*!< Enable/Disable RFAL support for NFC-A (ISO14443A) */
#define RFAL_FEATURE_NFCB false /*!< Enable/Disable RFAL support for NFC-B (ISO14443B) */
#define RFAL_FEATURE_NFCF false /*!< Enable/Disable RFAL support for NFC-F (FeliCa) */
#define RFAL_FEATURE_NFCV true /*!< Enable/Disable RFAL support for NFC-V (ISO15693) */
#define RFAL_FEATURE_T1T false /*!< Enable/Disable RFAL support for T1T (Topaz) */
#define RFAL_FEATURE_T2T false /*!< Enable/Disable RFAL support for T2T */
#define RFAL_FEATURE_T4T false /*!< Enable/Disable RFAL support for T4T */
#define RFAL_FEATURE_ST25TB false /*!< Enable/Disable RFAL support for ST25TB */
#define RFAL_FEATURE_ST25xV true /*!< Enable/Disable RFAL support for ST25TV/ST25DV */
#define RFAL_FEATURE_DYNAMIC_ANALOG_CONFIG false /*!< Enable/Disable Analog Configs to be dynamically updated (RAM) */
#define RFAL_FEATURE_DPO false /*!< Enable/Disable RFAL Dynamic Power Output support */
#define RFAL_FEATURE_ISO_DEP false /*!< Enable/Disable RFAL support for ISO-DEP (ISO14443-4) */
#define RFAL_FEATURE_ISO_DEP_POLL false /*!< Enable/Disable RFAL support for Poller mode (PCD) ISO-DEP (ISO14443-4) */
#define RFAL_FEATURE_ISO_DEP_LISTEN false /*!< Enable/Disable RFAL support for Listen mode (PICC) ISO-DEP (ISO14443-4) */
#define RFAL_FEATURE_NFC_DEP false /*!< Enable/Disable RFAL support for NFC-DEP (NFCIP1/P2P) */
In the FreeRTOS port, we have a dedicated ISR task to manage the ST25R3916 interrupt (see nfcIsrTaskRunner). This task waits for a notification of the ST25R3916 interrupt and calls st25r3916Isr() I believe, a dedicated thread can be used in ThreadX RTOS port for managing the ST25R3916 interrupt. Make sure to implement platformProtectST25RComm and platformUnprotectST25RComm macros (in FreeRTOS, this is a simple enter/exit critical section).
For the timer management, I would suggest to have a look on plfTimerXXX fonction in plf_adaptation.c and try to port in a similar way to ThreadX RTOS.
The main task runs the polling demo initialization and then loops forever on the NFC polling. I believe, it can be ported in a similar way to ThreadX RTOS
Rgds
BT
2022-07-18 07:00 AM
Hi,
the ST25 embedded NFC library provides an example of ST25R3916 RF Abstraction Layer (RFAL) porting on FreeRTOS. It should be a good starting point for porting to ThreadX RTOS.
The ST25R3916 RF Abstraction Layer (RFAL) is a scalable and portable C language source code library. A platform.h file is used to configure the various protocols for a given application and is used to define the interface to the external services (timer, SPI communication, log;,etc.).
Rgds
BT
2022-07-18 07:35 PM
Dear Brian TIDAL,
Thank you very much for your quick reply.
Based on your advise, I found two RFAL source in St.com.
One is
STSW-ST25R016ST25 embedded NFC library for ST25R3916 reader and tag products1.4.0,
another one is
STSW-ST25RFAL002RFAL for ST25R3916ST2.6.0
Is the second one :STSW-ST25RFAL002RFAL the newest version and fit for my purpose?
In the library package, I found only four source files that contain keyword of 15693.
Should I start to port from them?
best regards
Dai
2022-07-18 08:04 PM
supplement for the above message.
I forgot to write the four files name.
The four files are
rfal_nfcv.h, rfal_nfcv.c, rfal_iso15693_2.h, rfal_iso15693_2.c
2022-07-19 02:05 AM
Dear Dai,
I would suggest to use the ST25NFC_Embedded_Lib_ST25R3916_1.4.0\Projects\STM32L476RG-Nucleo\Applications\X-NUCLEO-NFC06A1\FreeRTOS_polling demo from STSW-ST25R016 (ST25 embedded NFC library for ST25R3916 reader and tag products 1.4.0). It is based on the same RFAL version than STSW-ST25RFAL002 (RFAL for ST25R3916ST 2.6.0) but includes an NFC polling demo showing how to use the RFAL API.
Basically, you'll have to include in your project the files from ST25NFC_Embedded_Lib_ST25R3916_1.4.0\Middlewares\ST\RFAL and ST25NFC_Embedded_Lib_ST25R3916_1.4.0\Middlewares\ST\RFAL\source\st25r3916.
In order to use only ISO 15693, you just need to customise the platform.h as follow:
#define RFAL_FEATURE_LISTEN_MODE false /*!< Enable/Disable RFAL support for Listen Mode */
#define RFAL_FEATURE_WAKEUP_MODE false /*!< Enable/Disable RFAL support for the Wake-Up mode */
#define RFAL_FEATURE_LOWPOWER_MODE false /*!< Enable/Disable RFAL support for the Low Power mode */
#define RFAL_FEATURE_NFCA false /*!< Enable/Disable RFAL support for NFC-A (ISO14443A) */
#define RFAL_FEATURE_NFCB false /*!< Enable/Disable RFAL support for NFC-B (ISO14443B) */
#define RFAL_FEATURE_NFCF false /*!< Enable/Disable RFAL support for NFC-F (FeliCa) */
#define RFAL_FEATURE_NFCV true /*!< Enable/Disable RFAL support for NFC-V (ISO15693) */
#define RFAL_FEATURE_T1T false /*!< Enable/Disable RFAL support for T1T (Topaz) */
#define RFAL_FEATURE_T2T false /*!< Enable/Disable RFAL support for T2T */
#define RFAL_FEATURE_T4T false /*!< Enable/Disable RFAL support for T4T */
#define RFAL_FEATURE_ST25TB false /*!< Enable/Disable RFAL support for ST25TB */
#define RFAL_FEATURE_ST25xV true /*!< Enable/Disable RFAL support for ST25TV/ST25DV */
#define RFAL_FEATURE_DYNAMIC_ANALOG_CONFIG false /*!< Enable/Disable Analog Configs to be dynamically updated (RAM) */
#define RFAL_FEATURE_DPO false /*!< Enable/Disable RFAL Dynamic Power Output support */
#define RFAL_FEATURE_ISO_DEP false /*!< Enable/Disable RFAL support for ISO-DEP (ISO14443-4) */
#define RFAL_FEATURE_ISO_DEP_POLL false /*!< Enable/Disable RFAL support for Poller mode (PCD) ISO-DEP (ISO14443-4) */
#define RFAL_FEATURE_ISO_DEP_LISTEN false /*!< Enable/Disable RFAL support for Listen mode (PICC) ISO-DEP (ISO14443-4) */
#define RFAL_FEATURE_NFC_DEP false /*!< Enable/Disable RFAL support for NFC-DEP (NFCIP1/P2P) */
In the FreeRTOS port, we have a dedicated ISR task to manage the ST25R3916 interrupt (see nfcIsrTaskRunner). This task waits for a notification of the ST25R3916 interrupt and calls st25r3916Isr() I believe, a dedicated thread can be used in ThreadX RTOS port for managing the ST25R3916 interrupt. Make sure to implement platformProtectST25RComm and platformUnprotectST25RComm macros (in FreeRTOS, this is a simple enter/exit critical section).
For the timer management, I would suggest to have a look on plfTimerXXX fonction in plf_adaptation.c and try to port in a similar way to ThreadX RTOS.
The main task runs the polling demo initialization and then loops forever on the NFC polling. I believe, it can be ported in a similar way to ThreadX RTOS
Rgds
BT
2022-07-19 05:51 AM
Dear Brian TIDAL,
Thank you very much for your valuable information and useful suggestion about the library and
porting approach.
Based on your suggestion, We will try to develop and realize the function of ISO15693 reader and writer
on our ThreadX platform.
. best reagards
Dai Sai
2022-07-22 06:52 PM
Dear Brian TIDAL,
As we are reading the source code of the FreeRTOS example you suggested, we can not find ndefExampleRead() and ndefExampleWrite() that are used in void demoCycle( void ).
Could you like to give me some information about them?
best regards
Dai Sai
2022-07-23 08:47 AM
Dear Dai,
the ST25NFC_Embedded_Lib_ST25R3916 library comes with several different demos:
If you need to run NDEF read/write in your application, you can easily modify the FreeRTOS demo to run the ndef_demo.c as both use the main loop entry point (demo_cycle) and the same init entry point (demo_ini). In the FreeRTOS project,
In the ndef_demo.c, as soon as a tag is found, the demo_cycle performs the NDEF detect and then an NDEF read and dump the NDEF content on the trace serial port. When used on STM32 nucleo board, the user can also trigger an NDEF Write thanks to the user button on the board (this is just a simple read GPIO). See AN5616 for more details.
Regarding ndefExampleRead() and ndefExampleWrite(), those examples are located in Middlewares\ST\NDEF\doc\examples. This is simple examples showing how to use the NDEF library. I would recommend to rather use ndef_demo.c as this provides an integrated demo.
Rgds
BT
2022-07-23 05:54 PM
Dear Brian TIDAL,
Thank you very much for your reply.
Based on your explanation, we got demoCycle() in demo_polling.c. We went to
ndef_example_wrapper.c before. I will continue the porting by referring demo_polling.c.
thank you again for your great help.
best regards
Dai Sai