nRF5340 use NFC pins as GPIO input

Hi,

I have a custom board which uses P0.02 and P0.03. They are connected to interrupt signals from external devices.

To configure them as GPIO I set CONFIG_NFCT_PINS_AS_GPIOS=y

Below is my DTS where I use one of the pin:

&i2c1 {
    sens1: sens1@44 {
        compatible = "...";
        reg = <0x44>;
        ...
        int-gpios = <&gpio0 3 0>;
        ...
    };
};

I configure the pin as input like:
    ...
    
	if (device_is_ready(irq_pin->port)) {
		ret = gpio_pin_configure(irq_pin->port, irq_pin->pin,
								(GPIO_INPUT | GPIO_PULL_UP | irq_pin->dt_flags));
		ret = gpio_pin_interrupt_configure(irq_pin->port, irq_pin->pin, GPIO_INT_EDGE_FALLING);
		if (ret != 0) {
			LOG_ERR("Failed to configure interrupt pin %d (%d)", irq_pin->pin, ret);
			return ret;
		}
		/* Prepare GPIO callback for interrupt pin */
		gpio_init_callback(&m_irq_cb, irq_handler, BIT(irq_pin->pin));
		gpio_add_callback(irq_pin->port, &m_irq_cb);
	}
	
	...
But the pin only reads low. I am getting 0V on the CRO.
If I change the pin from P0.03 to some other (I have tried P1.01), I get high-to-low interrupt pulses from the external device.
What could be the issue?
Thanks,
Rohan
Parents Reply
  • Hi Rohan

    Håkon is currently out of office, and I will help you out in the mean time. 

    Possibly the issue could be the same as the one described here.
    Could you read through that case and see if your issue is related?

    On the nRF5340DK you will need to make some hardware modifications to the board in order to route the NFC pins to the pin headers rather than the NFC antenna connector. This is described here

    Best regards
    Torbjørn 

Children
No Data
Related