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
RShiv.1
Senior

Hi BT,

waiting for your reply..kindly let us know how to proceed from here..

regards

Ravi

Brian TIDAL
ST Employee

Hi Ravi,

do you mean your X-NUCLEO-NFC05A1 has no crystal? i.e. someone has unsoldered the exiting crystal on this board?

For your information, the X-NUCLEO-NFC05A1 comes with XRCGB27M120F3M00R0 27.1200MHz crystal.

The oscillator can operate with 13.56 MHz and 27.12 MHz crystals. Use of 27.12 MHz crystal is recommended for better performance.

From firmware point of view, IO configuration register 1 (00h) bit 3 has to be configured in accordance with 13.56 or 27.12 MHz crystal. This is done in st25r3911Initialize : replace   st25r3911WriteRegister(ST25R3911_REG_IO_CONF1, ST25R3911_REG_IO_CONF1_osc); with   st25r3911WriteRegister(ST25R3911_REG_IO_CONF1, 0x00);

Anyway, I would strongly suggest to use a genuine/unmodified X-NUCLEO-NFC05A1 with its original crystal.

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,

thanks for your reply.As per previous post there was no activity seen from the crystal side...we were not getting any INterrupt because crystal not working.

so we thoght of changing the crystal and we only have 13.56 Mhz now to check...we have paralley ordered new NFC to check...we wil make the changes are

revert for any thing required

regards

Ravi

RShiv.1
Senior

Hi BT,

The configuration you mentioned and what we have in the file is different ..kindly let us know whether in the file and in the function st25r3911Initialize()

is configured for what frequency crystal...

 st25r3911WriteRegister(ST25R3911_REG_IO_CONF1, 0x00); already present in st25R3911 for 13.56 Mhz

kindly let me know whether we need to change the configuration for 27.12?? if so I think we need to add

st25r3911WriteRegister(ST25R3911_REG_OP_CONTROL, ST25R3911_REG_IO_CONF1_osc); this I guess..let me know

Thanks and regards

Ravi

Brian TIDAL
ST Employee

Hi,

X-NUCLEO-NFC05A1 is supposed to be functional when shipped from the board manufacturer. I would suggest to check the soldering of the existing 27.12 crystal.

Also, can you add the following code at the end of st25r3911OscOn():

/* Double check that OSC_OK signal is set */
    if( !st25r3911CheckReg( ST25R3911_REG_AUX_DISPLAY, ST25R3911_REG_AUX_DISPLAY_osc_ok, ST25R3911_REG_AUX_DISPLAY_osc_ok ) )
    {
        plateformLog("Osc not running\r\n");
    }

Regarding st25r3911WriteRegister(ST25R3911_REG_IO_CONF1, 0x00); you probably mix with st25r3911WriteRegister(ST25R3911_REG_OP_CONTROL, 0x00);

Anyway, in this version of code, as the default reset value for ST25R3911_REG_IO_CONF1 is osc=27.12MHz, it is not explicitly set. If you really want to try a 13.56MHz crystal, you'll have to add st25r3911WriteRegister(ST25R3911_REG_IO_CONF1, 0x00); after the SET_DEFAULT command (st25r311.c line 125)

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,

had a query in continuation with our zest to get RFID working using ST25R3911..In our custom board we are using 13.56 Mhz crystal..Now do you suggest us to add

 st25r3911WriteRegister(ST25R3911_REG_IO_CONF1, 0x00); this code to check whether crystal is working or not??...This code shoudl be added after

st25r3911WriteRegister(ST25R3911_REG_OP_CONTROL, 0x00); this code right??..Kindly let us know.

In custom board we are getting return 4 error means no INTERRUPT right??

thanks and regards

ravi

RShiv.1
Senior

Hi BT,

any update on my previous query I had ..kindly let us know.

regards

Ravi

Brian TIDAL
ST Employee

Hi,

as explained previously,  IO configuration register 1 (ST25R3911_REG_IO_CONF1) bit 3 has be configured in accordance with 13.56 or 27.12 MHz crystal. See ST25R3911B datasheet § 1.3.1 IO configuration register 1.

So,

  • for a 27.12 MHz crystal, ST25R3911_REG_IO_CONF1 bit 3 has to be 1 which is the default reset value
  • for a 13.56 MHz crystal, ST25R3911_REG_IO_CONF1 bit 3 has to be 0. In that case, an explicit st25r3911WriteRegister(ST25R3911_REG_IO_CONF1, 0x00); is needed before st25r3911OscOn() in st25r3911Initialize().

Then, Auxiliary display register (ST25R3911_REG_AUX_DISPLAY) bit 4 (osc_ok) indicates that Xtal oscillator is active and its output is stable. This is why I've suggested to add the following code at then end of st25r3911OscOn():

/* Double check that OSC_OK signal is set */
    if( !st25r3911CheckReg( ST25R3911_REG_AUX_DISPLAY, ST25R3911_REG_AUX_DISPLAY_osc_ok, ST25R3911_REG_AUX_DISPLAY_osc_ok ) )
    {
        plateformLog("Osc not running\r\n");
    }

The rational is to avoid to have to probe the crystal as the probe may affect the crystal behavior. If value of bit4 of Auxiliary display register is 0, then the crystal is not oscillating.

Also, make sure your crystal respects the recommandation from the datasheet, in particular the ESRMax (equivalent series resistance max value) is 150 Ohm.

You can as well check that the crystal has not been 90° rotated before being soldered on the PCB.

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 bidal,

As we were trying to get the SPI working in case of STM32476VG and 407VE we successfully were able to get RFID working individually in separate chip.

we were trying to integarte for one of our fingerprint sensor application along with RFID and when we integrate SPI init fails.attached is the document which explains the issue.Kindly throw some light on this.

Thanks and regards

Ravi

Hi Ravi,

yes, looks like an issue on your SPI2. Look into the registers of the corresponding GPIO block, look into SPI block, look into schematics of your boards, ...

Better than on ST25 Forum you may get help on STM32 since it is clearly about the MCU and not the RF chip.

Regards, Ulysses