I have a custom board (nrf5340) and can debug it, but it will not print to J-Link RTT Viewer. The main looks like this and I tested with a breakpoint on the LOG_DBG using my J-Link Plus, so I know it's getting there.
#include <zephyr/kernel.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/pwm.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(app, LOG_LEVEL_DBG);
...
int main(void)
{
LOG_DBG("Starting Blinky Example");
//int ret;
bool led_state = false;
if (!device_is_ready(vib_motor.dev)) {
LOG_ERR("Vibration motor control not supported");
return -ENODEV;
}
LOG_DBG("Device is ready");
while (1) {
led_state = !led_state;
LOG_DBG("LED state: %s", led_state ? "ON" : "OFF");
if (led_state) {
vibration_manager_test(50);
}
k_msleep(SLEEP_TIME_MS);
}
return 0;
}
I have this in the prj.conf:
CONFIG_GPIO=y CONFIG_PWM=y CONFIG_LOG=y #Bluetooth Settings CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DEVICE_NAME="Hello_World_Blinky" #CONFIG_DEBUG_OPTIMIZATIONS=y #CONFIG_DEBUG_THREAD_INFO=y #Segger RTT Settings CONFIG_LOG_MODE_IMMEDIATE=n CONFIG_USE_SEGGER_RTT=y CONFIG_RTT_CONSOLE=y CONFIG_LOG_BACKEND_RTT=y CONFIG_UART_CONSOLE=n CONFIG_PRINTK=y
it's making it impossible to work with this board.