I cannot get output from printk to appear in RTT viewer. I have this working fine in other Zephyr projects and am puzzled as to why it won't work in this case. I'm developing for an Adafruit feather nrf52840 board, was using SDK 3.1.1 but just tried updating to 3.4.0 (no help). My prj.conf contains:
CONFIG_GPIO=yCONFIG_SERIAL=y
CONFIG_UART_USE_RUNTIME_CONFIGURE=yCONFIG_CONSOLE=nCONFIG_UART_CONSOLE=n
# Route the logs to the RTT instead of uart0 so that uart0 is available for your useCONFIG_LOG=yCONFIG_LOG_PRINTK=yCONFIG_LOG_BACKEND_RTT=yCONFIG_USE_SEGGER_RTT=yCONFIG_SEGGER_RTT_PRINTF_BUFFER_SIZE=512
I have the latest jlink installed (v9.24a). This is what the RTT Viewer log contains:
LOG: J-Link RTT Viewer V9.24a: Logging started.LOG: Terminal 0 added.LOG: Connecting to J-Link via USB...LOG: Device "NRF52840_XXAA" selected.LOG: InitTarget() startLOG: InitTarget() end - Took 3.17msLOG: Found SW-DP with ID 0x2BA01477LOG: DPIDR: 0x2BA01477LOG: CoreSight SoC-400 or earlierLOG: Scanning AP map to find all available APsLOG: AP[2]: Stopped AP scan as end of AP map has been reachedLOG: AP[0]: AHB-AP (IDR: 0x24770011, ADDR: 0x00000000)LOG: AP[1]: JTAG-AP (IDR: 0x02880000, ADDR: 0x01000000)LOG: Iterating through AP map to find AHB-AP to useLOG: AP[0]: Core foundLOG: AP[0]: AHB-AP ROM base: 0xE00FF000LOG: CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)LOG: Found Cortex-M4 r0p1, Little endian.LOG: FPUnit: 6 code (BP) slots and 2 literal slotsLOG: CoreSight components:LOG: ROMTbl[0] @ E00FF000LOG: [0][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7LOG: [0][1]: E0001000 CID B105E00D PID 003BB002 DWTLOG: [0][2]: E0002000 CID B105E00D PID 002BB003 FPBLOG: [0][3]: E0000000 CID B105E00D PID 003BB001 ITMLOG: [0][4]: E0040000 CID B105900D PID 000BB9A1 TPIULOG: [0][5]: E0041000 CID B105900D PID 000BB925 ETMLOG: RTT Viewer connected.
I don't see any issues when building my project:
Building BLEquencerPlayerwest build --build-dir d:/workspaces/BLEquencerPlayer/build d:/workspaces/BLEquencerPlayer --pristine --board adafruit_feather_nrf52840/nrf52840 -- -DCONF_FILE="prj.conf" -DEXTRA_DTC_OVERLAY_FILE=adafruit_feather_nrf52840.overlay -DBLEquencerPlayer_CONF_FILE="prj.conf" -DBLEquencerPlayer_EXTRA_DTC_OVERLAY_FILE=adafruit_feather_nrf52840.overlay
-- west build: generating a build systemLoading Zephyr module(s) (Zephyr base): sysbuild_default-- Found Python3: C:/ncs/toolchains/dcbdc366a1/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.12") found components: Interpreter-- Cache files will be written to: C:/ncs/v3.4.0/zephyr/.cache-- Found west (found suitable version "1.5.0", minimum required is "0.14.0")-- Board: adafruit_feather_nrf52840, qualifiers: nrf52840Parsing C:/ncs/v3.4.0/zephyr/share/sysbuild/KconfigLoaded configuration 'D:/workspaces/BLEquencerPlayer/build/_sysbuild/empty.conf'Merged configuration 'D:/workspaces/BLEquencerPlayer/build/_sysbuild/empty.conf'Configuration saved to 'D:/workspaces/BLEquencerPlayer/build/zephyr/.config'Kconfig header saved to 'D:/workspaces/BLEquencerPlayer/build/_sysbuild/autoconf.h'-- ************************************** * Running CMake for BLEquencerPlayer * **************************************
Loading Zephyr default modules (Zephyr base).-- Application: D:/workspaces/BLEquencerPlayer-- CMake version: 4.2.1-- Found Python3: C:/ncs/toolchains/dcbdc366a1/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.12") found components: Interpreter-- Cache files will be written to: C:/ncs/v3.4.0/zephyr/.cache-- Zephyr version: 4.4.0 (C:/ncs/v3.4.0/zephyr)-- Found west (found suitable version "1.5.0", minimum required is "0.14.0")-- Board: adafruit_feather_nrf52840, qualifiers: nrf52840-- Found host-tools: zephyr 1.0.1 (C:/ncs/toolchains/dcbdc366a1/opt/zephyr-sdk)-- Found toolchain: zephyr 1.0.1 (C:/ncs/toolchains/dcbdc366a1/opt/zephyr-sdk)-- Found Dtc: C:/ncs/toolchains/dcbdc366a1/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")-- Found BOARD.dts: C:/ncs/v3.4.0/zephyr/boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840.dts-- Found devicetree overlay: D:/workspaces/BLEquencerPlayer/adafruit_feather_nrf52840.overlay-- Found devicetree overlay: adafruit_feather_nrf52840.overlay-- Generated zephyr.dts: D:/workspaces/BLEquencerPlayer/build/BLEquencerPlayer/zephyr/zephyr.dts-- Generated pickled edt: D:/workspaces/BLEquencerPlayer/build/BLEquencerPlayer/zephyr/edt.pickle-- Generated devicetree_generated.h: D:/workspaces/BLEquencerPlayer/build/BLEquencerPlayer/zephyr/include/generated/zephyr/devicetree_generated.hParsing C:/ncs/v3.4.0/zephyr/KconfigLoaded configuration 'C:/ncs/v3.4.0/zephyr/boards/adafruit/feather_nrf52840/adafruit_feather_nrf52840_defconfig'Merged configuration 'D:/workspaces/BLEquencerPlayer/prj.conf'Merged configuration 'D:/workspaces/BLEquencerPlayer/build/BLEquencerPlayer/zephyr/.config.sysbuild'Configuration saved to 'D:/workspaces/BLEquencerPlayer/build/BLEquencerPlayer/zephyr/.config'Kconfig header saved to 'D:/workspaces/BLEquencerPlayer/build/BLEquencerPlayer/zephyr/include/generated/zephyr/autoconf.h'-- Found GnuLd: C:/ncs/toolchains/dcbdc366a1/opt/zephyr-sdk/gnu/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.43.1")-- The C compiler identification is GNU 14.3.0-- The CXX compiler identification is GNU 14.3.0-- The ASM compiler identification is GNU-- Found assembler: C:/ncs/toolchains/dcbdc366a1/opt/zephyr-sdk/gnu/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe-- Using ccache: C:/ncs/toolchains/dcbdc366a1/opt/bin/ccache.exe-- Found gen_kobject_list: C:/ncs/v3.4.0/zephyr/scripts/build/gen_kobject_list.py-- Configuring done (50.6s)-- Generating done (2.7s)-- Build files have been written to: D:/workspaces/BLEquencerPlayer/build/BLEquencerPlayer-- Configuring done (63.3s)-- Generating done (0.3s)-- Build files have been written to: D:/workspaces/BLEquencerPlayer/build-- west build: building application[4/233] Generating include/generated/zephyr/version.h-- Zephyr version: 4.4.0 (C:/ncs/v3.4.0/zephyr), build: ncs-v3.4.0[233/233] Linking C executable zephyr\zephyr.elfMemory region Used Size Region Size %age Used FLASH: 146568 B 1 MB 13.98% RAM: 48944 B 256 KB 18.67% IDT_LIST: 0 B 32 KB 0.00%Generating files from D:/workspaces/BLEquencerPlayer/build/BLEquencerPlayer/zephyr/zephyr.elf for board: adafruit_feather_nrf52840/nrf52840[8/8] Completed 'BLEquencerPlayer' * Terminal will be reused by tasks, press any key to close it.
I'm not sure what other information might be helpful. Hope someone can help with this. Thanks in anticipation.