Page 1 of 1

qusetion about uart and shell

Posted: Wed Dec 20, 2017 8:25 am
by XXzzz
1.i can run the shell with usb,but how to use shell with uart?
2.when i use chprintf like this chprintf((BaseSequentialStream *)&UARTD2,"hello!"); it doesn't work,and sometimes chprintf((BaseSequentialStream *)&USBD1,"hello!"); also doesn't work. are there have any documentation to learn about :how to use chprintf , shell?

Re: qusetion about uart and shell

Posted: Wed Dec 20, 2017 8:31 am
by Giovanni
Hi,

The shell and chprintf() can be used on any object implementing a stream interface, the UART driver does not implement such interface, you need to use the serial driver for this.

Giovanni

Re: qusetion about uart and shell

Posted: Wed Dec 20, 2017 8:38 am
by XXzzz
Thanks for your help.by the way are there have any documentation about the chprintf or shell ?

Re: qusetion about uart and shell

Posted: Wed Dec 20, 2017 8:44 am
by Giovanni
There is no specific documentation, you can generate it using doxygen on source files but it is exactly what you can see in the source comments.

There are lots of examples in demos and test applications.

Giovanni

Re: qusetion about uart and shell

Posted: Wed Dec 20, 2017 8:47 am
by XXzzz
Thanks again for your help