cancel
Showing results for 
Search instead for 
Did you mean: 

How can I connect STM32G071 board with ST25R3911B chip (X-NUCLEO-NFC05A1)?

EElec.2
Associate II

Hello there, STM32 community!

I am new to the STM32 family and I am currently working on a project to read and write Mifare Classic and Desfire tags. For this, I am using an STM32G071-NUCLEO64 microcontroller and a X-NUCLEO-NFC05A1 (ST25R3911B) board connected via SPI. I have been trying to establish the SPI connection between the two devices and send/receive data, but so far, I have not been successful.

Initially, I tried to use the SPI example provided in STM32CubeIDE, but I was not able to receive data correctly.

Then, I followed a post on the ST community website to use the RFAL/NDEF libraries for my project. However, the post was for the 32f070RB board, and I had to make some modifications to make it work with my hardware.

Unfortunately, after copying the RFAL and NDEF libraries into my project, modifying the platform.h file, and adding the necessary modules, I am still unable to get it working.

The error I am receiving is:

#define ERR_HW_MISMATCH ((ReturnCode)36U) /*!< expected hw do not match */

after executing rfalNfcInitialize().

I am feeling lost and unable to find a suitable example for my specific case.

Can someone please guide me on how to initialize the connection between the STM32G071 and the ST25R3911B chip?

What is the best way to receive data and work with it?

Thank you very much for your time and help!

45 REPLIES 45

So, you're telling me to start a new project from start and don't add the RFAL/NDEF libraries nor the other modules?

Just a connection with SPI functions like HAL_SPI_TransmitReceive_DMA, HAL_SPI_TransmitReceive_IT, HAL_SPI_TransmitReceive...?

Kamil Duljas
Senior III

No, I mean about revert changes in platform.h and main.c , At first changing main.h and them trying customize main.c

Dudo

Thanks! I've tried what you said and at least now I can see a blinking blue led in the NFC05A1 board but I keep getting the hardware error...

What do you think it could be now? I'm using USART1 instead of USART2 for the logger because if not the code is not working.

Set brakepoint in st25r3911CheckChipID function:

Drivers\BSP\Components\ST25R3911\st25r3911.c:384

and check uint8_t ID on debugger

Dudo

I get a value of 0 in the ID...

It means the problem with connection between boards....

Dudo

:o

What does that mean??

There are not any way to use the 2 boards together??

Hi,

I think best to measure / trace the lines on the X-NUCLEO-NFC05A1 are correctly changing - compare against diagrams inside the DS of the ST25R3911B. Best to use a logic analyzer.

This let's you identify the pin not behaving as expected. The checkChipID should perform a read of a single register: 0x7F on MOSI line, followed by some byte on MISO - expecting 0x0a or 0x0d.

BR, Ulysses

Hi,

Thank you so much for your time guys!!.

I've tried with another set of STM32G071 and NFC05A1 boards and the problem still persists. So I don't think there is a problem with a malfunctioning pin.

What else could it be??