The Segger Compiler is integrated with JLINK debugging software
Printf statements, when compiled, direct to the studio debugger terminal
How can I create code where they are directed to the UART?
Project options allow configuration of printf and scanf format but not its output
I am using the uart example in Nordic SDK 12.3. The only way so far that I have found to 'print' to the UART is using a custom print function:
void uart_printf(const char *fmt, ...)
{
char buf[200], *p;
va_list ap;
va_start(ap, fmt);
vsnprintf(buf, sizeof(buf), fmt, ap);
for (p = buf; *p; ++p)
app_uart_put(*p);
va_end(ap);
}
This works but seems laborious; what is the elegant way?
Many thanks
Rob