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 21, 2021

    Hi BT,

    configurations is as follows

    PA4-SPI1_CS

    PA5-SPI1_CLK

    PA6-SPI1_MISO

    PA7-SPI1_MOSI

    PA3-IRQ_3911-GPIO_EXTI3

    Now in main.h we have configured as follows

    /* Private defines -----------------------------------------------------------*/

    #define IRQ_3911_Pin GPIO_PIN_3

    #define IRQ_3911_GPIO_Port GPIOA

    #define IRQ_3911_EXTI_IRQn EXTI3_IRQn

    #define SPI1_CS_Pin GPIO_PIN_4

    #define SPI1_CS_GPIO_Port GPIOA

    #define SPI1_CLKPULLUP_Pin GPIO_PIN_5

    #define SPI1_CLKPULLUP_GPIO_Port GPIOA

    #define SPI1_MISO_PULLUP_Pin GPIO_PIN_6

    #define SPI1_MISO_PULLUP_GPIO_Port GPIOA

    #define SPI1_MOSI_PULLUP_Pin GPIO_PIN_7

    #define SPI1_MOSI_PULLUP_GPIO_Port GPIOA

    I have attached the main.h also..kindly let us know if these are fine as configurations..so that we will know from where to debug

    regards

    Ravi

    RShiv.1Author
    Visitor II
    May 21, 2021

    Hi BT,

    we are getting SPI succeeded but not the INT..attached is the main.c file also

    RShiv.1Author
    Visitor II
    May 21, 2021

    Hi BT,

    any suggestion from your side to debug from here will be good..waiting for your reesponse..Kindly let us know.

    Thanks and regards

    Ravi

    Technical Moderator
    May 21, 2021

    Hi,

    so you are ***not*** using ST25R3911B-DISCO but STM32L476G-DISCO.

    On STM32L476G-DISCO, PA0, PA1, PA2, PA3 and PA5 are connected to the blue Joystick B2. This is probably conflicting with the ST25R3911B IRQ. Either modify the board (e.g. remove R52) or find an unused PIO.

    Rgds

    BT

    RShiv.1Author
    Visitor II
    May 21, 2021

    Hi BT,

    yes we are trying to get RFID working on STM32L476G-DISCO along with NFC05A1.

    we have removed R52 ,R34 and R58 from the Disco board and have taken PA6 ,Pa7 connections from Seg 23 and Seg0 ..but still we are not seeing RFID val...also I have added return code(return code 4) as you had mentioned ..but I am not getting any print there...

    Any pointers..

    regards

    Ravi

    RShiv.1Author
    Visitor II
    May 21, 2021

    Hi BT,

    just to add ..we have removed the LCD on the Disco board...

    Technical Moderator
    May 21, 2021

    Hi,

    it seems you have configured PA3 with an internal pull up... This pull is conflicting with the IRQ....

    Please make sure to properly configure PA3 as follow:

    0693W00000AP9JbQAL.jpgRgds

    BT

    RShiv.1Author
    Visitor II
    May 21, 2021

    Hi BT,

    No we have made it as No pull up and no pull down ...I have attached the main.c for you

    regards

    Ravi

    RShiv.1Author
    Visitor II
    May 21, 2021

    Hi BT,

    also attached is the IOC file

    RShiv.1Author
    Visitor II
    May 21, 2021

    Hi BT,

    Kindly let me know the changes if any.

    Thanks and rgds

    Ravi