Using printk on custom board nRF Connect SDK

Hello.
I have a custom board featuring nRF5340. I have a programming interface that i connect to the DK in order to program it, using SWDIO, SWDCLK and RESET. In addition, I have a micro USB port set exactly like the on in the DK.

Given that, how do I make printk work? I would prefer to print via the dev-kit that i can connect to, and eventually send other data via uart_fifo_fill with USB.

What are the settings that I need in the devicetree?

Parents Reply Children
  • I fail to build with this setup.

    Any include to add?

  • What failed?
    Did you opened a J-Link RTT Viewer? 
    It should work with this configs 

  • The build is failing and it fails until i comment out the CONFIG_LOG =y line

    FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map
    cmd.exe /C "cd . && C:\ncs\toolchains\v2.2.0\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr\zephyr_pre0.elf -Wl,-T zephyr/linker_zephyr_pre0.cmd -Wl,-Map=C:/Users/dsortino/Desktop/GitHubProj/component_ifeel/element_firmware/iFeel_ConnectSDK/iFeel-WiredReceiver/build/zephyr/zephyr_pre0.map -Wl,--whole-archive app/libapp.a zephyr/libzephyr.a zephyr/arch/common/libarch__common.a zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a zephyr/arch/arch/arm/core/aarch32/cortex_m/libarch__arm__core__aarch32__cortex_m.a zephyr/arch/arch/arm/core/aarch32/cortex_m/cmse/libarch__arm__core__aarch32__cortex_m__cmse.a zephyr/arch/arch/arm/core/aarch32/mpu/libarch__arm__core__aarch32__mpu.a zephyr/lib/libc/minimal/liblib__libc__minimal.a zephyr/soc/arm/common/cortex_m/libsoc__arm__common__cortex_m.a zephyr/subsys/fs/libsubsys__fs.a zephyr/drivers/usb/device/libdrivers__usb__device.a zephyr/drivers/clock_control/libdrivers__clock_control.a zephyr/drivers/console/libdrivers__console.a zephyr/drivers/gpio/libdrivers__gpio.a zephyr/drivers/i2c/libdrivers__i2c.a zephyr/drivers/spi/libdrivers__spi.a zephyr/drivers/hwinfo/libdrivers__hwinfo.a zephyr/drivers/serial/libdrivers__serial.a zephyr/drivers/timer/libdrivers__timer.a modules/nrf/lib/fatal_error/lib..__nrf__lib__fatal_error.a modules/nrf/drivers/hw_cc310/lib..__nrf__drivers__hw_cc310.a modules/fatfs/lib..__modules__fs__fatfs.a modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a modules/segger/libmodules__segger.a -Wl,--no-whole-archive zephyr/kernel/libkernel.a zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj -L"c:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/thumb/v8-m.main/nofp" -LC:/Users/dsortino/Desktop/GitHubProj/component_ifeel/element_firmware/iFeel_ConnectSDK/iFeel-WiredReceiver/build/zephyr -lgcc zephyr/arch/common/libisr_tables.a -no-pie -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee -Wl,--gc-sections -Wl,--build-id=none -Wl,--sort-common=descending -Wl,--sort-section=alignment -Wl,-u,_OffsetAbsSyms -Wl,-u,_ConfigAbsSyms -nostdlib -static -Wl,-X -Wl,-N -Wl,--orphan-handling=warn C:/ncs/v2.2.0/nrfxlib/crypto/nrf_cc312_platform/lib/cortex-m33/soft-float/no-interrupts/libnrf_cc312_platform_0.9.16.a && cmd.exe /C "cd /D C:\Users\dsortino\Desktop\GitHubProj\component_ifeel\element_firmware\iFeel_ConnectSDK\iFeel-WiredReceiver\build\zephyr && C:\ncs\toolchains\v2.2.0\opt\bin\cmake.exe -E echo ""
    c:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: zephyr/libzephyr.a(sync_rtc.c.obj): in function `sync_rtc_setup':
    C:\ncs\v2.2.0\zephyr\soc\arm\nordic_nrf\nrf53\sync_rtc.c:240: undefined reference to `__device_dts_ord_21'
    collect2.exe: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.

Related