I'm debugging on RT1024EVK with a Segger J-Link using SWD (this is a separate debug probe, not the built-in debugger on the EVK). Debugging works great, with much faster software load than the built-in debugger. However, there's an SWO output bug on this platform. I'm working with a project based on EVK USB-FreeRTOS example...
printf is redirected to SWO (using the peripheral tool, Debug Console, set debug console functions type to “Toolchain” (from SDK), and set Serial Port Type to SWO (from UART)). A printf ending in \n prints text with a newline in the console, but then repeats the last 4 characters printed with a 2nd newline (see example below).
- Does anyone have a fix for this bug?
- In what code is output from printf redirected to SWO?
Thanks!
Best Regards, Dave
// Semihost output over SWO Bug:
// After each newline, prints line, newline, and then last 4 characters of line and another newline
printf("Line 1one\n");
printf("Line 2two\n");
//==Creates output like this==
// Line 1one
// 1one
// Line 2two
// 2two
// Bug specific to newline semihosting; redlib does not do this.
Update: This bug happens with newlib (semihost), but does not happen with Redlib (semihost-nb).
Unfortunately redlib is only for older C-only projects, not modern C++ as many of us require.