11 months, 2 weeks ago.

Printf prints random characters in serial terminal

Greetings I am currently trying read serial data on a terminal from my STM Nucleo F767Zi. I'm doing something experimental , I imported code from CubeMX and basically edited it so that it could compile in Mbed. It compiles and does exactly what I require. All I did was change my main.c to main.cpp and kept the rest of my code the same apart from the sections that clashed with Mbed .

In my program I attempt to write using the printf provided by Mbed to a Realterm (My Serial Capture Terminal) and all it gives out is these weird symbols : /media/uploads/Amwila/realterm.png

I am able to write using printf in all my other programs so I know the problem is specific to this program. I have checked the baud rate , parity and stop bit settings in my terminal and device manager and everything checks out . Does anyone know how I can fix this?

I've even looked at the Ascii and tried to correlate the messages I'm trying to send to the gibberish . The two print statements are shown in the sceenshot below: /media/uploads/Amwila/pictures.png

Comment on this question

1 Answer

11 months, 2 weeks ago.

I've seen this happen on ST boards where the clock source configuration was not set correctly. I'd compare those to a project that works.

That would make sense since I generated code to use my maximum clock frequency. Do you perhaps know how I check and change my System clock speed in Mbed.

posted by Anthony Mukuka Mwila 12 Oct 2017

On xDot (also ST silicon) it was done like this. I'd suggest searching through the F767Zi HAL to see if there's something related to this...

posted by Jan Jongboom 12 Oct 2017

To post an answer, please log in.