Skip to main content
RShiv.1
Associate III
March 2, 2021
Solved

SPI interface for STM32L476VG

  • March 2, 2021
  • 185 replies
  • 63552 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

Brian TIDAL
Technical Moderator
March 9, 2021

Hi,

#include files are searched from include paths. This is configured in your project settings. Right click on your project, open the project properties, go to C/C++ Build/Settings then Tool Settings and in MCUGCC Compiler select Includes and add the various includes from the reference demo. You should not have to hardcode the path in your #include in the source files .

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
RShiv.1
RShiv.1Author
Associate III
March 9, 2021

Hi BT,

I have included the files from the actual path in the settings as you have mentioned..problemm here is the C files and .h files are not getting highlighted somehow in the project folder..how to include as part of ac6 ...if .h files are not included it would have given respective .h files not found..but here during compilation and linking stage not able to see the respective functions because c files are not compiled..no .o generated..more related to Ac6 compiler environment i guess.

regards

Ravi

RShiv.1
RShiv.1Author
Associate III
March 9, 2021

Hi BT,

Middleware files need to be compiled...I am not seeing during the build which means .0 files not getting created and hence not linking.

regards

Ravi

RShiv.1
RShiv.1Author
Associate III
March 9, 2021

Hi BT,

Makefile has not included middleware which means individual C files of rfal not compiled and is not able to link...thats the issue found..how do we add in the makefile??

manually or directly from ac6 compiler..just by adding middleware folder and refresh I thought it would take the files ...any other method??..let me know

rgds

Ravi

Brian TIDAL
Technical Moderator
March 9, 2021

Hi Ravi,

the makefile is autogenerated and should not be modified.

basically, you just need to drag the files from the Windows Explorer and drop to Ac6 System Workbench as explained in https://community.st.com/s/question/0D50X00009XkeidSAB/add-file-to-system-workbench-project.

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
RShiv.1
RShiv.1Author
Associate III
March 9, 2021

Hi BT,

even he has done the refresh and it has worked for him..I did the same thing ..yesterday it worked for me in the other project..do not know why now it is not working.

rgds

Ravi

RShiv.1
RShiv.1Author
Associate III
March 9, 2021

Hi BT,

problem of including the file got solved...go to properties->c/c++ general->path and symbols->source location->add middleware folder

rgds

ravi

RShiv.1
RShiv.1Author
Associate III
March 9, 2021

Hi BT,

coming to actual SPI issue

Now I have configured the SPI to required prescaler value...also I have included the ST25Rwrite and doing the read..not able to see the value...also SPI is failing.

Kindly please suggest how to read the SPI read and write

regards

Ravi

RShiv.1
RShiv.1Author
Associate III
March 9, 2021

Hi BT,

also sharing the IOC file..let me know

rgds

Ravi

Brian TIDAL
Technical Moderator
March 9, 2021

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.