qusetion about uart and shell

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

Moderator: RoccoMarco

Post Reply
XXzzz
Posts: 15
Joined: Wed Dec 20, 2017 8:14 am
Has thanked: 3 times
Been thanked: 1 time

qusetion about uart and shell

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

Re: qusetion about uart and shell

Post 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
XXzzz
Posts: 15
Joined: Wed Dec 20, 2017 8:14 am
Has thanked: 3 times
Been thanked: 1 time

Re: qusetion about uart and shell

Post by XXzzz »

Thanks for your help.by the way are there have any documentation about the chprintf or shell ?
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: qusetion about uart and shell

Post 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
XXzzz
Posts: 15
Joined: Wed Dec 20, 2017 8:14 am
Has thanked: 3 times
Been thanked: 1 time

Re: qusetion about uart and shell

Post by XXzzz »

Thanks again for your help
Post Reply