Skip to content

Commit

Permalink
Fix of unknown Ringbuffer and not found USB-Serial Device (#125)
Browse files Browse the repository at this point in the history
* Added Ringbuffer-config in prj.conf for eliminating error

* Added Label CDC_ACM_0 label with an overlay so "modules/libmicroros/microros_transports/serial-usb/microros_transports.c" can find the device

* Update app.overlay

* Update app.overlay

A fix for backwards compability

* Update app.overlay

* Update app.overlay

* Update prj.conf

* Better comments

* Changed settings to conditional from transport choice

* Update prj.conf

Co-authored-by: Pablo Garrido <[email protected]>

* Update modules/libmicroros/Kconfig

Co-authored-by: Pablo Garrido <[email protected]>

---------

Co-authored-by: scrapforge <[email protected]>
Co-authored-by: Pablo Garrido <[email protected]>
  • Loading branch information
3 people authored Oct 26, 2023
1 parent e1e2340 commit 7c5edcd
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 10 deletions.
16 changes: 16 additions & 0 deletions app.overlay
Original file line number Diff line number Diff line change
@@ -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";
};
};
20 changes: 16 additions & 4 deletions modules/libmicroros/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -98,4 +110,4 @@ if MICROROS
default "4"

endif

6 changes: 0 additions & 6 deletions prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7c5edcd

Please sign in to comment.