GPIO fails to respond to input following flags update

I want to dynamically update several nrf5340dk GPIO active level settings. However as soon as I write the new 'flags' setting using gpio_pin_configure() or gpio_pin_configure_dt(), the GPIO stops responding to input changes. In the device tree the GPIO is configured as follows:

        gpio1_sw: gpio1_sw {
            gpios = < &gpio1 0xa 0x0 >;
            label = "GPIO 1 switch input";
        };

When the device first comes up it will respond correctly to switch input changes but, as soon as I update the 'flags' settings, even if the update changes nothing, the GPIO fails to respond to input changes. Are there other actions I need to take when updating GPIO's on the fly other than just updating the flags?

In addition, attempts to read the GPIO 'flags' settings by calling gpio_pin_get_config() or gpio_pin_get_dt() fail. In my prj.conf I have added CONFIG_GPIO_GET_CONFIG=y, is there something else I need to add to get this to work?

Thanks,

Kyle

Parents Reply Children
Related