qusetion about uart and shell

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

Moderators: RoccoMarco, barthess

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

qusetion about uart and shell

Postby XXzzz » Wed Dec 20, 2017 8:25 am

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: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: qusetion about uart and shell

Postby Giovanni » Wed Dec 20, 2017 8:31 am

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

Postby XXzzz » Wed Dec 20, 2017 8:38 am

Thanks for your help.by the way are there have any documentation about the chprintf or shell ?

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: qusetion about uart and shell

Postby Giovanni » Wed Dec 20, 2017 8:44 am

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

Postby XXzzz » Wed Dec 20, 2017 8:47 am

Thanks again for your help


Return to “STM32 Support”

Who is online

Users browsing this forum: Bing [Bot] and 46 guests