What is the encoding of the Atollic SWO printf console, and can it be changed?

Discuss how to use the features of Atollic TrueSTUDIO, including the editor, assembler, C/C++ compiler, linker, debugger, static code analysis and team collaboration tools.

Moderators: Markus Girdland, Mattias Norlander

chriskeeser
Posts: 6
Joined: Mon Feb 11, 2019 2:35 am

What is the encoding of the Atollic SWO printf console, and can it be changed?

Postby chriskeeser » Wed Feb 13, 2019 8:34 pm

When characters are sent over the SWO port and received by the SWO terminal, the terminal is interpreting those characters using (what appears to be) UTF-16 encoding. Can it be changed to UTF-8?

To demonstrate, use the following code to transmit two characters via ITM trace port 0:

// 'h' = 0x68, 'i' = 0x69
ITM->PORT[0].u16 = ('h' << 0) | ('i' << 8);

What the console displays: 楨 ("\u{6968}") which appears to be the UTF-16 decoding of the characters.

Return to “Atollic TrueSTUDIO tool discussions”

Who is online

Users browsing this forum: No registered users and 2 guests