GPIO9 & 10 won't operate independently using zephyr (but OK with rRF5 SDK)

I have a custom nRF52832 board with outputs on P0.07 P0.08 P0.09 P0.10 and I want to write to them. 7&8 are working ok but 9&10 are not.

Let me emphasise THE BOARD IS WORKING FINE. I have applications written using the old nRF5 SDK which I can flash and work no problem, but now I am trying to use nRF Connect SDK.

After some time messing I find out the NFC needs to be disabled, so I have added the line "CONFIG_NFCT_PINS_AS_GPIOS=y" to prj.conf. Now I can write to GPIO pins 9 or 10, but for whatever reason they act as if they are shorted together. i.e. if I set PIN to either 9 or 10 in the test code below then both pins toggle together.

Here is some test code. I was initially using devicetree, but I've simplified it down to the most basic form to get to the bottom of this. I'm guessing this is down to the NFC protection circuitry but can't find any reference to it (I would expect CONFIG_NFCT_PINS_AS_GPIOS=y to disable the protection anyway)

#include <stdio.h>
#include <zephyr/kernel.h>
#include <hal/nrf_gpio.h>>

#define RUN_LED_BLINK_INTERVAL 300
#define PIN 8

int main(void)
{
nrf_gpio_cfg_output(PIN);
for (;;) {
nrf_gpio_pin_set(PIN);
k_sleep(K_MSEC(RUN_LED_BLINK_INTERVAL));
nrf_gpio_pin_clear(PIN);
k_sleep(K_MSEC(RUN_LED_BLINK_INTERVAL));
}
return 0;
}

prj.conf

CONFIG_GPIO=y
CONFIG_DK_LIBRARY=n
CONFIG_NFCT_PINS_AS_GPIOS=y

Related