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.
9 years, 5 months ago.
printf
I want to get printf to work with mbed for debugging. If there is a better way to debug, please let me know. Otherwise, I don't get printf decent to work. I think it's the communciationsettings, but I don't get it to work. All I get it garbage.
I use a macbook pro and a nucleo STM32F411 with the Terminal application from OSX.
Does anyone know what can be wrong?
1 Answer
9 years, 5 months ago.
This looks like a classical baud rate mismatch problem. I believe that using plain printf (without instantiating a serial object) defaults to baudrate of 9600 (8N1) on the TX/RX (PA2/PA3) pins (USART2). How did you configure the GNU Screen terminal program?
Try something like:
'screen /dev/tty.ACM0 9600'
Be sure to replace 'tty.ACM0' with the approriate serial port name of the Nucleo
Have a look here for more info on how to use screen:
http://www.cyberciti.biz/faq/unix-linux-apple-osx-bsd-screen-set-baud-rate/
https://wiki.archlinux.org/index.php/GNU_Screen
I personally prefer to use minicom & cutecom (on Linux)
Number of stop bits mismatched? or receiver is not ready to receive in time?
posted by Waldemar Dworakowski 20 Jul 2015