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-27 01:11 AM - edited 2023-11-20 07:15 AM
Look at your nfc board on folowing jumpers:
PErhaps you have other close/open SS line (J101 or J102 or J103)
2023-04-27 01:12 AM
Show me your main.c again
2023-04-27 01:15 AM - edited 2023-11-20 07:15 AM
SPI1_CS_Pin It must be B0 !!!! Look, on G0 instead B6 you have B0
2023-04-27 01:18 AM
IT WORKS!!!!!! THANK YOU VERY MUCH :loudly_crying_face:
Why did I have to use the port-pins from the NFC05A1 and now I had to use the port-pins for the STM32G071 board?????
2023-04-27 01:25 AM - edited 2023-11-20 07:16 AM
Hahah, It was good journey :D I think that manual of NFC board is customized for few boards with the same pins .e.q F401, L476 etc. .... and You on other board must check and correct eventually differences. For example:
MCU_LED3 on dedicated boards is PB0, look on F401:
but on G0xx you have PB1:
I'm happy that works. Mark some answer as best please :)
2023-04-27 01:29 AM
Thank you for everything,
I hope I can keep up now with the project.
Have a nice day :)