2023-04-25 12:20 AM
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!
Solved! Go to Solution.
2023-04-25 03:03 AM
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...?
2023-04-25 03:45 AM
No, I mean about revert changes in platform.h and main.c , At first changing main.h and them trying customize main.c
2023-04-25 04:49 AM
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.
2023-04-25 05:05 AM
Set brakepoint in st25r3911CheckChipID function:
Drivers\BSP\Components\ST25R3911\st25r3911.c:384
and check uint8_t ID on debugger
2023-04-25 05:33 AM
I get a value of 0 in the ID...
2023-04-25 05:47 AM
It means the problem with connection between boards....
2023-04-25 05:56 AM
:o
What does that mean??
There are not any way to use the 2 boards together??
2023-04-25 06:06 AM
Just check connections between boards. May help this topic:
2023-04-25 06:34 AM
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
2023-04-25 08:00 AM
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??