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
    May 20, 2021

    Hi BT,

    also attaching the main.c file

    RShiv.1Author
    Visitor II
    May 20, 2021

    Hi BT,

    since Interrupt is coming from ST25R3911 it must be GPIO_INPUT..is this correct??

    regards

    Ravi

    Technical Moderator
    May 20, 2021

    Hi,

    as explained in previous posts, the PA3 GPIO connected to the interrupt line has to be configured as GPIO_EXTI3 external interrupt mode with rising edge trigger detection.

    If the interrupt is not seen, I suggest to check the board with your HW engineer.

    Rgds

    BT

    RShiv.1Author
    Visitor II
    May 20, 2021

    Hi Bt,

    But we are using discovery board along with NFC05A1...even here the interrupt is not seen...then do you suggest this as hardware issue??.

    regards

    ravi

    Technical Moderator
    May 20, 2021

    Hi, You mean you are using the ST25R3911B-DISCO and have connected the SPI + IRQ from X-NUCLEO-NFC05A1 on P204 points and have isolated the onboard ST25R3911B?

    Well, in that case, the IRQ pin is connected to PA0 EXTI0 (see schematicshttps://www.st.com/content/ccc/resource/technical/layouts_and_diagrams/schematic_pack/group0/71/e3/fd/6c/0c/db/42/21/Schematics-ST25R3911B-DISCO-MB1325/files/Schematics-ST25R3911B-DISCO-MB1325.PDF/jcr:content/translations/en.Schematics-ST25R3911B-DISCO-MB1325.PDF).

    So if using the the ST25R3911B-DISCO, you have to modify you SW to use PA0 instead of PA3.

    Rgds

    BT

    RShiv.1Author
    Visitor II
    May 20, 2021

    Hi BT,

    yes we are testing with ST25R3911B-DISCO first and checking if all are fine..then we will mover to our custom board..we will change to PA0 and let you know.

    we are having the same matching circuit as in disco board and also our custom board..anyways will test and let you know.

    regards

    Ravi

    RShiv.1Author
    Visitor II
    May 20, 2021

    Hi BT,

    As we are using nucleo board NFC05A1 - and STM32L476VG ...we are wired from PA3 ..so anything PA0 or PA3 can be configured right and also

    in main.h we have pointed IRQ pins as follows

    #define IRQ_3911_Pin GPIO_PIN_3

    #define IRQ_3911_GPIO_Port GPIOA

    #define IRQ_3911_EXTI_IRQn EXTI3_IRQn

    is this correct?..if we configure for PA3 then this becomes GPIO_PIN_3 and if PA0 GPIO_PIN_0...is this methodology correct??

    I think we had configured this to pin 0 and EXTI0 ....let me know

    regards

    Ravi

    RShiv.1Author
    Visitor II
    May 20, 2021

    Hi BT,

    Kindly look into main.h and let me know whether it is pointing to correct pin values.

    regards

    Ravi

    RShiv.1Author
    Visitor II
    May 21, 2021

    Hi BT,

    Any suggestion from your side on the PA3 pins I had sent to you...we can use either PA3 or PA0 but ensure that we have configured for GPIO_EXTI3...our

    concern is on the main.h file where I had sent you the pin configuration we have made..any changes there kindly let us know.

    regards

    Ravi

    RShiv.1Author
    Visitor II
    May 21, 2021

    Hi BT,

    attached is the img of X-nucleo-NFC05A1 along with STM32L476G-disco board which we have connected .Here we have used PA3 and configured the same in stmcubeMX as said in our previous post.