AnsweredAssumed Answered

PN7150 doesn't work well with ESP-WROOM-32( Error occurs around RF_CONF)

Question asked by ashijanken on Apr 23, 2019
Latest reply on Apr 24, 2019 by Estephania Martinez

I want to use PN7150 with ESP32, so I made some codes based on "NXP-NCI MCUXpresso example Project".
(I found it here: https://www.nxp.com/products/identification-security/rfid/nfc-hf/nfc-readers/pn7150-high-performance-nfc-controller-with-integrated-firmware-for-smart-devices:PN7150?tab=Design_Tools_Tab)

 

However, PN7150 doesn't work well.

 

In the connecting phase, I run this code.

 

/* Open connection to NXPNCI device */
if (NxpNci_Connect() == NFC_ERROR) {
    printf("Error: cannot connect to NXPNCI device\n");
    while(1){
        sys::delay_ms(10);
    }
}
if (NxpNci_ConfigureSettings() == NFC_ERROR) {
    printf("Error: cannot configure NXPNCI settings\n");
    while(1){
        sys::delay_ms(10);
    }
}

if (NxpNci_ConfigureMode(mode) == NFC_ERROR)
{
    printf("Error: cannot configure NXPNCI\n");
    while(1){
        sys::delay_ms(10);
    }
}

the error occurs in NxpNci_ConfigureSettings() function.

it occurs in the section below in this function.

#if NXP_RF_CONF
    NxpNci_CONF = NULL;
    if(gNfcController_generation == 1)
    {
        NxpNci_CONF = NxpNci_RF_CONF_1stGen;
        NxpNci_CONF_size = sizeof(NxpNci_RF_CONF_1stGen);
    }
    else if(gNfcController_generation == 2)
    {
        NxpNci_CONF = NxpNci_RF_CONF_2ndGen;
        NxpNci_CONF_size = sizeof(NxpNci_RF_CONF_2ndGen);
    }
    if (NxpNci_CONF != NULL)
    {
        isResetRequired = true;
        NxpNci_HostTransceive(NxpNci_CONF, NxpNci_CONF_size, Answer, sizeof(Answer), &AnswerSize);
        if ((Answer[0] != 0x40) || (Answer[1] != 0x02) || (Answer[3] != 0x00) || (Answer[4] != 0x00)) return NXPNCI_ERROR;
    }

#endif

When the ESP sends NxpNci_RF_CONF_2ndGen commands(related post), then PN7150 returns a packet as below:

0x40 0x02 0x0C 0x09 0x05 0xA0 0x0D 0xA0 0x0D 0xA0 0x0D 0xA0 0x0D 0xA0 0x0D

Another PN7150 returns a different packet even though ESP's firmware is the same. (It is strange behavior, but it may be just because it is broken)

0x40 0x02 0x16 0x09 0x0A 0xA0 0x0D 0xA0 0x0D 0xA0 0x0D 0xA0 0x0D 0xA0 0x0D 0xA0 0x0D 0xA0 0x0D 0xA0 0x0D 0xA0 0x0D 0xA0 0x0D

 

I tried to understand the meaning of them with "PN7150 User Manual" (https://www.nxp.com/docs/en/user-guide/UM10936.pdf), but what I understood was that they were (response type of) control packets.
I couldn't find corresponding commands to the PN7150's response.

 

Now, my questions are as below:
1. What is the meaning of these packets?
2. How do I fix this error?

 

Thank you in advance.

Outcomes