Hi there,
I'm in the middle of migrating an application from SDK 10 to SDK 11. In the SDK 10 version, I had RTT logging working just fine. I'm developing on a Mac so I had to start Segger's GDB server in order to get the RTT client to run. I have three terminal tabs open. A .gdbinit
file exists for these. I run these in this order:
-
GDB server:
/Applications/SEGGER/JLink/JLinkGDBServer -device nrf51822 -if swd -speed 4000 -port 2331
-
GDB Client:
/Users/Eliot/dev/gcc-arm-none-eabi-4_9-2015q1/bin/arm-none-eabi-gdb -x _build/.gdbinit _build//*.elf
-
RTT Client:
/Applications/SEGGER/JLink/JLinkRTTClient
I then need to "cont" and "cont" again in the GDB client to start my code. In SDK 10, I saw output on the RTT client terminal tab. In SDK 11, no such luck.
I retarget printf()
in my code. syscalls.c
looks like this:
int _write(int file, char *ptr, int len)
{
UNUSED_PARAMETER(file);
uint32_t bytes_written = 0;
#ifdef BIKE_TRACKER_TEST
SEGGER_RTT_Write(0, ptr, len);
#else
if (ble_connected())
{
write_over_ble(file, ptr, len);
}
else
{
bytes_written = SEGGER_RTT_Write(0, ptr, len);
UNUSED_PARAMETER(bytes_written);
}
#endif
return len;
}
The Segger RTT stuff is definitely getting compiled and linked in in my build:
APPLICATION_SRCS += SEGGER_RTT.c
APPLICATION_SRCS += SEGGER_RTT_printf.c
...
SOURCE_PATHS += $(SDK_PATH)../external/segger_rtt
I've read the tutorial here: devzone.nordicsemi.com/.../
I've debugged the code and set a breakpoint in SEGGER_RTT.c
at the start of SEGGER_RTT_Write()
. That function is executing. SEGGER_RTT_WriteNoLock()
is returning 7, which is about the number of characters I was writing when I debugged it.
Neither a straight printf()
nor a call to NRF_LOG()
is producing anything on the RTT client. It just sits there saying:
Process:
I'm running V5.12f of the Segger stuff, the latest at the time of writing.