cancel
Showing results for 
Search instead for 
Did you mean: 

UART escape sequences? NUCLEO-U575ZI

Skfir
Senior

Hello everybody!

I want to implement a simple UART debug/diagnose tool for my application, using UART on NUCLEO-U575ZI -> Termite or whatever other PC terminal program. Could please someone help me with a link to a list of escape sequences that I can use in order to manage the output text on the terminal? Such as cursor movements, text color changes etc.

Thank you guyz!

6 REPLIES 6
gbm
Lead III

Search the net for ANSI terminal or VT-100 control codes.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
Piranha
Chief II
Skfir
Senior

Guys thank you very much for the answers. I have found several sources with the codes, however I am a bit confused. For example, one source states: "ESC [ <n> A Cursor up by <n>". Great! But this is not the way we right the program code in C, right? What is "ESC"? Turns out that "ESC" is "\u001b", so in the code the command will look something like "\u001b[{n}A" :( Oh my... So perhaps someone knows a reference for ANSI commands, written in C-code friendly way?

P.S. Seems to have found!!

https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797

Normally the ESC is '\x1B'. And the GCC/Clang additionally support a non-standard '\e'.

S.Ma
Principal

I am puzzled, I don't think using a usart with a PC terminal such as Teraterm is mostly used to draw text in 2D screen. If you need pseudo graphical and not making a pong game, explore Android App "Bluetooth Electronics" which turns your phone into a remote bluetooth serial display with interactive widgets.

An example for STM32C031 with screen capture and source code can be found here.

Dig SIF.C (serial interface) and BTELxxx.c (Bluetooth Electronics) source file.

Thank you!