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

On RTT Viewer log value

I would like to log the adc value on the RTT Viewer.

uint16_t adc_result; This is the variable, which I would like to log.

So after the measuring I call:

SEGGER_RTT_WriteString(0, adc_value);

This will throw an error, because the second parameter has to be a string.

SEGGER_RTT_WriteString is not a standard function, so it wont be able to add more parameters for converting the int to string.

So how I have to set up the secon parameter, if I want log adc_value?

Ok, from the tutorial I know, that I have to use SEGGER_RTT_printf().

But when I remove retarget,c file and uncheck use MicroLIB then my program wont work anymore.

It will build with success. But when I load the program on the chip, it wont work. If I add retarget.c file and check use MicroLIB then it will work again.

Related