diff --git a/app.overlay b/app.overlay new file mode 100644 index 0000000..15cc0b0 --- /dev/null +++ b/app.overlay @@ -0,0 +1,16 @@ +/*Added these lines for compability with Zephyr v2.7*/ +zephyr_udc0: &usbotg_fs { + pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12 + &usb_otg_fs_id_pa10>; + pinctrl-names = "default"; + status = "okay"; +}; +/* End of compability part */ + + +&zephyr_udc0 { + cdc_acm_uart0: cdc_acm_uart0 { + compatible = "zephyr,cdc-acm-uart"; + label = "CDC_ACM_0"; + }; +}; diff --git a/modules/libmicroros/Kconfig b/modules/libmicroros/Kconfig index b6e9cb3..d918025 100644 --- a/modules/libmicroros/Kconfig +++ b/modules/libmicroros/Kconfig @@ -18,10 +18,11 @@ if MICROROS config MICROROS_TRANSPORT_SERIAL bool "micro-ROS serial transport" - + select RING_BUFFER config MICROROS_TRANSPORT_SERIAL_USB bool "micro-ROS USB serial transport" - + select RING_BUFFER + select USB_DEVICE_STACK config MICROROS_TRANSPORT_UDP bool "micro-ROS UDP network transport" @@ -64,7 +65,18 @@ if MICROROS micro-ROS Agent IP. endif - + if MICROROS_TRANSPORT_SERIAL_USB + config USB_CDC_ACM + bool + default y + config USB_CDC_ACM_RINGBUF_SIZE + int "USB-CDC-ACM Ringbuffer size" + default "2048" + config USB_DEVICE_PRODUCT + string "USB Device Product" + default "Zephyr micro-ROS" + + endif config MICROROS_NODES string "available micro-ROS nodes" default "1" @@ -98,4 +110,4 @@ if MICROROS default "4" endif - \ No newline at end of file + diff --git a/prj.conf b/prj.conf index ccb67ed..aa11d31 100644 --- a/prj.conf +++ b/prj.conf @@ -13,13 +13,7 @@ CONFIG_APP_LINK_WITH_POSIX_SUBSYS=y CONFIG_POSIX_CLOCK=y CONFIG_STDOUT_CONSOLE=y -CONFIG_USB_DEVICE_STACK=y -CONFIG_USB_DEVICE_PRODUCT="Zephyr micro-ROS" CONFIG_LOG=y -CONFIG_USB_CDC_ACM=y CONFIG_SERIAL=y CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_UART_LINE_CTRL=y -CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y -CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y -CONFIG_USB_CDC_ACM_RINGBUF_SIZE=2048