Read debugs from nrf52840 dongle on nrf52840 DK

Hi,

I've surfed through the forum for the lot of similar posts but couldn't get it to work yet. So, apologies if this seems repetitive.

My ultimate goal is to port the program that is running perfectly on nrf52840 DK to nrf52840 dongle. Before we get there, I'm currently trying to read debugs from the dongle on the DK for basic checking.

I've gone through this tutorial and included the voltage setter script in the programs. For more background, I'm trying to follow this tutorial

Problem

This is the code I've uploaded into the dongle. It's just the sample blinky code with voltage setter snippet and printk statement.  

/*
 * Copyright (c) 2016 Intel Corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <zephyr.h>
#include <device.h>
#include <devicetree.h>
#include <drivers/gpio.h>
#include <sys/printk.h>

/* 1000 msec = 1 sec */
#define SLEEP_TIME_MS   1000

/* The devicetree node identifier for the "led0" alias. */
#define LED0_NODE DT_ALIAS(led0)

#if DT_NODE_HAS_STATUS(LED0_NODE, okay)
#define LED0	DT_GPIO_LABEL(LED0_NODE, gpios)
#define PIN	DT_GPIO_PIN(LED0_NODE, gpios)
#define FLAGS	DT_GPIO_FLAGS(LED0_NODE, gpios)
#else
/* A build error here means your board isn't set up to blink an LED. */
#error "Unsupported board: led0 devicetree alias is not defined"
#define LED0	""
#define PIN	0
#define FLAGS	0
#endif

void main(void)
{
	/* Change voltage if we use nrf DK to program the dongle (code snippet from tutorial)*/
	if ((NRF_UICR->REGOUT0 & UICR_REGOUT0_VOUT_Msk) == (UICR_REGOUT0_VOUT_DEFAULT << UICR_REGOUT0_VOUT_Pos)){
		NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen;
		while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}

		NRF_UICR->REGOUT0 = (NRF_UICR->REGOUT0 & ~((uint32_t)UICR_REGOUT0_VOUT_Msk)) |
							(UICR_REGOUT0_VOUT_3V0 << UICR_REGOUT0_VOUT_Pos);

		NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren;
		while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}

		// System reset is needed to update UICR registers.
		NVIC_SystemReset();
	}
	/*******************************************/

	const struct device *dev;
	bool led_is_on = true;
	int ret;

	dev = device_get_binding(LED0);
	if (dev == NULL) {
		return;
	}

	ret = gpio_pin_configure(dev, PIN, GPIO_OUTPUT_ACTIVE | FLAGS);
	if (ret < 0) {
		return;
	}

	while (1) {
		gpio_pin_set(dev, PIN, (int)led_is_on);
		led_is_on = !led_is_on;
		printk("Hello World! %s\n", CONFIG_BOARD);
		k_msleep(SLEEP_TIME_MS);
	}
}

It's successfully built using the nRF connect for VS code extension and then directly uploading the .hex file using the "nRF connect for Desktop" programmer app. I can see the dongle blinking, so it works.

Now, I've connected the dongle and the DK via SWD interface and DEBUG OUT as seen in the picture. 

The dongle is still flashing the green LED but I cannot detect a serial port anymore. Instead, I can only see the two j-link virtual ports. None of them is printing any debug logs. There's also RTT logging feature on the VS code and when it's selected I get this pop up and choose the right board as shown. I can see the green LED on DK board flashing very fast although I have no idea why is that.

However, nothing is still printed.

My DK board is nRF52840_xxAA_Rev3(as seen on the programmer app). I can see the SB19 pad beside the DEBUG OUT header on the DK board but this post states it doesn't need to be soldered to use.

Also, I'm seeing both boards on the programmer which sounds wrong. 

I'm sure I'm missing something here but can't figure out what after debugging for over 6 hours, hence seeking help.

Thanks

  • That's great! I'll try out your suggestion once I received them. Any chance it might be the issue with the DK board's DEBUG OUT header? Cheers

  • No there, shouldn't be an issue with the debug out header unless it's been physically damaged.

  • Hi Simon, I just got a chance to try it out now. I did as you outlined here. I shorted SB47 and connected the dongle only with the dk's Debug Out Connector. When I turn it on, it was flashing red. However, I opened up the vs code and build the default blinky project, choose a build option for the nrfdongle board, then flash it using the vscode "flash" in "nrf connect vs code extension". It asked me to erase full memory and I clicked yes. Then the red flash on the dongle stopped. After that nothing happens. I disconnected the dongle from the dk board and plugged into usb port for power but it didn't turn on either even if I press the boot button.

    Here's the log of the program flashing. Any more ideas?

    Building blinky_newest
    west build --build-dir c:\Users\DESKTOP-DAIN-03\Desktop\roobuck-scratch-repo\nordic_dev\blinky_newest\build c:\Users\DESKTOP-DAIN-03\Desktop\roobuck-scratch-repo\nordic_dev\blinky_newest --pristine --board nrf52840dongle_nrf52840 -- -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DCONFIG_DEBUG_OPTIMIZATIONS=y -DCONFIG_DEBUG_THREAD_INFO=y
    
    -- west build: generating a build system
    Including boilerplate (Zephyr base): C:/Users/DESKTOP-DAIN-03/ncs/v1.9.1/zephyr/cmake/app/boilerplate.cmake
    -- Application: C:/Users/DESKTOP-DAIN-03/Desktop/roobuck-scratch-repo/nordic_dev/blinky_newest
    -- Zephyr version: 2.7.99 (C:/Users/DESKTOP-DAIN-03/ncs/v1.9.1/zephyr), build: v2.7.99-ncs1-1
    -- Found Python3: C:/Users/DESKTOP-DAIN-03/ncs/v1.9.1/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
    -- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
    -- Board: nrf52840dongle_nrf52840
    -- Cache files will be written to: C:/Users/DESKTOP-DAIN-03/ncs/v1.9.1/zephyr/.cache
    -- Found dtc: C:/Users/DESKTOP-DAIN-03/ncs/v1.9.1/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found toolchain: gnuarmemb (c:/Users/DESKTOP-DAIN-03/ncs/v1.9.1/toolchain/opt)
    -- Found BOARD.dts: C:/Users/DESKTOP-DAIN-03/ncs/v1.9.1/zephyr/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840.dts
    -- Generated zephyr.dts: C:/Users/DESKTOP-DAIN-03/Desktop/roobuck-scratch-repo/nordic_dev/blinky_newest/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: C:/Users/DESKTOP-DAIN-03/Desktop/roobuck-scratch-repo/nordic_dev/blinky_newest/build/zephyr/include/generated/devicetree_unfixed.h
    -- Generated device_extern.h: C:/Users/DESKTOP-DAIN-03/Desktop/roobuck-scratch-repo/nordic_dev/blinky_newest/build/zephyr/include/generated/device_extern.h
    -- Including generated dts.cmake file: C:/Users/DESKTOP-DAIN-03/Desktop/roobuck-scratch-repo/nordic_dev/blinky_newest/build/zephyr/dts.cmake
    Parsing C:/Users/DESKTOP-DAIN-03/ncs/v1.9.1/zephyr/Kconfig
    Loaded configuration 'C:/Users/DESKTOP-DAIN-03/ncs/v1.9.1/zephyr/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840_defconfig'
    Merged configuration 'C:/Users/DESKTOP-DAIN-03/Desktop/roobuck-scratch-repo/nordic_dev/blinky_newest/prj.conf'
    Merged configuration 'C:/Users/DESKTOP-DAIN-03/Desktop/roobuck-scratch-repo/nordic_dev/blinky_newest/build/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to 'C:/Users/DESKTOP-DAIN-03/Desktop/roobuck-scratch-repo/nordic_dev/blinky_newest/build/zephyr/.config'
    Kconfig header saved to 'C:/Users/DESKTOP-DAIN-03/Desktop/roobuck-scratch-repo/nordic_dev/blinky_newest/build/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 9.2.1
    -- The CXX compiler identification is GNU 9.2.1
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/Users/DESKTOP-DAIN-03/ncs/v1.9.1/toolchain/opt/bin/arm-none-eabi-gcc.exe
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/Users/DESKTOP-DAIN-03/Desktop/roobuck-scratch-repo/nordic_dev/blinky_newest/build
    -- west build: building application
    [1/156] Generating misc/generated/syscalls.json, misc/generated/struct_tags.json
    [2/156] Generating include/generated/driver-validation.h
    [3/156] Generating include/generated/kobj-types-enum.h, include/generated/otype-to-str.h, include/generated/otype-to-size.h
    [4/156] Generating include/generated/syscall_dispatch.c, include/generated/syscall_list.h
    [5/156] Building C object zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj
    [6/156] Generating include/generated/offsets.h
    [7/156] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/cpu_idle.S.obj
    [8/156] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap_helper.S.obj
    [9/156] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi_on_reset.S.obj
    [10/156] Building ASM object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/isr_wrapper.S.obj
    [11/156] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/nmi.c.obj
    [12/156] Building C object zephyr/arch/common/CMakeFiles/arch__common.dir/sw_isr_common.c.obj
    [13/156] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/thread.c.obj
    [14/156] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/prep_c.c.obj
    [15/156] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/swap.c.obj
    [16/156] Generating linker_zephyr_pre1.cmd
    [17/156] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/irq_manage.c.obj
    [18/156] Building C object zephyr/lib/posix/CMakeFiles/lib__posix.dir/pthread_common.c.obj
    [19/156] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/reset.S.obj
    [20/156] Generating linker_zephyr_pre0.cmd
    [21/156] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/exc_exit.S.obj
    [22/156] Building C object zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/fatal.c.obj
    [23/156] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/vector_table.S.obj
    [24/156] Building C object zephyr/arch/common/CMakeFiles/isr_tables.dir/isr_tables.c.obj
    [25/156] Building ASM object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault_s.S.obj
    [26/156] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/irq_init.c.obj
    [27/156] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdout/fprintf.c.obj
    [28/156] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fpu.c.obj
    [29/156] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/thread_abort.c.obj
    [30/156] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/strtoul.c.obj
    [31/156] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/time/gmtime.c.obj
    [32/156] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/scb.c.obj
    [33/156] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/atoi.c.obj
    [34/156] Building C object zephyr/arch/arch/arm/core/aarch32/mpu/CMakeFiles/arch__arm__core__aarch32__mpu.dir/arm_core_mpu.c.obj
    [35/156] Building C object zephyr/arch/arch/arm/core/aarch32/cortex_m/CMakeFiles/arch__arm__core__aarch32__cortex_m.dir/fault.c.obj
    [36/156] Building C object zephyr/arch/arch/arm/core/aarch32/mpu/CMakeFiles/arch__arm__core__aarch32__mpu.dir/arm_mpu.c.obj
    [37/156] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/strtol.c.obj
    [38/156] Linking C static library zephyr\arch\arch\arm\core\aarch32\libarch__arm__core__aarch32.a
    [39/156] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/bsearch.c.obj
    [40/156] Linking C static library zephyr\arch\common\libisr_tables.a
    [41/156] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/qsort.c.obj
    [42/156] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/string/strstr.c.obj
    [43/156] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/exit.c.obj
    [44/156] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/abort.c.obj
    [45/156] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/string/string.c.obj
    [46/156] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/string/strncasecmp.c.obj
    [47/156] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdout/sprintf.c.obj
    [48/156] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/string/strspn.c.obj
    [49/156] Linking C static library zephyr\arch\arch\arm\core\aarch32\mpu\libarch__arm__core__aarch32__mpu.a
    [50/156] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdout/stdout_console.c.obj
    [51/156] Building C object zephyr/lib/libc/minimal/CMakeFiles/lib__libc__minimal.dir/source/stdlib/malloc.c.obj
    [52/156] Linking C static library zephyr\arch\common\libarch__common.a
    [53/156] Linking C static library zephyr\arch\arch\arm\core\aarch32\cortex_m\libarch__arm__core__aarch32__cortex_m.a
    [54/156] Building C object zephyr/soc/arm/common/cortex_m/CMakeFiles/soc__arm__common__cortex_m.dir/arm_mpu_regions.c.obj
    [55/156] Building C object zephyr/lib/posix/CMakeFiles/lib__posix.dir/nanosleep.c.obj
    [56/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf.c.obj
    [57/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc16_sw.c.obj
    [58/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32c_sw.c.obj
    [59/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc32_sw.c.obj
    [60/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_packaged.c.obj
    [61/156] Building C object zephyr/soc/arm/nordic_nrf/nrf52/CMakeFiles/soc__arm__nordic_nrf__nrf52.dir/soc.c.obj
    [62/156] Building C object zephyr/boards/arm/nrf52840dongle_nrf52840/CMakeFiles/boards__arm__nrf52840dongle_nrf52840.dir/board.c.obj
    [63/156] Building C object zephyr/soc/arm/nordic_nrf/nrf52/CMakeFiles/soc__arm__nordic_nrf__nrf52.dir/power.c.obj
    [64/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc8_sw.c.obj
    [65/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/crc7_sw.c.obj
    [66/156] Linking C static library zephyr\lib\posix\liblib__posix.a
    [67/156] Linking C static library zephyr\soc\arm\common\cortex_m\libsoc__arm__common__cortex_m.a
    [68/156] Building C object CMakeFiles/app.dir/src/main.c.obj
    [69/156] Linking C static library zephyr\lib\libc\minimal\liblib__libc__minimal.a
    [70/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/dec.c.obj
    [71/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/hex.c.obj
    [72/156] Linking C static library zephyr\soc\arm\nordic_nrf\nrf52\libsoc__arm__nordic_nrf__nrf52.a
    [73/156] Linking C static library zephyr\boards\arm\nrf52840dongle_nrf52840\libboards__arm__nrf52840dongle_nrf52840.a
    [74/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/notify.c.obj
    [75/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/fdtable.c.obj
    [76/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/printk.c.obj
    [77/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/onoff.c.obj
    [78/156] Linking C static library app\libapp.a
    [79/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap.c.obj
    [80/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/timeutil.c.obj
    [81/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/sem.c.obj
    [82/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/thread_entry.c.obj
    [83/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap-validate.c.obj
    [84/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/reboot.c.obj
    [85/156] Building C object zephyr/CMakeFiles/zephyr.dir/misc/generated/configs.c.obj
    [86/156] Building ASM object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/common/soc_nrf_common.S.obj
    [87/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/rb.c.obj
    [88/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/multi_heap.c.obj
    [89/156] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_base_addresses.c.obj
    [90/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/cbprintf_complete.c.obj
    [91/156] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/debug/thread_info.c.obj
    [92/156] Building C object zephyr/CMakeFiles/zephyr.dir/soc/arm/nordic_nrf/validate_enabled_instances.c.obj
    [93/156] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/bitarray.c.obj
    [94/156] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/policy/residency.c.obj
    [95/156] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/constraint.c.obj
    [96/156] Building C object zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj
    [97/156] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/pm/pm.c.obj
    [98/156] Building C object zephyr/CMakeFiles/zephyr.dir/C_/Users/DESKTOP-DAIN-03/ncs/v1.9.1/nrfxlib/crypto/nrf_cc310_platform/src/nrf_cc3xx_platform_abort_zephyr.c.obj
    [99/156] Building C object zephyr/drivers/timer/CMakeFiles/drivers__timer.dir/sys_clock_init.c.obj
    [100/156] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/tracing/tracing_none.c.obj
    [101/156] Building C object zephyr/CMakeFiles/zephyr.dir/C_/Users/DESKTOP-DAIN-03/ncs/v1.9.1/nrfxlib/crypto/nrf_cc310_platform/src/nrf_cc3xx_platform_mutex_zephyr.c.obj
    [102/156] Building C object zephyr/drivers/gpio/CMakeFiles/drivers__gpio.dir/gpio_nrfx.c.obj
    [103/156] Building C object modules/nrf/lib/fatal_error/CMakeFiles/..__nrf__lib__fatal_error.dir/fatal_error.c.obj
    [104/156] Building C object zephyr/drivers/clock_control/CMakeFiles/drivers__clock_control.dir/clock_control_nrf.c.obj
    [105/156] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/Users/DESKTOP-DAIN-03/ncs/v1.9.1/modules/hal/nordic/nrfx/mdk/system_nrf52840.c.obj
    [106/156] Building C object modules/nrf/drivers/hw_cc310/CMakeFiles/..__nrf__drivers__hw_cc310.dir/hw_cc310.c.obj
    [107/156] Building C object zephyr/drivers/timer/CMakeFiles/drivers__timer.dir/nrf_rtc_timer.c.obj
    [108/156] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/nrfx_glue.c.obj
    [109/156] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/Users/DESKTOP-DAIN-03/ncs/v1.9.1/modules/hal/nordic/nrfx/helpers/nrfx_flag32_allocator.c.obj
    [110/156] Linking C static library modules\nrf\lib\fatal_error\lib..__nrf__lib__fatal_error.a
    [111/156] Linking C static library zephyr\drivers\gpio\libdrivers__gpio.a
    [112/156] Linking C static library modules\nrf\drivers\hw_cc310\lib..__nrf__drivers__hw_cc310.a
    [113/156] Linking C static library zephyr\drivers\clock_control\libdrivers__clock_control.a
    [114/156] Linking C static library zephyr\drivers\timer\libdrivers__timer.a
    [115/156] Linking C static library zephyr\libzephyr.a
    [116/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/condvar.c.obj
    [117/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/system_work_q.c.obj
    [118/156] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/Users/DESKTOP-DAIN-03/ncs/v1.9.1/modules/hal/nordic/nrfx/drivers/src/nrfx_clock.c.obj
    [119/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/stack.c.obj
    [120/156] Building C object modules/hal_nordic/nrfx/CMakeFiles/modules__hal_nordic__nrfx.dir/C_/Users/DESKTOP-DAIN-03/ncs/v1.9.1/modules/hal/nordic/nrfx/drivers/src/nrfx_gpiote.c.obj
    [121/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/fatal.c.obj
    [122/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/main_weak.c.obj
    [123/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/sched.c.obj
    [124/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/work.c.obj
    [125/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/banner.c.obj
    [126/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/kheap.c.obj
    [127/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/device.c.obj
    [128/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/init.c.obj
    [129/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/version.c.obj
    [130/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/errno.c.obj
    [131/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/idle.c.obj
    [132/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mem_slab.c.obj
    [133/156] Linking C static library modules\hal_nordic\nrfx\libmodules__hal_nordic__nrfx.a
    [134/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/xip.c.obj
    [135/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/msg_q.c.obj
    [136/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mailbox.c.obj
    [137/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/sem.c.obj
    [138/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/thread.c.obj
    [139/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/queue.c.obj
    [140/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/pipes.c.obj
    [141/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mutex.c.obj
    [142/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/timer.c.obj
    [143/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/mempool.c.obj
    [144/156] Building C object zephyr/kernel/CMakeFiles/kernel.dir/timeout.c.obj
    [145/156] Linking C static library zephyr\kernel\libkernel.a
    [146/156] Linking C executable zephyr\zephyr_pre0.elf
    
    [147/156] Generating dev_handles.c
    [148/156] Building C object zephyr/CMakeFiles/zephyr_pre1.dir/misc/empty_file.c.obj
    [149/156] Building C object zephyr/CMakeFiles/zephyr_pre1.dir/dev_handles.c.obj
    [150/156] Linking C executable zephyr\zephyr_pre1.elf
    
    [151/156] Generating linker.cmd
    [152/156] Generating isr_tables.c, isrList.bin
    [153/156] Building C object zephyr/CMakeFiles/zephyr_final.dir/misc/empty_file.c.obj
    [154/156] Building C object zephyr/CMakeFiles/zephyr_final.dir/isr_tables.c.obj
    [155/156] Building C object zephyr/CMakeFiles/zephyr_final.dir/dev_handles.c.obj
    [156/156] Linking C executable zephyr\zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       25288 B      1020 KB      2.42%
                SRAM:        6272 B       256 KB      2.39%
            IDT_LIST:          0 GB         2 KB      0.00%
    
    Terminal will be reused by tasks, press any key to close it.
    
    > Executing task: nRF Connect: Build: blinky_newest/build (active) <
    
    Building blinky_newest
    west build --build-dir c:\Users\DESKTOP-DAIN-03\Desktop\roobuck-scratch-repo\nordic_dev\blinky_newest\build c:\Users\DESKTOP-DAIN-03\Desktop\roobuck-scratch-repo\nordic_dev\blinky_newest
    
    ninja: no work to do.
    
    Terminal will be reused by tasks, press any key to close it.
    
    > Executing task: nRF Connect: Flash: blinky_newest/build (active) <
    
    Flashing build to undefined
    west flash -d c:\Users\DESKTOP-DAIN-03\Desktop\roobuck-scratch-repo\nordic_dev\blinky_newest\build --skip-rebuild -r nrfjprog --dev-id 1050239339
    
    -- west flash: using runner nrfjprog
    -- runners.nrfjprog: Flashing file: c:\Users\DESKTOP-DAIN-03\Desktop\roobuck-scratch-repo\nordic_dev\blinky_newest\build\zephyr\zephyr.hex
    ERROR: The operation attempted is unavailable due to readback protection in
    ERROR: your device. Please use --recover to unlock the device.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed.
    ERROR: runners.nrfjprog: Flashing failed because the target must be recovered.
      To fix, run "west flash --recover" instead.
      Note: this will recover and erase all flash memory prior to reflashing.
    FATAL ERROR: command exited with status 16: nrfjprog --program 'c:\Users\DESKTOP-DAIN-03\Desktop\roobuck-scratch-repo\nordic_dev\blinky_newest\build\zephyr\zephyr.hex' --sectoranduicrerase -f NRF52 --snr 1050239339
    The terminal process terminated with exit code: 16.
    
    Terminal will be reused by tasks, press any key to close it.
    
    > Executing task: nRF Connect: Flash: blinky_newest/build (active) <
    
    Flashing build to undefined
    west flash -d c:\Users\DESKTOP-DAIN-03\Desktop\roobuck-scratch-repo\nordic_dev\blinky_newest\build --skip-rebuild -r nrfjprog --dev-id 1050239339 --recover
    
    -- west flash: using runner nrfjprog
    -- runners.nrfjprog: Recovering and erasing all flash memory.
    Recovering device. This operation might take 30s.
    Writing image to disable ap protect.
    Erasing user code and UICR flash areas.
    -- runners.nrfjprog: Flashing file: c:\Users\DESKTOP-DAIN-03\Desktop\roobuck-scratch-repo\nordic_dev\blinky_newest\build\zephyr\zephyr.hex
    Parsing image file.
    WARNING: A programming operation has been performed without --verify.
    WARNING: Programming can fail without error.
    Enabling pin reset.
    Applying pin reset.
    -- runners.nrfjprog: Board with serial number 1050239339 flashed successfully.
    
    Terminal will be reused by tasks, press any key to close it.

  • Hi

    It seems like the application built correctly, but that you erased the bootloader in the process, meaning that you have to revert it to the production bootloader as explained in the Dongle Programming tutorial to be able to program it again.

    If it was indeed programmed with your "blinky_newest" application it should run that when powered. The reason you might not see any blinking LED is that the pin configured to blink is an unassigned GPIO on the Dongle compared to on one of your DKs.

    Best regards,

    Simon

  • Ok that makes sense. I'll revert it back to production bootloader and try again. Is there a way to avoid removing the bootloader when flashing the program? 

    Regards

Related