I am using an nRF chip and the nRF SDK for 1st time and I think I am still at the steep part of the learning curve.
My problem is that I cannot get the log from my custom app in RTT Viewer. I use:
- custom PCB with Taiyo Yuden EYSKBNZWB/nRF52840 Wireless Module
- SDK 17.0.2
- arm gcc 10.3.1
- J-Link RTT Viewer V7.52b (JLinkRTTViewerExe)
- nRF5_SDK/examples/peripheral/template_project
In my main.c source file I have included the following headers: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Flib_nrf_log.html
- #include "nrf_log_ctrl.h"
- #include "nrf_log_default_backends.h"
- #include "nrf_log.h"
Again in the main.c source file, I have the define - https://devzone.nordicsemi.com/f/nordic-q-a/29977/undefined-reference-to-nrf_log_default_backend_init
- #define NRF_LOG_BACKEND_RTT_ENABLED 1
In the Makefile @ nRF5_SDK/examples/peripheral/template_project/pca10056/blank/armgcc I added the following line:
- $(SDK_ROOT)/components/libraries/log/src/nrf_log_default_backends.c \
in order to solve the linker issue: main.c: undefined reference to `nrf_log_default_backends_init'
In the sdk_config.h file @ nRF5_SDK/examples/peripheral/template_project/pca10056/blank/config I have the follwoing settings:
- #define NRF_LOG_ENABLED 1 // 0
- #define NRF_LOG_DEFERRED 0 // 1
- #define NRF_LOG_DEFAULT_LEVEL 3
- #define NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 0 // 1
- last one from: https://devzone.nordicsemi.com/f/nordic-q-a/46685/no-log-output-to-debug-terminal-in-ses-or-rtt-viewer
The contents of my main.s source file are:
int main ( void ) { ret_code_t err_code = NRF_LOG_INIT ( NULL ); APP_ERROR_CHECK ( err_code ); NRF_LOG_DEFAULT_BACKENDS_INIT (); while ( true ) { uint32_t i ; for ( i = 0; i < 10; i++ ) { NRF_LOG_INFO ( "i = %u\r\n", i ); } } }
I thought that I could see some numbers printed in RTT VIewer but unfortunately I still can't manage to get the RTT output into the RTT Viewer after reading several posts so I would ask for help at this point. Any would be highly appreciated :-)
P.S. I think the connection PC <-> J-Link <-> PCB works fine as I managed to get an LED blink ca. every second.