2025-10-10 9:03 AM - edited 2025-10-10 9:04 AM
Hi,
I am using this library on Rpi5:
https://www.st.com/en/embedded-software/stsw-st25r021.html#overview
I modified the gpio_init thusly
stError gpio_init(void)
{
int ret = 0;
char gpiochip_file[SIZE];
if (isGPIOInit) {
return ERR_NONE;
}
sprintf(gpiochip_file, "/dev/gpiochip4"); /* Open /dev/gpiochip0 */
int fd = open(gpiochip_file, O_RDONLY);
I modified the rfal_platform.h to correspond to my interrupt pin
/* Set the GPIO pin number used as interrupt line to receive interrupts from ST25R */
#define ST25R_INT_PIN 12 /*!< GPIO pin used for ST25R External Interrupt */
#define ST25R_INT_PORT (fd_GPIOs[0]) /*!<
But the demoIni function fails (I added some debug statements)
bool ok = demoIni();
printf("debug1, demoIni result %d\n", ok);
while ((!ok) || (ok && i--))
{
platformLedOn(PLATFORM_LED_FIELD_PORT, PLATFORM_LED_FIELD_PIN);
platformLedOn(PLATFORM_LED_A_PORT, PLATFORM_LED_A_PIN);
platformLedOn(PLATFORM_LED_B_PORT, PLATFORM_LED_B_PIN);
platformLedOn(PLATFORM_LED_F_PORT, PLATFORM_LED_F_PIN);
platformLedOn(PLATFORM_LED_V_PORT, PLATFORM_LED_V_PIN);
platformLedOn(PLATFORM_LED_AP2P_PORT, PLATFORM_LED_AP2P_PIN);
platformDelay(ok ? 200U : 100U);
platformLedOff(PLATFORM_LED_FIELD_PORT, PLATFORM_LED_FIELD_PIN);
platformLedOff(PLATFORM_LED_A_PORT, PLATFORM_LED_A_PIN);
platformLedOff(PLATFORM_LED_B_PORT, PLATFORM_LED_B_PIN);
platformLedOff(PLATFORM_LED_F_PORT, PLATFORM_LED_F_PIN);
platformLedOff(PLATFORM_LED_V_PORT, PLATFORM_LED_V_PIN);
platformLedOff(PLATFORM_LED_AP2P_PORT, PLATFORM_LED_AP2P_PIN);
platformDelay(ok ? 200U : 100U);
}
printf("debug2\n");
It obviously hangs within the while cycle as seen in the output:
sudo ./nfc_demo_st25r200
Welcome to the ST25R NFC Demo on Linux.
debug1, demoIni result 0
I checked my wiring three times, I use the SPI0 which should be the default in the demo.
Any ideas why it's not working?
All the best,
Michael
2025-10-10 11:06 AM
Hi,
Could describe your hardware setup? e.g. X-NUCLEO-NFC09A1 + interposer (ARPI600) or flying wires? Could you check that the ST25R100 reset pin is tied to Gnd.
Make sure to follow the various recommendations from User Manual UM3559.
Could you enable the ST25R_SELFTEST compilation switch to check the communication interface and the interrupt handling? Also I suggest to set a breakpoint in st25r200Initialize and step in.
Rgds
BT