first i change to my kconfig file add this
second config of my custom board
first i change to my kconfig file add this
Hi,
Which version of the nRF Connect SDK are you using?
Your example works when I test it on the nRF52840 DK with v3.0.0.
Please note that by default, the USB CDC ACM on the DK is the nRF USB, and not the UART routed through the interface MCU, so you must connect the USB cable to the nRF USB connector:
Here is everything you need to add for USB CDC ACM in a project:
Devicetree overlay:
/ { chosen { // What to have here depends on what you will use cdc_acm_uart for // Here are some examples: // zephyr,shell-uart = &cdc_acm_uart0; // zephyr,console = &cdc_acm_uart0; }; }; &zephyr_udc0 { cdc_acm_uart0: cdc_acm_uart0 { compatible = "zephyr,cdc-acm-uart"; }; };
prj.conf:
CONFIG_USB_CDC_ACM=y CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_REMOTE_WAKEUP=n CONFIG_USB_DEVICE_PRODUCT="My USB product" CONFIG_USB_DEVICE_VID=0x1915 CONFIG_USB_DEVICE_PID=0x0000
main.c:
#include <zephyr/usb/usb_device.h> ... int ret; ret = usb_enable(NULL); if (ret != 0 && ret != -EALREADY) { return 0; }
I have attached a project where I have added USB CDC ACM support to Zephyr's Hello World to show how to add support for this easily.
Best regards,
Marte
Hi,
Which version of the nRF Connect SDK are you using?
Your example works when I test it on the nRF52840 DK with v3.0.0.
Please note that by default, the USB CDC ACM on the DK is the nRF USB, and not the UART routed through the interface MCU, so you must connect the USB cable to the nRF USB connector:
Here is everything you need to add for USB CDC ACM in a project:
Devicetree overlay:
/ { chosen { // What to have here depends on what you will use cdc_acm_uart for // Here are some examples: // zephyr,shell-uart = &cdc_acm_uart0; // zephyr,console = &cdc_acm_uart0; }; }; &zephyr_udc0 { cdc_acm_uart0: cdc_acm_uart0 { compatible = "zephyr,cdc-acm-uart"; }; };
prj.conf:
CONFIG_USB_CDC_ACM=y CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_REMOTE_WAKEUP=n CONFIG_USB_DEVICE_PRODUCT="My USB product" CONFIG_USB_DEVICE_VID=0x1915 CONFIG_USB_DEVICE_PID=0x0000
main.c:
#include <zephyr/usb/usb_device.h> ... int ret; ret = usb_enable(NULL); if (ret != 0 && ret != -EALREADY) { return 0; }
I have attached a project where I have added USB CDC ACM support to Zephyr's Hello World to show how to add support for this easily.
Best regards,
Marte