Hello,
I'm trying to declare custom GPIO on pin that are already used by the default dts of the nRF7002-DK. I'm currently testing on P0.11 that is used by SPI4.
My code is quite simple and toggle a LED, a custom GPIO no used by default and a custom that is already used by default. Only the two firsts are effectively toggling, the custom GPIO that is used by default remains at 0. I tried with several pins and the result is always the same.
My code :
#include <zephyr/kernel.h> #include <zephyr/drivers/gpio.h> #define GPIOCUS0 DT_ALIAS(gpiocus0) #define GPIOCUS1 DT_ALIAS(gpiocus1) #define LED0_NODE DT_ALIAS(led0) static const struct gpio_dt_spec gpioTest = GPIO_DT_SPEC_GET(GPIOCUS0, gpios); static const struct gpio_dt_spec gpioTest1 = GPIO_DT_SPEC_GET(GPIOCUS1, gpios); static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios); void main( void ) { gpio_pin_configure_dt(&gpioTest, GPIO_OUTPUT_ACTIVE); gpio_pin_configure_dt(&gpioTest1, GPIO_OUTPUT_ACTIVE); gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE); while(1){ gpio_pin_set_dt(&gpioTest, 1); gpio_pin_set_dt(&gpioTest1, 1); gpio_pin_set_dt(&led, 1); printk("ON\n"); k_msleep(500); gpio_pin_set_dt(&gpioTest, 0); gpio_pin_set_dt(&gpioTest1, 0); gpio_pin_set_dt(&led, 0); printk("OFF\n"); k_msleep(500); } }
My overlay file :
/{ gpioCustom{ compatible = "gpio-keys"; gpioCus0: gpioCus0{ gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; label = "Custom"; }; gpioCus1: gpioCus1{ gpios = < &gpio0 26 GPIO_ACTIVE_HIGH >; label = "Custom2"; }; }; aliases{ gpiocus0 = &gpioCus0; gpiocus1 = &gpioCus1; }; }; /delete-node/ &spi4;
Has anyone got stuck on a similar issue or im I missing something somewhere ?
Thank you