cancel
Showing results for 
Search instead for 
Did you mean: 

Can't make ST25R95 example to work in my MCU

AKäfe.1
Associate II

Hello guys

I'm using the STM32F070CB MCU in a custom board connecting SPI pins and IRQ pins to the MCU and trying to scan for NFC devices. We've tested the board and the ST25R95 with std32duino libraries and we could make it work, but we needed to see UIDs and we could'nt read it in Arduino IDE and changed platform to use STM32CubeIDE.

We have some errors when calling initialize functions, rfalInitialize does return error in st25r95Initialize() (ERR_SYSTEM). IRQ_I and NSS pins have correct signals but I think we're missing something on the configuration.

We think it could have something about USART3, because it shares CTS/RTS and SCK/MISO pins from SPI2, but we couldn't figure it out.

Thanks in advance

Arthur Käfer

1 ACCEPTED SOLUTION

Accepted Solutions
Brian TIDAL
ST Employee

Hi,

if you can plug a logic analyzer on the SPI, it would help to analyze the issue.

I've attached my STM32CubeMX ioc file so that you can compare. For SPI, make sure to have Full Duplex Master, Hardware NSS Disable, 8 bits/Moto/MSB first, CPOL Low, CPHA Edge, NSS Signal type: software.

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.

View solution in original post

5 REPLIES 5
Brian TIDAL
ST Employee

Hi,

ERR_SYSTEM in st25r95Initialize() means that after the startup sequence, the MCU fails to properly receive an answer to the echo command after 5 attemps. This basically means that the SPI communication fails. Can you plug a logic analyzer on SPI (including CS) + IRQ_IN + IRQ_OUT + SSI_0 + SSI_1 and send me the log?

Also, make sure that.

  • SSI_0=1 and SSI_1=0
  • the ST25R95 is properly powered
  • the 27.12 MHz is properly oscillating

Thanks

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.
AKäfe.1
Associate II

We can't plug a logic analyzer right now because it's hard to access the SPI pins, but we can provide some informations I got from the oscilloscope that you requested:

  • SSI_0 is forced to 3V3 and SSI_1 is grounded, directly from our board;
  • ST25R95 is properly powered (3.28V);
  • 27.02MHz measured on the oscillator.

I don't understand how I made it work on the other platform and on Cube I can't make it work. Is there a specific SPI configuration I have to make in CubeMX to make it work?

AKäfe.1
Associate II

Actually, we have access to the SPI pins (my bad), is it useful to measure them in the starting routine and pass the results for you?

As a starting point, we have this (no pull-up/pull-down configuration on Cube, just hardware pulled):

  • SPI1_MISO: 3.3V
  • SPI1_MOSI: 0V
  • SPI1_SCK: 0V
  • SPI1_SS: 3.3V

0693W000005AShcQAG.png 

Measuring the IRQ_IN pin, we see it pulsing to 0 in the commandEcho function, but the error is the same.

Brian TIDAL
ST Employee

Hi,

if you can plug a logic analyzer on the SPI, it would help to analyze the issue.

I've attached my STM32CubeMX ioc file so that you can compare. For SPI, make sure to have Full Duplex Master, Hardware NSS Disable, 8 bits/Moto/MSB first, CPOL Low, CPHA Edge, NSS Signal type: software.

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.
AKäfe.1
Associate II

Hi,

We are using this example as a base model for our code, it builds and goes ok, but the error is the same.

set

I noted something on the SPI_SS pin while measuring it, during st25r95resetChip (rfalInitialize()), the value on the pin stays on 1, but it should go to 0 when trying to reset it.

We changed our SPI config to use the same you provided, changing the SPI-SS pin to GPIO to control it correctly. We're noting some changes on the MOSI and MISO pins and it worked without any errors!

The changes we had to make should be SPI_SS as a GPIO, probably could be baudrate too, we were using it at max speed, and now it is starting without any errors.

Thanks for the help

Arthur Käfer