Unknown error trying to read a Mifare Classic block

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Unknown error trying to read a Mifare Classic block

ソリューションへジャンプ
2,476件の閲覧回数
Tøm
Contributor I

Hi,

I'm working on a Mifare Classic R/W device involving a PN5190 and I've been facing an unknown error lately.

The project uses the NXP's NFC lib and I managed to read and write data on a Mifare Classic tag's sector weeks ago on another project. 

I successfully identified the type of tag used, got the UID...

But when I try to read data on a block (after field and card re-activation), calling phalMfc_Read() returns a 0x782 error and I can figure out what this means. I tried to run step-by-step really deep in the library but it becomes really hard to understand...

Tm_0-1660898657336.png

Any idea?

Thanks in advance for your help.

タグ(4)
0 件の賞賛
返信
1 解決策
2,450件の閲覧回数
KellyLi
NXP TechSupport
NXP TechSupport

Hello,

For MIFARE Classic, after authentication Read/Write block operations may be performed, so you should call phalMfc_Authenticate() to authenticate any block of the sector that you want to access, once authenticated successfully, you can access to all blocks of the same sector.

Hope my reply help to you, thanks!

Best regards,
Kelly
Technical Support
NXP Semiconductor

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
2,451件の閲覧回数
KellyLi
NXP TechSupport
NXP TechSupport

Hello,

For MIFARE Classic, after authentication Read/Write block operations may be performed, so you should call phalMfc_Authenticate() to authenticate any block of the sector that you want to access, once authenticated successfully, you can access to all blocks of the same sector.

Hope my reply help to you, thanks!

Best regards,
Kelly
Technical Support
NXP Semiconductor

0 件の賞賛
返信
2,445件の閲覧回数
Tøm
Contributor I

Hello,

Thanks for your answer!

That's right, the problem was that the mecanism set to avoid reauthentication when not required was not synchronized with the upper layer of the software to reset this mecanism when the tag is reactivated.

So yes, it definitely was due to a missing of authentication...

I just don't understand why I didn't manage to understand the error code But the problem is now solved anyway.

Thank you for your help!

 

0 件の賞賛
返信
2,433件の閲覧回数
KellyLi
NXP TechSupport
NXP TechSupport

Hello,

I checked the related code, the errorcode=0x0782 should be occurred in phpalMifare_Sw_ExchangeL3() -> phhalHw_Exchange() status = PHPAL_MIFARE_ERR_NAK4(line 144) and then finally return PH_ADD_COMPCODE(status, PH_COMP_PAL_MIFARE) = 0x0782(line 205). This is MIFARE product NAK4 response code, its detail mean may be related your application, so you could double check your application parts.

Hope my reply help to you, thanks!

Best regards,

Kelly

Technical SupportNXP Semiconductor

0 件の賞賛
返信