2021-03-01 11:32 PM
STM32L476VG is the MCU we are interfacing with ST25R3911B using SPI.
what we have understood from some search is that we need RFAL (abstraction layer) to interface with RF HAL.
Then once we integrate RFAL and RF HAL in our system workbench(ac6) project we need to build the integration then use SPI calls to read the register from RFID reader ST25R3911B
we wanted to use ISO-14443A standard to be configured and read the values.
where do we get the basic RFAL work space or code flow so that we shall use in our current project?
Kindly guide us and let us know are we in right path?
Solved! Go to Solution.
2021-03-09 10:14 AM
Hi Ravi,
the PA4 (SPI1_NSS) GPIO is not configured. It should be configured as Output Push-Pull, No pull up and no pull down, level Low, speed Low. I suggest also to check with your HW engineer that PA4 is properly connected to the /SS pin of the ST25R3911B.
Also, make sure to have the ST25R_SS_PIN and ST25R_SS_PORT configured for PA4 in platform.h (refer to the demo project where this is configured for PB6, see main.h for defines generated by STM32CubeMX).
Rgds
BT
2021-03-09 11:57 PM
2021-03-10 12:00 AM
Hi BT,
I am also attaching main.c where
st25r3911WriteRegister( buf2, ST25R3911_TEST_REG_PATTERN );
HAL_Delay(1000);
st25r3911ReadTestRegister(buf2,val);
is the syntax correct?...because we need to send a reg according to the function..just wanted to crosscheck on syntax.
first wanted to read write the register...
rgrds
Ravi
2021-03-10 12:20 AM
Hi BT,
I had used st25r3911ReadTestRegister instead of st25r3911ReadRegister. also I have changed the mode
st25r3911WriteRegister( ST25R3911_REG_MODE, ST25R3911_TEST_REG_PATTERN );
HAL_Delay(1000);
st25r3911ReadRegister(ST25R3911_REG_MODE,&val);
Let me know if this is correct.
rgrds
Ravi
2021-03-10 12:21 AM
Hi BT,
Now I am getting output val in val reg as 0xFF
2021-03-10 12:51 AM
Hi,
this is not in accordance with the st25r3911WriteRegister and therefore this is incorrect. .
Rgds
BT
2021-03-10 01:03 AM
Hi Ravi,
any reason not to use what we have suggested in previous posts for testing register read/write i.e writing a test pattern in ST25R3911_REG_BIT_RATE and reading back the value?
Anyway, obviously the SPI seems to be non operational.
Can you check with your HW engineer the pin assignment between the MCU and the ST25R3911B? Can you describe in details your HW setup: is it a custom board with the MCU and the ST25R3911B or do you use a X-NUCLEO_NFC05A1 connected to the MCU through wire jumpers? Can you connect a logic analyzer on the SPI (SPI CLK, SPI MOSI, SPI MISO and SPI SS) and check the signals?
Rgds
BT
2021-03-10 01:11 AM
HI BT,
Now I tested with ST25R3911_REG_BIT_RATE and SPI read register...then also I got 0xFF.
yes this is a custom board with STM32L476VG(MCU) connected to ST25R3911B...The custom board is already there to use and all SPI connections are already done.
will test the signals and let you know.
regards
Ravi
2021-03-10 02:11 AM
Hi Ravi,
Can you recheck the SPI configuration as it seems that CPHA=1Edge has been used instead of CPHA=2Edge. NSSP is also not having the proper value: it should be disabled. Also, as you system clock seems to be 4MHz (vs 48MHz in the demo), I believe the SPI prescaler can be set to 2 to reach 2Mbps.
Rgds
BT
2021-03-10 02:23 AM