Skip to content
Snippets Groups Projects
Commit 40e5733e authored by Francesco Pham's avatar Francesco Pham
Browse files

debug-console: set overlay to enable shell/console over USB (CDC ACM)


currently shell and console is not working via USB, instead one have to use 
the UART interface and use a serial to USB cable to access the arduino shell. 

With this overlay configuration we are able to access the arduino shell 
using the USB port of the arduino. Also, we have to enable 
CONFIG_USB_DEVICE_STACK in prj.conf and call usb_enable() from the source.

Signed-off-by: default avatarFrancesco Pham <francesco.pham@huawei.com>
parent 1a666c9d
No related branches found
No related tags found
No related merge requests found
Pipeline #14585 failed with stages
in 18 seconds
/*
* SPDX-FileCopyrightText: Huawei Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
/ {
chosen {
zephyr,console = &cdc_acm_uart0;
zephyr,shell-uart = &cdc_acm_uart0;
};
};
&zephyr_udc0 {
cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};
......@@ -47,4 +47,7 @@ CONFIG_NET_CONFIG_NEED_IPV4=n
CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.168.7.2"
CONFIG_CPLUSPLUS=y
CONFIG_LIB_CPLUSPLUS=y
\ No newline at end of file
CONFIG_LIB_CPLUSPLUS=y
# For console over ACM0
CONFIG_USB_DEVICE_STACK=y
......@@ -6,6 +6,7 @@
#include "EddieEndpoint.h"
#include "eddie.h"
#include <zephyr/usb/usb_device.h>
#include <logging/log.h>
LOG_MODULE_REGISTER(main, LOG_LEVEL_DBG);
......@@ -147,6 +148,10 @@ static void start_eddie() {
int main(void)
{
if (usb_enable(NULL)) {
return -1;
}
wait_for_networking();
start_eddie();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment