Page 1 of 1

Simplest way to print messages in terminal

Posted: Tue Aug 27, 2013 3:34 pm
by ilw
Hi,
I have a STM32F4 discovery board and am using it on linux with command line tools (st-util, gdb). I'm wondering what the easiest way to print debug messages in the st-util terminals is? I saw chprintf, but i wasn't 100% clear on how to create a stream linked to the terminal.
Is this easy / feasible, am i going about things completely the wrong way...??

Any help would be much appreciated!

Re: Simplest way to print messages in terminal

Posted: Tue Aug 27, 2013 3:44 pm
by Giovanni
Hi,

I never did that, if you are able to implement a stream then you could use chprintf() for that. What I usually do is to have a terminal connected to some serial port or USB virtual serial port and use a shell with custom commands over that.

Giovanni

Re: Simplest way to print messages in terminal

Posted: Tue Aug 27, 2013 10:01 pm
by Tectu
I usually have two separate files (usb_shell.[ch]) which handle all the USB streaming part. There are a lot of demos in the ChibiOS repository (/demos) which show how to create a USB-CDC device. Then I use minicom as the linux serial terminal of my choice to communicate with the USB-CDC device (/dev/ttyACMx).


~ Tectu