I've been trying to get the PN7120 based NFC click working with the Avnet Azure Sphere starter kit. It's not been easy. I should have been more wary after my road test of the similar PN7150.
The weirdest problem of many was the fact that the output buffer meant that you might have 2 attempts at request A because the first one failed, make request B and get the buffered answer to one of the request A's that you made earlier. As the only documentation is sample code like this (which I've simplified significantly to illustrate the point), and the responses seem undocumented and fairly similar, it wasn't easy to debug.
// Retry this until it succeeds... NxpNci_HostTransceive(NCICoreReset, sizeof(NCICoreReset), Answer, sizeof(Answer), &AnswerSize); if ((Answer[0] != 0x40) || (Answer[1] != 0x00)) return NXPNCI_ERROR; // Then try this... NxpNci_HostTransceive(NCICoreInit, sizeof(NCICoreInit), Answer, sizeof(Answer), &AnswerSize); if ((Answer[0] != 0x40) || (Answer[1] != 0x01) || (Answer[3] != 0x00)) return NXPNCI_ERROR;
This might be a UK thing, but it reminded me of this:
Anyway, I think I've got round all the quirks of the NFC click's PN7120 - and I'll post some example code once it's tidied.
The problem I have now seems to be an MT3620 one. I frequently (but not consistently) get a stray byte at the start of my response. Sometimes it's the first byte repeated. Sometimes it's 0xFF. Perhaps it could be left over from the last response. I've written code to detect and remove it, but it really shouldn't be there. I've taken a close look at my code and nothing is out of the ordinary. The error comes back from the I2CMaster_Read function in the Azure Sphere SDK.
Has anyone seen this problems before or have any other ideas?