2022-03-03 02:13 AM
We are prototyping a ST95HF NFC in combination with an embedded Linux board.
Since we can only find Linux demo code for the ST3916 on your website we
tried to combine the ST25r95 rfa library found in STSW-ST25RFAL003_v2.6.0
with the Linux demo code found in STSW-ST25R013 - Linux demo of ST25R3916 for Raspberry Pi using X-NUCLEO-NFC06A1 which has demo code based on RFAL 2.2.0
Our efforts so far to combine the code is able to to discover the technology of the card presented
but after this we end up with communication failures to/from the ST25r95 chip.
Is there code available of the Linux demo project for the ST25r95 for
version v2.6.0?
We successfully used the poller based version of Linux_RFAL_st25r95_v2.0.4 to read NFC cards, but this is version is too CPU intensive and version 2.6.0 seems to be a much improved version.
Solved! Go to Solution.
2022-03-03 06:22 AM
Hi,
as of today, Linux demos for Raspberry Pi have been officially released only for ST25R3911B and for ST25R3916 NFC reader devices.
The Linux_RFAL_st25r95_v2.0.4.tar.gz contains a snapshot of a non-released Linux demo of ST25R95 / CR95HF for Raspberry Pi using X-NUCLEO-NFC03A1
If you want to upgrade from the " Linux demo of ST25R3916 for Raspberry Pi using X-NUCLEO-NFC06A", I would suggest to use STSW-ST25RFAL003_v2.2.0 in order to have aligned RFAL version. Then, in plf_spi.c, make sure to use SPI_MODE_0 for SPI_MODE_CONFIG and 1500000 for SPI_MAX_FREQ. platformSpiSelect() and platformSpiDeselect() needs to be defined as platformGpioClear(ST25R95_N_SS_PORT, ST25R95_N_SS_PIN) and platformGpioSet(ST25R95_N_SS_PORT, ST25R95_N_SS_PIN) in platform.h when using cs_change = 1 in plf_spi.c or should be left empty if cs_change = 0 (as far as I remember cs_change seems not to behave as expected on some version of Linux, you may have to do some trials here).
In plf_gpio.h make sure to define PLTF_GPIO_INTR_PIN as ST25R95_N_IRQ_OUT_PIN which should be defined in platform.h (value=17).
ST25R95_N_IRQ_IN_PIN should be defined to 25 in platform.h and the GPIO should be cleared in gpio_init.
ST25R95_SSI0_PIN should be defined to 4 in platform.h and the GPIO should be set in gpio_init.
ST25R95_N_SS_PIN should be defined to 8 in platform.h.
Feel free to provide a Logic Analyzer trace if you still have SPI issues.
Rgds
BT
2022-03-03 02:13 AM
-- content moved to initial post
2022-03-03 06:22 AM
Hi,
as of today, Linux demos for Raspberry Pi have been officially released only for ST25R3911B and for ST25R3916 NFC reader devices.
The Linux_RFAL_st25r95_v2.0.4.tar.gz contains a snapshot of a non-released Linux demo of ST25R95 / CR95HF for Raspberry Pi using X-NUCLEO-NFC03A1
If you want to upgrade from the " Linux demo of ST25R3916 for Raspberry Pi using X-NUCLEO-NFC06A", I would suggest to use STSW-ST25RFAL003_v2.2.0 in order to have aligned RFAL version. Then, in plf_spi.c, make sure to use SPI_MODE_0 for SPI_MODE_CONFIG and 1500000 for SPI_MAX_FREQ. platformSpiSelect() and platformSpiDeselect() needs to be defined as platformGpioClear(ST25R95_N_SS_PORT, ST25R95_N_SS_PIN) and platformGpioSet(ST25R95_N_SS_PORT, ST25R95_N_SS_PIN) in platform.h when using cs_change = 1 in plf_spi.c or should be left empty if cs_change = 0 (as far as I remember cs_change seems not to behave as expected on some version of Linux, you may have to do some trials here).
In plf_gpio.h make sure to define PLTF_GPIO_INTR_PIN as ST25R95_N_IRQ_OUT_PIN which should be defined in platform.h (value=17).
ST25R95_N_IRQ_IN_PIN should be defined to 25 in platform.h and the GPIO should be cleared in gpio_init.
ST25R95_SSI0_PIN should be defined to 4 in platform.h and the GPIO should be set in gpio_init.
ST25R95_N_SS_PIN should be defined to 8 in platform.h.
Feel free to provide a Logic Analyzer trace if you still have SPI issues.
Rgds
BT