cancel
Showing results for 
Search instead for 
Did you mean: 

SPI interface for STM32L476VG

RShiv.1
Senior

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?

190 REPLIES 190
Brian TIDAL
ST Employee

Hi,

 hspi1.Init.NSS = SPI_NSS_HARD_OUTPUT; is incorrect. It should be  hspi1.Init.NSS = SPI_NSS_SOFT; Can you verify this parameter in your STM32CubeMX configuration?

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
Senior

Hi BT,

yes I even changed when I was doing other changes and did the test..still no SPI ouput values..

Hope from S/W side we are all correct so that atleast hardware wise we can test.

regards

Ravi

Brian TIDAL
ST Employee

Hi,

this looks like an HW/board issue. Make sure to verify the HW pin assignment and check that the ST25R3911B is properly powered.

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
Senior

Hi BT,

Appreciate your efforts in replying to my queries patiently ..thanks for your support.

will let you know once I do my H/W testing...keep you posted.

regards

Ravi

RShiv.1
Senior

Hi BT,

Just let me know if there any other configuaration issue..so that I can do and let you know.

regards

Ravi

RShiv.1
Senior

Hi BT,

attaching the defines for SPI_CS_PIN and SPI1_CS_GPIO_Port 

#define SPI1_CS_Pin GPIO_PIN_4

#define SPI1_CS_GPIO_Port GPIOA

#define IRQ_3911_Pin GPIO_PIN_3

#define IRQ_3911_GPIO_Port GPIOA

just let me know if this also fine.

rgrds

Ravi

Brian TIDAL
ST Employee

Hi,

well, I do not see PA4  (SPI1_CS) GPIO being configured... if it is not configured, then platformSpiSelect will have no effect, the SS will stay flat and the ST25R3911B will never reply... It should be configured in STM32CubeMX as Output Push-Pull, No pull up and no pull down, level Low, speed Low.

Also PA3 (IRQ_3911) should be configured in interrupt rising mode. I've attached a reference IOC so that you can check you configuration.

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
Senior

Hi BT,

attached is the main.c after changing to SPI_NSS_HARD_OUTPUT..still no values seen..currently I am not using PA3 to test basic SPI test.

is that necessary now..i thought once basics are fine then enable INT and check..let me know.

regards

Ravi

Brian TIDAL
ST Employee

Hi,

as explained in previous posts  hspi1.Init.NSS = SPI_NSS_HARD_OUTPUT; is ***incorrect***... it should be  SPI_NSS_SOFT

I still haven't seen any initialisation of PA4.

Have you re generated from 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.
RShiv.1
Senior

Hi BT,

if this is configured as hspi1.Init.NSS = SPI_NSS_HARD_OUTPUT; ***then PA4 is seen ***in STMcubeMx under GPIO settings and in main.c it reflects as

 hspi1.Init.NSS = SPI_NSS_HARD_OUTPUT;

if this is configured as hspi1.Init.NSS = SPI_NSS_SOFT then ;****PA4 is not seen ***in STMcubeMx under GPIO settings .

I think this has to be hspi1.Init.NSS = SPI_NSS_HARD_OUTPUT as this is chip select for SPI1...correct me if I am wrong.

regards

Ravi