Re: reg: zephyr 1.6 => samples\usb\console

Chuck Jordan <Chuck.Jordan@...>

Well actually, I guess there are two concepts:

* "console" which could be printk's from even kernel code - going to one-and-only-one place

* "cli" - command line interface, which might support ascii commands, command-line-edit, history - such as the "readline" API.
It would be "cli" that could appear in many instantiations.


From: Chuck Jordan
Sent: Friday, December 09, 2016 2:41 PM
To: 'Joseph, Jithu' <jithu.joseph(a)>; Mahendravarman Rajarao (RBEI/EAA3) <Mahendravarman.Rajarao(a)>; devel(a)
Subject: RE: reg: zephyr 1.6 => samples\usb\console

Actually, it would be more ideal if on any given UART port, you could designate whether or not it should run a console, or be left to be open by the Application for some other purpose. If you had 2 UARTS, you might want a console on each.
OR you might want one to be running a modem and the other as a console.

Consoles should also APPEAR above a TELNET service if wifi/enet, if wanted.

Or a console on USB - yes.

I suppose even a web page can have a console inside - if someone implements that - and it could be more secure with ssl.

Consoles might also be wanted over JTAG - if JTAG has UART.


From: Joseph, Jithu [mailto:jithu.joseph(a)]
Sent: Monday, December 05, 2016 12:49 PM
To: Mahendravarman Rajarao (RBEI/EAA3) <Mahendravarman.Rajarao(a)<mailto:Mahendravarman.Rajarao(a)>>; devel(a)<mailto:devel(a)>
Subject: [devel] Re: reg: zephyr 1.6 => samples\usb\console

Please find the answers below :

Device binding is not needed for console display ?
No - application code need not do that. It is enough that the apps define CONFIG_UART_CONSOLE_ON_DEV_NAME if they want to override the default console device

Console output devices are opened from uart_console_init() ( drivers/console/uart_console.c ) as

uart_console_dev = device_get_binding(CONFIG_UART_CONSOLE_ON_DEV_NAME);

If CONFIG_USB_UART console is defined, CONFIG_UART_CONSOLE_ON_DEV_NAME defaults to "CDC_ACM" via (arch/x86/soc/intel_quark/quark_se/Kconfig.defconfig.series)

What the difference between the samples\usb\cdc_acm and samples\usb\console codes ?

The first one implements an echo type console on usb UART, wherein whatever character you type in minicom comes to the zephyr device and is echoed back to minicom. (While the debug prints still get routed to the actual physical uart). So in the sample app code you would see this logic.

In the second case, the config options cause the effect that all the debug prints come out via minicom on the host via the USB UART . The logic is mostly in the console driver (to plumb all the printks to USB UART) and the sample is meant to show config options as called out in README.

Hope that helps.


From: Mahendravarman Rajarao (RBEI/EAA3) [mailto:Mahendravarman.Rajarao(a)]
Sent: Monday, December 5, 2016 5:18 AM
To: devel(a)<mailto:devel(a)>
Subject: [devel] reg: zephyr 1.6 => samples\usb\console


Please help on the following

In the latest zephyr 1.6 release , under samples\usb\console folder, the example is given to show the console output coming to USB UART.

dev = device_get_binding(CONFIG_CDC_ACM_PORT_NAME); is missing in this console example
Device binding is not needed for console display ?

What the difference between the samples\usb\cdc_acm and samples\usb\console codes ?

Best regards

Join to automatically receive all group messages.