Hello Sir,
I have two IC for RFID Tag reading IC PN71501 and PN71506. I am using Linux kernel version 5.4 in that for NXP diver i am using nxp-pn5xx/pn5xx_i2c and the library is libnfc_nci_linux-1.so.0.0.0
On PN7501 RFID Tag is working fine for multiple Tags, on every tag it shows the correct value of tag for multiple cards. With the same environment for IC PN71506 it not working correctly. For Multiple tag scan it shows previously id tag continuously for every next new tag scan for 7 to 8 times randomly, after that it's scan correctly and again showing the same tag info for every next tag scan.
void onTagArrival(nfc_tag_info_t *pTagInfo)
{
framework_LockMutex(g_devLock);
if(eDevState_WAIT_ARRIVAL == g_DevState)
{
DEBUG_PRINT("\n===== NFC Tag Detected =====\n\n");
// When we are coping the idtag, we are getting the same id tag information, as we are actullay tapping the differnet id tag,
memcpy(&g_TagInfo, pTagInfo, sizeof(nfc_tag_info_t));
g_DevState = eDevState_PRESENT;
g_Dev_Type = eDevType_TAG;
framework_NotifyMutex(g_devLock, 0);
}
else if(eDevState_WAIT_DEPARTURE == g_DevState)
{
memcpy(&g_TagInfo, pTagInfo, sizeof(nfc_tag_info_t));
g_DevState = eDevState_PRESENT;
g_Dev_Type = eDevType_TAG;
framework_NotifyMutex(g_devLock, 0);
}
else if(eDevState_EXIT == g_DevState)
{
g_DevState = eDevState_DEPARTED;
g_Dev_Type = eDevType_NONE;
framework_NotifyMutex(g_devLock, 0);
}
else
{
g_DevState = eDevState_PRESENT;
g_Dev_Type = eDevType_TAG;
}
framework_UnlockMutex(g_devLock);
}
We have added some debug prints in below file in this library source code to dubug above issue.
File name : yocto/build/arago-tmp-external-arm-glibc/work/armv7at2hf-neon-linux-gnueabi/nxp-nfc/0.1-r0/git/src/service/interface/NfcTag.cpp
Function Name : void NfcTag::setNfcTagUid (nfc_tag_info_t& tag, tNFA_ACTIVATED& activationData)
Code changes are blow,
void NfcTag::setNfcTagUid (nfc_tag_info_t& tag, tNFA_ACTIVATED& activationData)
{
switch (mTechParams [mActivationIndex].mode)
{
case NFC_DISCOVERY_TYPE_POLL_A:
case NFC_DISCOVERY_TYPE_POLL_A_ACTIVE:
case NFC_DISCOVERY_TYPE_LISTEN_A:
case NFC_DISCOVERY_TYPE_LISTEN_A_ACTIVE:
NXPLOG_API_D ("%s: tech A", "NfcTag::setNfcTagUid");
NXPLOG_API_D("%s: enter, tag_uid=%d tag_uid_len=%x", "NfcTag::setNfcTagUid",
mTechParams [mActivationIndex].param.pa.nfcid1, mTechParams [mActivationIndex].param.pa.nfcid1_len);
tag.uid_length = mTechParams [mActivationIndex].param.pa.nfcid1_len;
memcpy(tag.uid, &mTechParams [mActivationIndex].param.pa.nfcid1, tag.uid_length);
NXPLOG_API_D("%s: enter, tag_uid=%x tag_uid_len=%x", "NfcTag::setNfcTagUid",
tag.uid, tag.uid_length);
Please see the highlighted logs below for above debug print,
[2024-07-05 17:04:50.929] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.974 NxpTml: PN54X - I2C Read successful.....
[2024-07-05 17:04:51.277] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.974 NxpNciR: len = 23 > 61051401808000FF010904000423371116010800000000
[2024-07-05 17:04:51.277] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.975 NxpTml: PN54X - Posting read message.....
[2024-07-05 17:04:51.277] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.975 NxpHal: read successful status = 0x0
[2024-07-05 17:04:51.277] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.975 NxpHal: NxpNci: RF Interface = MIFARE
[2024-07-05 17:04:51.277] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.976 NxpHal: NxpNci: Protocol = MIFARE
[2024-07-05 17:04:51.277] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.976 NxpHal: NxpNci: Mode = A Passive Poll
[2024-07-05 17:04:51.277] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.976 NxpFunc: NfcAdaptation::HalDeviceContextDataCallback: len=23
[2024-07-05 17:04:51.277] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.976 NxpFunc: nfaConnectionCallback: event= 5
[2024-07-05 17:04:51.292] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.977 NxpFunc: checkforTranscation: enter; event=0x5 transaction_data.current_transcation_state = 0x0
[2024-07-05 17:04:51.292] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.977 NxpFunc: other event clearing flag
[2024-07-05 17:04:51.292] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.977 NxpFunc: checkforTranscation: exit; event=0x5 transaction_data.current_transcation_state = 0x0
[2024-07-05 17:04:51.292] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.978 NxpFunc: nfaConnectionCallback: NFA_ACTIVATED_EVT: gIsSelectingRfInterface=0, sIsDisabling=0
[2024-07-05 17:04:51.292] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.978 NxpFunc: NfcTag::setActivationState: state=2
[2024-07-05 17:04:51.292] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.978 NxpFunc: NfcTag::IsSameKovio: enter
[2024-07-05 17:04:51.292] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.979 NxpFunc: NfcTag::discoverTechnologies (activation): enter
[2024-07-05 17:04:51.292] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.979 NxpFunc: NfcTag::processNotification (Activation): RF disc_id=01; protocol=80, mNumDiscList=8
[2024-07-05 17:04:51.308] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.979 NxpFunc: Mifare Classic detected
[2024-07-05 17:04:51.308] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.979 NxpFunc: processNotification (activation): NumTechList = 9 sel_rsp=0x8
[2024-07-05 17:04:51.308] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.980 NxpFunc: NfcTag::processNotification; mNumTechList=a
[2024-07-05 17:04:51.308] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.980 NxpFunc: NfcTag::discoverTechnologies (activation): index=0; tech=1; handle=1; nfc type=80
[2024-07-05 17:04:51.308] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.980 NxpFunc: NfcTag::discoverTechnologies (activation): index=1; tech=8; handle=1; nfc type=80
[2024-07-05 17:04:51.308] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.980 NxpFunc: NfcTag::discoverTechnologies (activation): index=2; tech=1; handle=1; nfc type=80
[2024-07-05 17:04:51.308] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.980 NxpFunc: NfcTag::discoverTechnologies (activation): index=3; tech=8; handle=1; nfc type=80
[2024-07-05 17:04:51.319] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.981 NxpFunc: NfcTag::discoverTechnologies (activation): index=4; tech=1; handle=1; nfc type=80
[2024-07-05 17:04:51.319] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.981 NxpFunc: NfcTag::discoverTechnologies (activation): index=5; tech=8; handle=1; nfc type=80
[2024-07-05 17:04:51.319] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.981 NxpFunc: NfcTag::discoverTechnologies (activation): index=6; tech=1; handle=1; nfc type=80
[2024-07-05 17:04:51.319] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.981 NxpFunc: NfcTag::discoverTechnologies (activation): index=7; tech=8; handle=1; nfc type=80
[2024-07-05 17:04:51.319] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.982 NxpFunc: NfcTag::discoverTechnologies (activation): index=8; tech=1; handle=1; nfc type=80
[2024-07-05 17:04:51.634] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.982 NxpFunc: NfcTag::discoverTechnologies (activation): index=9; tech=8; handle=1; nfc type=80
[2024-07-05 17:04:51.634] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.982 NxpFunc: NfcTag::discoverTechnologies (activation): exit
[2024-07-05 17:04:51.634] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.982 NxpFunc: NfcTag::createNativeNfcTag: enter
[2024-07-05 17:04:51.634] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.983 NxpFunc: createNativeNfcTag: Selected: index=9; tech=8; handle=1; nfc type=80
[2024-07-05 17:04:51.634] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.983 NxpFunc: NfcTag::setNfcTagUid: tech A
[2024-07-05 17:04:51.634] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.983 NxpFunc: NfcTag::setNfcTagUid: enter, tag_uid=b6f9ac37 tag_uid_len=4
[2024-07-05 17:04:51.634] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.983 NxpFunc: NfcTag::setNfcTagUid: enter, tag_uid=ae1f0740 tag_uid_len=4
[2024-07-05 17:04:51.634] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.984 NxpFunc: nativeNfcTag_onTagArrival: notify tag is ready
[2024-07-05 17:04:51.648] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.984 NxpFunc: NfcTag::createNativeNfcTag: exit
[2024-07-05 17:04:51.648] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.985 NxpTml: PN54X - Read requested.....
[2024-07-05 17:04:51.648] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.985 NxpTml: PN54X - Invoking I2C Read.....
[2024-07-05 17:04:51.648] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.986 NxpFunc: presenceCheckThread: enter
[2024-07-05 17:04:51.648] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.986 NxpFunc: doPresenceCheck
[2024-07-05 17:04:51.648] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.986 NxpFunc: doPresenceCheck: sCurrentConnectedHandle= 01
[2024-07-05 17:04:51.649] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.986 NxpFunc: Calling EXTNS_MfcPresenceCheck
[2024-07-05 17:04:51.649] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.987 NxpExtns: Mfc_PresenceCheck status = 0x3a
[2024-07-05 17:04:51.649] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.987 NxpExtns: Error Sending msg to Extension Thread
[2024-07-05 17:04:51.665] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.987 NxpFunc: doPresenceCheck: NFA_RwPresenceCheck Wait..
[2024-07-05 17:04:51.665] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.988 NxpFunc: NfcAdaptation::HalWrite
[2024-07-05 17:04:51.665] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.988 NxpTml: PN54X - Write requested.....
[2024-07-05 17:04:51.665] Jan 8 13:05:47 STCA60B8E9FEE EVOCApp[597]: 2024:01:08-13:05:46.988 NxpTml: PN54X - Invoking I2C Write.....
Please find the attached mpu log file for your for detail logs. Here also we are getting same id tag information, for different id tag tapping.
Please suggest where else in the source code we can add the futher debug prints to root cause the issue.
Hello @Ganesh_G
Firstly, I would say sorry, PN7150X is a customized product, and the related design resources are not public, including me, also can't see anything, so it is difficult to provide further support to you, please understand. As for the same environment you mentioned that PN71501 works well but PN71506 does not, it is recommended to check that where is the difference between PN71501 and PN71506, perhaps there will be clues.