Skip to main content
Visitor II
March 2, 2021
Solved

SPI interface for STM32L476VG

  • March 2, 2021
  • 185 replies
  • 63548 views

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?

    This topic has been closed for replies.
    Best answer by Brian TIDAL

    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

    185 replies

    RShiv.1Author
    Visitor II
    March 9, 2021

    Hi BT,

    I have tried with adding the code ..also attached is the main.c I could not use platformlog...I have used UARTMSG4 ...kindly have a look...It is saying SPI failed.

    I flashed into the hardware and I got this msg.kindly let me know.

    regards

    Ravi

    RShiv.1Author
    Visitor II
    March 9, 2021

    Hi BT,

    I tried doing

    st25r3911WriteRegister( ST25R3911_REG_BIT_RATE, ST25R3911_TEST_REG_PATTERN );

    and then st25r3911ReadTestRegister(buf2,val); I have attached the code ..kindly let me know where the problem is ..I am not getting value 0xx33 when I read...

    also SPI is failing...kindly guide me

    regards

    Ravi

    Technical Moderator
    March 9, 2021

    Hi Ravi,

    the SPI configuration is not correct. In STM32CubeMX, the SPI configuration should be:

    0693W000008wNT0QAM.png(make sure to adjust the prescaler value according to your clock frequency to keep the SPI speed under or equal to 6 Mbps)

    See also MX_SPI1_Init in the reference project for proper value if you want then to check the generated code.

    Rgds

    BT

    RShiv.1Author
    Visitor II
    March 9, 2021

    Hi BT,

    I tried changing the parameters..but I am getting following warning

        These IPs still have some not configured or wrong parameter values:

    [STMicroelectronics.X-CUBE-NFC4.2.0.2, Verify the Platform Settings Tab ]   

    where will I get platform setting tab for this??

    regards

    Ravi

    RShiv.1Author
    Visitor II
    March 9, 2021

    Hi BT,

    I tried going forward with warning but STMcubeMx generated folder called as NFC which has custom_nfc04a1.c ,should we need this

    In file included from ../NFC/custom_nfc04a1.c:57:0:

    ../NFC/custom_nfc04a1.h:49:10: fatal error: st25dv_conf.h: No such file or directory

    and I am seeing following error message.Kindly let me know.

    regards

    Ravi

    RShiv.1Author
    Visitor II
    March 9, 2021

    Hi BT,

    Under software pack -> manage software packages ->x-cube-NFC4 2.02 and 2.0.1 is showing as green ..whereas in select componens ..it says unreolvable dependencies.is there any issue which is causing this problem??..Thanks for all your support..we just want SPI functionality to be up..kindly guide us.

    regards

    Ravi

    RShiv.1Author
    Visitor II
    March 9, 2021

    Hi BT,

    I need to undo NFC packages in cubeMx which is for dynamic tags ...how shall I undo this so that I shall move on??

    regards

    Ravi

    RShiv.1Author
    Visitor II
    March 9, 2021

    Hi BT,

    attached is the ioc I am using..if you can revert the changes and let me know how I can port this will be useful.

    regards

    Ravi

    Technical Moderator
    March 9, 2021

    Hi Ravi,

    I would personally restart from scratch.

    Rgds

    BT

    RShiv.1Author
    Visitor II
    March 9, 2021

    Hi BT,

    I was able to create a new project and now I know the changes to be made where I can build from scratch.The issue what I am facing like yesterday's problem where

    undefined reference to `rfalNfcGetDevicesFound'

    C:\Users\RAVI\Documents\STM\UART_I2C_SPI_test\Debug/../Core/Src/demo.c:161: undefined reference to `rfalNfcSelect'

    Core/Src/demo.o: In function `demoIni':

    I have included the path in main.c ..what is happening is the files in middleware folder is not getting reflected in the ac6 project..any idea how this can be included so that I can compile and come to the actual SPI problem..kindly let me know

    regards

    Ravi