NPC100 failing

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

NPC100 failing

跳至解决方案
2,232 次查看
adamtrhon
Contributor II

Hello,

we have a tablet with NPC100. We build linux on it with openembedded. I want to use NPC100 using libnfc-nci. I modified src/halimpl/pn54x/tml/i2c/phTmlNfc_alt.h and configured the build with --enable-pn7120 and --enable-alt. 

After boot I run nfcDemoApp poll, which freezes with following in output (with logs enabled):

[ many lines left out ]

0:069:211 - NxpHal: > Polling Loop Started
0:069:158 - NxpTml: 0:069:271 - NxpTml: PN54X - Write requested.....
0:069:319 - NxpTml: PN54X - Invoking I2C Write.....
PN54X - Invoking I2C Read.....
0:070:176 - NxpNciX: len = 28 > 2103190C000101010201030105018001810182018301850106017701
0:070:212 - NxpTml: PN54X - I2C Write successful.....
0:070:241 - NxpTml: PN54X - Posting Fresh Write message.....
0:070:276 - NxpTml: PN54X - Tml Writer Thread Running................
0:070:293 - NxpHal: write successful status = 0x0
0:071:648 - NxpTml: PN54X - I2C Read successful.....
0:071:692 - NxpNciR: len = 4 > 41030100
0:071:723 - NxpTml: PN54X - Posting read message.....
0:071:773 - NxpHal: read successful status = 0x0
0:071:838 - NxpTml: PN54X - Read requested.....
0:071:871 - NxpTml: PN54X - Invoking I2C Read.....

Full logs are attached.

I also tried neard. I was able to detect cards and show serial numbers, but this is as far as I got. It is no use, but I am confident that the hardware is fine.

Is there anything I can do to fix this?

标签 (2)
标记 (1)
0 项奖励
回复
1 解答
1,842 次查看
adamtrhon
Contributor II

If anybody finds this:

The first problem is with the alt driver. It seems that it cannot handle case when the chip sends data unexpectedly. Thus I suggest using the kernel driver from https://github.com/NXPNFCLinux/nxp-pn5xx.

At this time (I am going to raise a github issue regarding this) the driver itself has a problem: it cannot drive the chip out of reset. In the pn544_enable function there is this block of code (licensed as GPL):

if (MODE_RUN == mode) {

        pr_info("%s power on\n", __func__);
        if (gpio_is_valid(dev->firm_gpio))
                gpio_set_value_cansleep(dev->firm_gpio, 0);
        gpio_set_value_cansleep(dev->ven_gpio, 1);
        msleep(100);
}

that drives the chip out of reset. The problem is that after 100ms sleep the chip gets to some weird state where it does not respond to CORE_RESET_CMD (standard NCI command). Removing the msleep() line fixed the problem.

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,843 次查看
adamtrhon
Contributor II

If anybody finds this:

The first problem is with the alt driver. It seems that it cannot handle case when the chip sends data unexpectedly. Thus I suggest using the kernel driver from https://github.com/NXPNFCLinux/nxp-pn5xx.

At this time (I am going to raise a github issue regarding this) the driver itself has a problem: it cannot drive the chip out of reset. In the pn544_enable function there is this block of code (licensed as GPL):

if (MODE_RUN == mode) {

        pr_info("%s power on\n", __func__);
        if (gpio_is_valid(dev->firm_gpio))
                gpio_set_value_cansleep(dev->firm_gpio, 0);
        gpio_set_value_cansleep(dev->ven_gpio, 1);
        msleep(100);
}

that drives the chip out of reset. The problem is that after 100ms sleep the chip gets to some weird state where it does not respond to CORE_RESET_CMD (standard NCI command). Removing the msleep() line fixed the problem.

0 项奖励
回复
1,842 次查看
weidong_sun
NXP TechSupport
NXP TechSupport

Hello  Adam,

     The chip is designed for Notebook application, It's support should be in the charge of Mobile team. So contact Sales Account Manager of local NXP , and get more help!

Have a nice day!

TIC weidong

0 项奖励
回复
1,842 次查看
adamtrhon
Contributor II

Hello weidong.sun, thank you for your answer. Unfortunately we don't have a local NXP partner, as we buy the whole tablet from 3rd party company. So we signed NXP NDA, downloaded npc100 software package with linux-libnfc-nci from docstore and I tried that one with a very similar result. I also tried writing my own demo app, as simple as possible, basically just

    int main () {

        nfcManager_doInitialize();

        nfcManager_doDeinitialize();

    }

plus error checking, but even this fails (hangs during initialization). Is there another place where I can get help?

0 项奖励
回复