Can you please let me know what is the issue that you are facing? If you are not able to find the exact issue, can you enter debug mode and check if the project is getting stuck at any time during execution? I do not have the sensor with me at the moment. So, I was not able to debug your project. However, I did go through the project. Can you please let me know if you developed the RC522.c file?
It appears to me that only the PCD_WriteRegister, PCD_WriteRegisters, PCD_ReadRegister and PCD_ReadRegisters functions use the underlying SPI driver to communicate with the sensor. Please correct me if I am wrong.
The RFID module also has an IRQ pin which lets the MCU know when it detects an RFID tag. I was not able to find this pin used in your project. The main.c function calls the SPI_Start(), but I also found PCD_Init() function which was not used in the main function to initialize the RC522 sensor. PCD_Init() calls the SPI_Start() internally.
Can you also try the following things and let me know if it helps?
1. In PCD_WriteRegisters and PCD_WriteRegister functions can you clear the RxBuffer if the received data is not being used? If the RxBuffer is full then the master will not be able to read data from the slave.
2. Similar to the 1st point, ensure that there is always some data in TxBuffer, even if it is dummy data, whenever reading from the slave. If TxBuffer is empty then the read will not be successful.
3. Can you change the wait condition to - while (0u == (SPIM_ReadTxStatus() & SPIM_STS_SPI_DONE)); and let me know if it makes any difference?
4. You can also use SPI_PutArray() in PCD_WriteRegisters.
Please refer to SCB_SpiCommSlave CE and these threads -
Thanks and Regards,
Rakshith M B