This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Color in RTT Viewer

I want to highlight some items in RTT Viewer So I tried the color control, but didn't work This is my code.

SEGGER_RTT_printf(0, "%s[Mutex error:%u]\n%s", RTT_CTRL_BG_BRIGHT_RED, status, RTT_CTRL_RESET);

But I got the control string directly printed in the RTT viewer. Did I miss anything? Thanks

Parents
  • Looks like the \e in SEGGER_RTT.h is not correctly handled as ESC. You can fix this by replacing \e with the correpsonding ASCII oct 033.

    In SDK_INSTALL_FOLDER/external/segger_rtt/SEGGER_RTT.h

    Replace #define RTT_CTRL_RESET "\e[0m" with #define RTT_CTRL_RESET "\033[0m"

    and #define RTT_CTRL_BG_BRIGHT_RED "\e[4;41m" with #define RTT_CTRL_BG_BRIGHT_RED "\033[4;41m"

Reply
  • Looks like the \e in SEGGER_RTT.h is not correctly handled as ESC. You can fix this by replacing \e with the correpsonding ASCII oct 033.

    In SDK_INSTALL_FOLDER/external/segger_rtt/SEGGER_RTT.h

    Replace #define RTT_CTRL_RESET "\e[0m" with #define RTT_CTRL_RESET "\033[0m"

    and #define RTT_CTRL_BG_BRIGHT_RED "\e[4;41m" with #define RTT_CTRL_BG_BRIGHT_RED "\033[4;41m"

Children
Related