I am trying to get the J-Link RTT viewer working with the Sysbuild Peripheral LBS Sample from the BLE FOTA DevAcademy lesson. I need the SEGGER J-Link RTT viewer working as I have a custom board and a J-Link PLUS compact.
I have a hello world sysbuild sample working which is printing LOG_DBG statements, but wanted to get it working on the BLE FOTA example as well. It's not working on my custom board and I wanted to make sure I understood what is needed to make it work.
Here is the prj.conf:
CONFIG_NCS_SAMPLES_DEFAULTS=y CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DEVICE_NAME="Test_LBS_Sysbuild" # Enable the LBS service CONFIG_BT_LBS=y CONFIG_BT_LBS_POLL_BUTTON=y CONFIG_DK_LIBRARY=y CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y #stuff I added CONFIG_DEBUG=y CONFIG_LOG=y CONFIG_FLASH=y CONFIG_GPIO=y CONFIG_USE_SEGGER_RTT=y
I added these two lines at the top of main.c:
#include <zephyr/logging/log.h> LOG_MODULE_REGISTER(app, LOG_LEVEL_DBG);
this to the top of int main(void):
LOG_DBG("Starting Bluetooth Peripheral LBS example %s", CONFIG_BOARD_TARGET);
and altered the loop in the main function to look like this:
for (;;) { dk_set_led(RUN_STATUS_LED, (++blink_status) % 2); LOG_DBG("Test"); k_sleep(K_MSEC(RUN_LED_BLINK_INTERVAL)); }
I see BLE advertising through the nrf Connect iOS app, so I know it's working.