I am doing a project aimed at reading/writing data from Mifare Classic rfid card, by nrf52832
(Cortex™-M4F based) together with TRF7970A
(Multi-Protocol Fully Integrated 13.56-MHz NFC / RFID Transceiver IC).
The pre-authentication part is done according to ISO14443-3 standart (shown on a picture) and works fine (communication between nrf52832
and TRF7970A
is done via SPI)
picture pre-authentication part
But after this part i bumped into problems with a authentication problems.
As far as TRF7970A doesn't support MIFARE cards, there is need to continue communication TRF7970A <-> MIFARE
thru Special Direct Mode according to TI PDF "Using Special Direct Mode With the TRF7970A"
(cannot link because of Stackoverflow limitations for new users)
Everything is configured according to TI PDF, but still i can't pass 3stage authentication.
To show the problem, 3 picture are attached. The process of authentication is captured by logic analyzer.
Captured signals upper picture - failed attempt to pass auth1 stage. (TRF send an IRQ before it transmitted response from a card)
middle picture - successful attempt to pass auth1 stage. (Code remains the same, just sometimes it pass 1 stage, sometimes doesn't.)
bottom picture - after after successful passage of auth1, it comes to auth 2, where i never see the answer from trf7970/Mifare Classic card
The crypto part is taken from sdm mifare lib on trf7970AEVM
May bee someone have any ideas whats going wrong, or mb someone can direct me to the similar project.
I suspect the crypto keys used for cryptogram generation on host side and card side are different. That's why you are not seeing any response from the card.
Ensure that keys are the same.