AnalogIn is not working out of the box for stm32u585

I am using the dev board “B-U585I-IOT02A” from ST electronics. I am trying to display the internal temperature but unable to get them from the available example. My code looks like follows, it would be great if any can support me with it.

"
AnalogIn tempIn(ADC_TEMP);
float tempValue;
float tempConv;

// main() runs in its own thread in the OS
int main() {

while (true) {
tempValue = tempIn.read();
tempConv = tempValue * 3300;
printf(“temp = %f\n”, tempValue); // display chip’s temperature [°C]
printf(“temp = %f\n”, tempConv); // display chip’s temperature [°C]

thread_sleep_for(1000);

}
}
"

Hello,

your description tell us nothing. What an output do you see?

BR, Jan

@JohnnyK , Thanks for the quick response. I could just see empty values i.e. “temp=%f”.

But now I could figure out the issue… After adding the following in mbed_app.json I could see the values printed i.e. “temp = 25.176615”

“target_overrides”: {
“*”: {
“target.printf_lib”: “std”
}
}

Yeah, that I expected

mbed-os/README.md at master · ARMmbed/mbed-os (github.com)

BR, Jan