Skip to main content
grzegorz
Associate III
Nov 5, 2026 11:25 AM UTC
Question

Unmodified semihosting output

I use semihosting configured according to 

The problem is that the output is unnecessarely manipulated insted of displaying as it is sent by code. First it adds new line to every semihosting packet. If text is sent one character at a time you get vertical text, one character per line. And if you try something like this:
printf(“The data is ”);
printf(“%d\n”, data);
You get two lines, although one \n was used.
But there is more: line breaks in semihosting text are removed.
printf(“These are\ntwo lines”);
This gives one line instead of two. Why Cube can’t just display text as it is instead of adding and removing line breaks at arbitrary moments? What is it for and how can it be disabled?