Simplest way to print messages in terminal

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
ilw
Posts: 3
Joined: Tue Aug 27, 2013 3:14 pm

Simplest way to print messages in terminal

Post 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!
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Simplest way to print messages in terminal

Post 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
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: Simplest way to print messages in terminal

Post 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
Post Reply