2020-11-04 09:32 AM
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
Solved! Go to Solution.
2020-11-05 04:30 AM
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
2020-11-04 02:19 PM
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.
Thanks
Rgds
BT
2020-11-05 03:59 AM
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:
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?
2020-11-05 04:17 AM
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):
Measuring the IRQ_IN pin, we see it pulsing to 0 in the commandEcho function, but the error is the same.
2020-11-05 04:30 AM
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
2020-11-05 04:55 AM
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