I am trying to use PN532 on nRF52840. Nordic SDK has an example Adafruit Tag Example but it is for nRF52832. I have ported the example but it fails in TWI Communication.
What did I do ?
- In makefile change every occurrence of pca10040 to pca10056
- In makefile change every occurrence of nRF52832 to nRF52840
- Copy sdk_config.h from TWI Scanner example to Adafruit Tag Example
Problems I am facing
LOG :
<error> app: End of error report <info> app: NFC EXAMPLE Adafruit tag reader started. <info> adafruit_pn532: Creating I2C <info> adafruit_pn532: Looking for PN532 <info> adafruit_pn532: Trying to get the firmware version <info> adafruit_pn532: Trying to send command <info> adafruit_pn532: 02 |. <info> adafruit_pn532: Sending command <info> adafruit_pn532: 00 00 FF 02 FE D4 02 2A|.......* <info> adafruit_pn532: 00 |. <info> adafruit_pn532: Failed while calling TWI tx 1, err_code = 33282 <info> adafruit_pn532: Failed to write command, err_code = 33282 <info> adafruit_pn532: Failed to send GetFirmwareVersion command, err_code = 33282 <info> adafruit_pn532: Didn't find PN53x board, err_code = 33282 <error> app: ERROR 33282 [NRF_ERROR_DRV_TWI_ERR_DNACK] at ../../../main.c:405 PC at: 0x00004D3B <error> app: End of error report
I am not able to detect PN532. More precisely TWI command fails to send. The error received is NRF_ERROR_DRV_TWI_ERR_DNACK.
Another strange thing is that on pressing reset nRF doesn't log again.