I am following along this example on your website: Exercise 1 - Nordic Developer Academy, and currently trying to complete this excercise: Exercise 1 - Nordic Developer Academy
I tried it with a nRF52840 dongle, which worked fine. Then I started trying to go through the same steps with the nRF52840 DK, but I am unsuccesfull in getting any output shown to my VCOM, which I am selecting via the vs code extension. I can connect fine without any issues, but I do not get the message: *** Booting nRF Connect SDK.
I am using nRF Connect SDK toolchain v2.9.1.
/* * Copyright (c) 2016 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #include <zephyr/kernel.h> #include <zephyr/device.h> #include <zephyr/devicetree.h> #include <zephyr/drivers/gpio.h> /* STEP 6 - Include the header file of printk */ #include <zephyr/sys/printk.h> /* STEP 8.1 - Define the macro MAX_NUMBER_FACT that represents the maximum number to calculate its * factorial */ #define SLEEP_TIME_MS 10 * 60 * 1000 #define SW0_NODE DT_ALIAS(sw0) static const struct gpio_dt_spec button = GPIO_DT_SPEC_GET(SW0_NODE, gpios); #define LED0_NODE DT_ALIAS(led0) static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios); /* STEP 8.2 - Replace the button callback function */ void button_pressed(const struct device *dev, struct gpio_callback *cb, uint32_t pins) { gpio_pin_toggle_dt(&led); } static struct gpio_callback button_cb_data; int main(void) { int ret; /* STEP 7 - Print a simple banner */ printk("nRF Connect SDK Fundamentals - Lesson 4 - Exercise 1\n"); /* Only checking one since led.port and button.port point to the same device, &gpio0 */ if (!device_is_ready(led.port)) { return -1; } ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE); if (ret < 0) { return -1; } ret = gpio_pin_configure_dt(&button, GPIO_INPUT); if (ret < 0) { return -1; } ret = gpio_pin_interrupt_configure_dt(&button, GPIO_INT_EDGE_TO_ACTIVE); gpio_init_callback(&button_cb_data, button_pressed, BIT(button.pin)); gpio_add_callback(button.port, &button_cb_data); while (1) { k_msleep(SLEEP_TIME_MS); } }