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-02 12:28 AM
Hi,
X-CUBE-NFC5 package provides an NFC polling demo using the RFAL and running on NUCLEO-L476RG (MCU board) + X-NUCLEO-NFC05A1 (ST25R3911B expansion board). It can be a good starting point for a project based on SYM32L476VG.
Rgds
BT
2021-03-02 12:28 AM
Hi,
X-CUBE-NFC5 package provides an NFC polling demo using the RFAL and running on NUCLEO-L476RG (MCU board) + X-NUCLEO-NFC05A1 (ST25R3911B expansion board). It can be a good starting point for a project based on SYM32L476VG.
Rgds
BT
2021-03-02 02:15 AM
Hi BT,
Thanks for your valuable inputs.I had a look into the package and also was able to compile it in ac6.
But we do not have a nucleo board to flash the same.we are currently using a custom board where we are integrating.
I would like to know if we can use the NFC package and folders such as middleware,directly copy and import into our project and compile??.also if I need to test the SPI interface how I can read the register in the ST25R3911B so that I know interfaces are fine.
kindly suggest how can we proceed from here it will very helpful.
regards
Ravi
2021-03-02 03:09 AM
Hi Ravi,
yes you can import the various rfal and middleware files into your project. Make sure to
For testing the SPI, you can for example add the following code in st25r3911Initialize() in line 133
#define ST25R3911_TEST_REG_PATTERN 0x33U
st25r3911WriteRegister( ST25R3911_REG_BIT_RATE, ST25R3911_TEST_REG_PATTERN );
if( !st25r3911CheckReg( ST25R3911_REG_BIT_RATE, (ST25R3911_REG_BIT_RATE_mask_rxrate | ST25R3911_REG_BIT_RATE_mask_txrate), ST25R3911_TEST_REG_PATTERN ) )
{
/* error handling here */
return;
}
/* Restore default value */
st25r3911WriteRegister( ST25R3911_REG_BIT_RATE, 0x00 );
Rgds
BT
2021-03-02 04:03 AM
Hi BT,
Thanks for your response.I was also trying to get the RFAL and middleware from STM32cubeMX.is this possible?
since I am newbee I was using older version 5.0.1 ,now I have installed recent version 6.1.2.
Here there are NFC bundle which can I select so that RFAL and middleware shall be generated..is this also possible? If so can you guide me.
Kindly throw some light on this.
regards
Ravi
2021-03-02 04:57 AM
Hi Ravi,
if I am not wrong, NFC packages in STM32CubeMX are for NFC Dynamic Tags.
The RFAL and middleware are available in X-CUBE-NFC5 (with support of SW4STM32 ac6) or in the ST25 Embedded NFC library (more examples provided and latest RFAL, with STM32CubeIDE as default IDE). As your IDE seems to be SW4STM32, I've suggested to use X-CUBE-NFC5 package even if not having the latest RFAL.
I would suggest that you define your pinout and configuration and clocking thanks to STM32CubeMX, and generate the "skeleton" of you project then import the RFAL files into your project and follow the steps described in How to start with ST25R3911B and is It really necessary to use rfal and st25r3911 libraries for simpel project?
Rgds
BT
2021-03-04 03:32 AM
Hi BT,
Thanks for you valuable inputs.I was able to add the drivers ,middleware into my project and was successfully able to compile.
1 There were few erros which I could solve by adding required .h files and alos pointing to specific path.
2 I have not used demo.c and demo.h in my project ,actually is it necessary?? Kindly let me know.
My defines are like this
#define SPI1_CS_Pin GPIO_PIN_6
#define SPI1_CS_GPIO_Port GPIOA
#define IRQ_3911_Pin GPIO_PIN_0
#define IRQ_3911_GPIO_Port GPIOA
My Interrupt pin PA3
chip select is PA4
we are using SPI1 .Until this configuration is correct we cannot read or write.Kindly let us know.
regards
Ravi
2021-03-04 04:08 AM
2021-03-04 04:10 AM
Hi BT,
I am getting following error when I try using St25Rwriteregister
C:\Users\RAVI\Documents\STM\UART_STM32_test\Debug/../Drivers/BSP/Components/ST25R3911/st25r3911_com.c:238: undefined reference to `globalCommProtectCnt'
this is define in platform.h ,then why I am getting the error..should I define this in any of the files.
Kindly let me know.
regards
Ravi
2021-03-04 04:13 AM
Hi BT,
sorry to add too many questions...since we are using IRQ ..once IRQ is send from ST25R3911 to STM32L476VG I need to read the SPI register.
this will help us to read values.Kindly guide us.
regards
Ravi