Configuring NRF NFC as I2C

I am having trouble reconfiguring NFC pins on NRF devices as an I2C interface. Following the I2C example (from here), I was able to communicate with an I2C device on the nrf52dk, and I was able to change the pins in pinctrl.dtsi to modify which pins were used for I2C. When I change to pins P0.09 and P0.10, the NFC pins, and adjust hardware accordingly, the write-read command to check the "WHO-AM-I" register fails with a negative return value. I am looking for a solution as my custom board, built off the NRF52833-QDAA chip, currently has I2C hardwired to P0.09 and P0.10. as I didn't realize there would be configuration issues. 

Most questions on here point to the configuration "CONFIG_NFCT_PINS_AS_GPIOS" which is deprecated - I included "nfct-pins-as-gpios;" in &uicr in the devicetree file.

Test device is an MPU 6050, same issue on the custom board with a ICM 42688.

nrf52dk: PCA10040 3.0.0
NRF Toolchain/Connect SDK 2.6.0 
VS Code on Windows 10

Parents
  • Hi

    Can you confirm what .dts/overlay file you have set the nfct-pins-as-gpios in, and confirm that it is as the following:

    &uicr {
        nfct-pins-as-gpios;
    };
    Also, what return value does the WHO-AM-I register fail with? That might point us in the direction with an error code. Lastly, I see that you mention both the nRF52833 and nRF52832 SoCs. I assume you are initially trying to build and run this sample on the nRF52832 DK with the nrf52dk_nrf52832 board as the build target? If so, add the nfct-pins-as-gpios; as a .overlay file to your project to correctly use the NFC pins as GPIOS.

    Best regards,

    Simon

  • Yes, I added "nfct-pins-as-gpios" to &uicr in nrf52dk_nrf52832.dts, as the "gpio-as-nreset" parameter was already there. I also tried adding it to the corresponding overlay file, nrf52dk_nrf52832.overlay, without success. I2C fails with return value -5. And yes, I have two build configurations, one for each SoC- I have code running on both, it's just the I2C on the NFC pins that's been the issue.

Reply
  • Yes, I added "nfct-pins-as-gpios" to &uicr in nrf52dk_nrf52832.dts, as the "gpio-as-nreset" parameter was already there. I also tried adding it to the corresponding overlay file, nrf52dk_nrf52832.overlay, without success. I2C fails with return value -5. And yes, I have two build configurations, one for each SoC- I have code running on both, it's just the I2C on the NFC pins that's been the issue.

Children
No Data
Related