I designed a circuit using the NRF54 to connect via Bluetooth and control several peripherals. I program the chip using the Debug Out of the NRF54L15 DK. The code can be flashed successfully, but the GPIO is not working. What could be the reason?
/*
* Copyright (c) 2016 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdio.h>
#include <zephyr/kernel.h>
#include <zephyr/drivers/gpio.h>
/* 1000 msec = 1 sec */
#define SLEEP_TIME_MS 1000
/* The devicetree node identifier for the "led0" alias. */
#define LED0_NODE DT_ALIAS(led0)
#define GPIO1_NODELABEL DT_NODELABEL(gpio1)
/*
* A build error on this line means your board is unsupported.
* See the sample documentation for information on how to fix this.
*/
//static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);
#define STR(x) #x
#define SHOW_DEFINE(x) printk("%s=%s\n", #x, STR(x))
int main(void)
{
int ret;
bool led_state = true;
const struct device *mynode = DEVICE_DT_GET(GPIO1_NODELABEL);
//SHOW_DEFINE(mynode);
if (!device_is_ready(mynode)) {
return 0;
}
ret = gpio_pin_configure(mynode, 10, GPIO_OUTPUT_ACTIVE);
if (ret < 0) {
return 0;
}
gpio_pin_set(mynode, 10, 1);
while (1) {
gpio_pin_toggle(mynode, 10);
led_state = !led_state;
printf("LED state: %s\n", led_state ? "ON" : "OFF");
k_msleep(1000);
}
return 0;
}
I