Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 1 month 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 :
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:
1 Answer
7 years, 1 month 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 12 Oct 2017On 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 12 Oct 2017