Hi All,
Hope you are doing well.
I am using NRF Connect SDK 1.5.0 with NRF9160 DK. I want to use P0.14 (Arduino Header Pin) as output for the RESET of LR1110 (SPI Device).
Till now, I am unable to run even a blinky for P0.14.
I have changed the nrf9160dk_nrf52840.overlay with the below configurations
/ { model = "Nordic nRF9160 DK NRF52840"; compatible = "nordic,nrf9160-dk-nrf52840"; board-control { vcom2_pins_routing: switch-nrf91-uart2 { compatible = "nordic,nrf9160dk-optional-routing"; /* * Two pins (P1.12 and P0.12) need to be driven for * this switch. */ control-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>, <&gpio0 12 GPIO_ACTIVE_LOW>; status = "disabled"; }; }; };
In my code for nrf9160dk_nrf9160ns, I have made changes in nrf9160dk_nrf9160ns.overlay as below
&uart1 { status = "disabled"; };
Below is my main code for just making the P0.14 toggle.
#include <zephyr.h> #include <device.h> #include <logging/log.h> #include <drivers/gpio.h> #define LR_RESET_PIN 14 const struct device *dev_gpio; #define GPIO0_LABEL DT_PROP(DT_NODELABEL(gpio0), label) #define GPIO0_STATUS DT_PROP(DT_NODELABEL(gpio0), status) void main(void) { int retErr; retErr = gpio_pin_configure(dev_gpio, LR_RESET_PIN, GPIO_OUTPUT_ACTIVE); if(retErr != 0) { printk("GPIO Reset config err.\n"); return; } while() { gpio_pin_set(dev_gpio, LR_RESET_PIN, (int)0); k_sleep(K_MSEC(10)); gpio_pin_set(dev_gpio, LR_RESET_PIN, (int)1); k_sleep(K_MSEC(10)); } }
If I change LR_RESET_PIN to "7", I can see the P0.7 toggling, if I change it to "15", P0.15 is not toggling like P0.14.
Please tell me what I am doing wrong.
Thanks in advance.