STSW-ST25R021 Linux sample not working with X-NUCLEO-NFC09A1 (ST25R100)
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 0I 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
