Skip to content

Commit b7d54a2

Browse files
Fix of unknown Ringbuffer and not found USB-Serial Device (#125) (#130)
* 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]> (cherry picked from commit 7c5edcd) Co-authored-by: scrapforge <[email protected]>
1 parent 3723088 commit b7d54a2

File tree

3 files changed

+32
-10
lines changed

3 files changed

+32
-10
lines changed

app.overlay

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*Added these lines for compability with Zephyr v2.7*/
2+
zephyr_udc0: &usbotg_fs {
3+
pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12
4+
&usb_otg_fs_id_pa10>;
5+
pinctrl-names = "default";
6+
status = "okay";
7+
};
8+
/* End of compability part */
9+
10+
11+
&zephyr_udc0 {
12+
cdc_acm_uart0: cdc_acm_uart0 {
13+
compatible = "zephyr,cdc-acm-uart";
14+
label = "CDC_ACM_0";
15+
};
16+
};

modules/libmicroros/Kconfig

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ if MICROROS
1818

1919
config MICROROS_TRANSPORT_SERIAL
2020
bool "micro-ROS serial transport"
21-
21+
select RING_BUFFER
2222
config MICROROS_TRANSPORT_SERIAL_USB
2323
bool "micro-ROS USB serial transport"
24-
24+
select RING_BUFFER
25+
select USB_DEVICE_STACK
2526
config MICROROS_TRANSPORT_UDP
2627
bool "micro-ROS UDP network transport"
2728

@@ -64,7 +65,18 @@ if MICROROS
6465
micro-ROS Agent IP.
6566
endif
6667

67-
68+
if MICROROS_TRANSPORT_SERIAL_USB
69+
config USB_CDC_ACM
70+
bool
71+
default y
72+
config USB_CDC_ACM_RINGBUF_SIZE
73+
int "USB-CDC-ACM Ringbuffer size"
74+
default "2048"
75+
config USB_DEVICE_PRODUCT
76+
string "USB Device Product"
77+
default "Zephyr micro-ROS"
78+
79+
endif
6880
config MICROROS_NODES
6981
string "available micro-ROS nodes"
7082
default "1"
@@ -98,4 +110,4 @@ if MICROROS
98110
default "4"
99111

100112
endif
101-
113+

prj.conf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,7 @@ CONFIG_APP_LINK_WITH_POSIX_SUBSYS=y
1313
CONFIG_POSIX_CLOCK=y
1414

1515
CONFIG_STDOUT_CONSOLE=y
16-
CONFIG_USB_DEVICE_STACK=y
17-
CONFIG_USB_DEVICE_PRODUCT="Zephyr micro-ROS"
1816
CONFIG_LOG=y
19-
CONFIG_USB_CDC_ACM=y
2017
CONFIG_SERIAL=y
2118
CONFIG_UART_INTERRUPT_DRIVEN=y
2219
CONFIG_UART_LINE_CTRL=y
23-
CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
24-
CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
25-
CONFIG_USB_CDC_ACM_RINGBUF_SIZE=2048

0 commit comments

Comments
 (0)