Page 1 of 1

Where can i see the output of chprintf() ?

Posted: Sun Jun 08, 2014 2:38 pm
by qbertsuit
Hi,

I'm new to the STM32 and ChibiOS. I have successfully flashed the RT-STM32F407-DISCOVERY-MEMS demo project using st-util in one terminal, and arm-none-eabi-gdb in another terminal. The leds light up as expected, but I can't see any text printed in the console. In the main.c file I can see a lot of chprintf calls.

Am I looking in the wrong place for the chprintf output?

Thanks!

Re: Where can i see the output of chprintf() ?

Posted: Sun Jun 08, 2014 3:34 pm
by lesto
as far as i know chpritnt is justa lightweight versione of printf, and by default it write to nothing. You have to create a stream (to serial, usb, even tcp) and then write into that

Re: Where can i see the output of chprintf() ?

Posted: Sun Jun 08, 2014 3:47 pm
by Giovanni
Hi,

The first parameter is the stream where the chprintf() writes on. If it is something like &SDx the it is a serial port, if you see &SDUx then it is a virtual COM port over USB.
The function can write on anything implementing a "stream interface".

Giovanni

Re: Where can i see the output of chprintf() ?

Posted: Sun Jun 08, 2014 4:37 pm
by qbertsuit
I found this in the code, so I guess it's using a virtual COM port over USB:

sduObjectInit(&SDU1);
sduStart(&SDU1, &serusbcfg);

How can I acyually read the stream from a Linux terminal?

Re: Where can i see the output of chprintf() ?

Posted: Sun Jun 08, 2014 4:42 pm
by Giovanni
You need to plug the board on an USB port then a new TTY should be created, then you can use a terminal emulator and interact with the board.

Giovanni