CONFIG_USB_DEVICE_STACK=y CONFIG_USB_DEVICE_PRODUCT="Zephyr CDC ACM sample" CONFIG_USB_DEVICE_PID=0x0001 CONFIG_LOG=y CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y CONFIG_SERIAL=y CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_UART_LINE_CTRL=y CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=y CONFIG_USB_CDC_ACM=y CONFIG_UART_CONSOLE=n CONFIG_LOG=y CONFIG_USB_DRIVER_LOG_LEVEL_DBG=y CONFIG_USB_CDC_ACM_LOG_LEVEL_DBG=y # Explicitly enable CDC ACM logging CONFIG_UART_LINE_CTRL=y
Here is my code:
#include <zephyr/kernel.h> #include <zephyr/usb/usb_device.h> #include <zephyr/usb/usbd.h> #include <zephyr/logging/log.h> LOG_MODULE_REGISTER(meat); #include <zephyr/drivers/uart.h> void main(void) { // const struct device *const dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console)); // uint32_t dtr = 0; if (usb_enable(NULL)) { return; } while (1) { printk("HELLO\n"); k_sleep(K_MSEC(100)); } return 0; }
My issue is I am trying to get logging to happen over USB using the cdc acm with the Particle XENON board.
https://docs.particle.io/reference/discontinued/hardware/xenon-datasheet/
I can get the com port to show up with this code. However when I connect to it via putty it does not print anything. Also I am not sure how to set the default baud rate when using the cdc acm. Perhaps I am not understanding how this works exactly. Is it that the usb cdc acm just connects the uart to a usb serial port profile? Meaning you are still using one of the uart ports available on this soc?
If anyone has any ideas on why this is happening I would really appreciate it !
Thanks!