AnsweredAssumed Answered

pn548(npc300) porting in Android 8 problem

Question asked by Victor Lan on Sep 11, 2018
Latest reply on Oct 14, 2018 by Victor Lan

Hi I.MX community 

 

excuse me, recently I try to integrate nfc chip into system, below are some system information

 

OS: Android 8.0.0_1.0.0

Mother Board: i.mx6q sabresd board

chip: pn548(npc300) 

 

above is our integrate information, and i use NFC_NCIHALx_AR00C0.8.4.0_OpnSrc integrate into our i.mx6q board

here is the source code web NXPNFCProject · GitHub 

 

I already finished porting processing, and boot into system, but one of strange question confuse me, I am not sure whether below error cause nfc not work successfully.

 

1 . after open HAL , then system want to get nfc chip name, it will go NxpNfcCapability.cpp, then get 0x?? to get chip name , but i don't know why get 0x68, then choose PN80T, i am not use this chip, i use pn548, does anyone have good experience and suggestion, just feedback me

 

NxpNfcCapability.cpp

tNFC_chipType capability::processChipType(uint8_t* msg, uint16_t msg_len) {
ALOGD("Victor NxpNfcCapability.cpp: processChipType....");
if((msg != NULL) && (msg_len != 0)) {
if((msg[0] == 0x60 && msg[1] == 00) ||
((offsetFwVersion < msg_len) && (msg[offsetFwVersion] == 0x12))) {
chipType = pn81T;
}
else if(offsetHwVersion < msg_len) {
ALOGD ("%s HwVersion : 0x%02x", __func__,msg[offsetHwVersion]);
switch(msg[offsetHwVersion]){

case 0x40 : //PN553 A0
case 0x41 : //PN553 B0
//NQ310
chipType = pn553;
break;

case 0x50 : //PN553 A0 + P73
case 0x51 : //PN553 B0 + P73 , NQ440
//NQ330
chipType = pn80T;
break;

case 0x98 :
chipType = pn551;
break;

case 0xA8 :
case 0x08 :
chipType = pn67T;
break;

case 0x28 :
case 0x48 : //NQ210
chipType = pn548C2;
break;

case 0x18 :
case 0x58 : //NQ220
chipType = pn66T;
break;

default :
chipType = pn80T;
}
}
else {
ALOGD ("%s Wrong msg_len. Setting Default ChiptType pn80T",__func__);
chipType = pn80T;
}
}
ALOGD ("%s NxpNci > Product : %s",__func__,product[chipType]);
return chipType;
}

 

 

 

 

08-05 00:03:43.542 295 1093 D NxpNciR : len = 28 <= 40011900031E030008000102038081828302D002FF02000468100122
08-05 00:03:43.542 295 1096 D NxpHal : read successful status = 0x0
08-05 00:03:43.542 295 1096 D NxpHal : CORE_INIT_RSP NCI1.0 received !
08-05 00:03:43.542 295 1096 D NxpHal : NxpNci> FW Version: 10.1.22
08-05 00:03:43.542 295 1096 D NxpHal : CORE_INIT_RSP 1 received !
08-05 00:03:43.542 295 1096 D : Victor NxpNfcCapability.cpp: processChipType....
08-05 00:03:43.550 295 1096 D : processChipType HwVersion : 0x68
08-05 00:03:43.550 295 1096 D : processChipType NxpNci > Product : PN80T
08-05 00:03:43.550 319 866 I OMXMaster: makeComponentInstance(OMX.google.vorbis.decoder) in omx@1.0-service process
08-05 00:03:43.550 295 1096 D : VICTOR phNxpNciHal.c: NFC_GetFeatureList ()chipType = 8
08-05 00:03:43.550 295 295 D NxpHal : Response timer stopped
08-05 00:03:43.550 295 295 D NxpHal : Checking response
08-05 00:03:43.551 295 1093 D NxpTml : PN54X - Read requested.....
08-05 00:03:43.551 295 1093 D NxpTml : PN54X - Invoking I2C Read.....

 

 

 

 

 

 

 

2. then the log go through...,it must go into phNxpNciHal.c , go to case HAL_NFC_IOCTL_FW_MW_VER_CHECK, but i don't know why i get nfcFL.chipType is 0x00, that might cause nfc not work, does anyone meet similar issue, even rom_version  and fw_maj_ver are 0x00, means get nothing, last....in my settings->Connected devices->NFC, i can see the item, but it's not work.

 

 

 

 

phNxpNciHal.c

case HAL_NFC_IOCTL_FW_MW_VER_CHECK:
ALOGD("VICTOR phNxpNciHal.c: in phNxpNciHal_ioctl, case HAL_NFC_IOCTL_FW_MW_VER_CHECK");
fm_mw_ver_check = phNxpNciHal_fw_mw_ver_check();
ALOGD("VICTOR phNxpNciHal.c: fw_mw_ver_check is %d",fm_mw_ver_check);
pInpOutData->out.data.fwMwVerStatus = fm_mw_ver_check;
ret = 0;
break;

 

phNxpNciHal.c

int phNxpNciHal_fw_mw_ver_check() {
NFCSTATUS status = NFCSTATUS_FAILED;
ALOGD("VICTOR phNxpNciHal.c: nfcFL.chipType 0x%02x, rom_version 0x%02x, fw_maj_ver 0x%02x",nfcFL.chipType, rom_version,fw_maj_ver);
if (((nfcFL.chipType == pn553)||(nfcFL.chipType == pn80T)) &&
(rom_version == FW_MOBILE_ROM_VERSION_PN553) && (fw_maj_ver == 0x01)) {
status = NFCSTATUS_SUCCESS;
} else if (((nfcFL.chipType == pn551)||(nfcFL.chipType == pn67T)) &&
(rom_version == FW_MOBILE_ROM_VERSION_PN551) && (fw_maj_ver == 0x05)) {
status = NFCSTATUS_SUCCESS;
} else if (((nfcFL.chipType == pn548C2)||(nfcFL.chipType == pn66T)) &&
(rom_version == FW_MOBILE_ROM_VERSION_PN551) && (fw_maj_ver == 0x01)) {
status = NFCSTATUS_SUCCESS;
} else if (((nfcFL.chipType == pn547C2)||(nfcFL.chipType == pn65T)) &&
(rom_version == FW_MOBILE_ROM_VERSION_PN547C2) && (fw_maj_ver == 0x01)) {
status = NFCSTATUS_SUCCESS;
}
return status;
}

 

 

 

8-05 00:03:43.578 929 1079 D NfcAdaptation: NfcAdaptation::HalIoctl arg=9
08-05 00:03:43.578 929 1079 D : phNxpNciHal_ioctl : enter - arg = 9
08-05 00:03:43.578 929 1079 D : VICTOR phNxpNciHal.c: in phNxpNciHal_ioctl, case HAL_NFC_IOCTL_FW_MW_VER_CHECK
08-05 00:03:43.578 929 1079 D : VICTOR phNxpNciHal.c: nfcFL.chipType 0x00, rom_version 0x00, fw_maj_ver 0x00
08-05 00:03:43.578 929 1079 D : VICTOR phNxpNciHal.c: fw_mw_ver_check is 255
08-05 00:03:43.578 929 1079 D NfcAdaptation: IoctlCallback Ioctl Type=9
08-05 00:03:43.578 929 1079 D NfcAdaptation: VICTOR NfcAdaptation.cpp: IoctlCallback READY memcpy.....start
08-05 00:03:43.578 929 1079 D NfcAdaptation: VICTOR NfcAdaptation.cpp: IoctlCallback READY memcpy.....end
08-05 00:03:43.578 929 1079 D NfcAdaptation: NfcAdaptation::HalIoctl Ioctl Completed for Type=9
08-05 00:03:43.578 929 1079 I BrcmNfcNfa: nfc_set_state 2 (CORE_INIT)->3 (W4_POST_INIT_CPLT)
08-05 00:03:43.578 929 1079 D NfcAdaptation: NfcAdaptation::HalCoreInitialized
08-05 00:03:43.579 295 295 D NxpHal : phNxpNciHal_core_initialized::p_core_init_rsp_params : 64
08-05 00:03:43.579 295 295 D NxpExtns: find found NXP_ACT_PROP_EXTN=/
08-05 00:03:43.579 295 295 D : VICTOR phNxpNciHal_utils.c: in listAdd.......
08-05 00:03:43.580 295 295 D : VICTOR phNxpNciHal_utils.c: in listAdd.......
08-05 00:03:43.580 295 1094 D NxpTml : PN54X - Write requested.....
08-05 00:03:43.580 295 1094 D NxpTml : PN54X - Invoking I2C Write.....
08-05 00:03:43.581 295 1094 D NxpNciX : len = 3 => 2F0200
08-05 00:03:43.581 295 1094 D NxpTml : PN54X - I2C Write successful.....
08-05 00:03:43.581 295 1094 D NxpTml : PN54X - Posting Fresh Write message.....
08-05 00:03:43.581 295 1094 D NxpTml : PN54X - Tml Writer Thread Running................
08-05 00:03:43.582 295 1096 D NxpHal : write successful status = 0x0
08-05 00:03:43.582 295 295 D NxpHal : Response timer started
08-05 00:03:43.582 295 295 D NxpHal : Waiting after ext cmd sent
08-05 00:03:43.590 295 1093 D NxpTml : PN54X - I2C Read successful.....len = 8
08-05 00:03:43.590 295 1093 D NxpTml : PN54X - Posting read message.....
08-05 00:03:43.590 295 1093 D NxpNciR : len = 8 <= 4F0205000000D051
08-05 00:03:43.590 295 1096 D NxpHal : read successful status = 0x0
08-05 00:03:43.594 295 295 D NxpHal : Response timer stopped
08-05 00:03:43.594 295 295 D NxpHal : Checking response
08-05 00:03:43.594 295 295 E NxpHal : NAME_NXP_SVDD_SYNC_OFF_DELAY failed
08-05 00:03:43.594 295 295 D NxpHal : Timeout value
08-05 00:03:43.595 295 1093 D NxpTml : PN54X - Read requested.....
08-05 00:03:43.595 295 1093 D NxpTml : PN54X - Invoking I2C Read.....
08-05 00:03:43.596 295 295 D NxpHal : request_EEPROM Enter request_type : 0x02, request_mode : 0x01, bufflen : 

 

 

 

 

attachment file is full log & phNxpNciHal.c & NxpNfcCapability.cpp, if anyone meet similar issue, we can discuss here

 

really thx

Outcomes