Skip to content

Commit 005ecc5

Browse files
mergify[bot]scrapforgepablogs9
authored
Fix of unknown Ringbuffer and not found USB-Serial Device (backport #125) (#129)
* Fix of unknown Ringbuffer and not found USB-Serial Device (#125) * 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 <pablogs9@gmail.com> * Update modules/libmicroros/Kconfig Co-authored-by: Pablo Garrido <pablogs9@gmail.com> --------- Co-authored-by: scrapforge <rumpelcode@gmx.de> Co-authored-by: Pablo Garrido <pablogs9@gmail.com> (cherry picked from commit 7c5edcd) # Conflicts: # prj.conf * Update prj.conf --------- Co-authored-by: scrapforge <99104728+scrapforge@users.noreply.github.com> Co-authored-by: Pablo Garrido <pablogs9@gmail.com>
1 parent df3ad7c commit 005ecc5

3 files changed

Lines changed: 33 additions & 5 deletions

File tree

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ CONFIG_APP_LINK_WITH_POSIX_SUBSYS=y
1313
CONFIG_POSIX_CLOCK=y
1414

1515
CONFIG_STDOUT_CONSOLE=y
16+
CONFIG_LOG=y
1617
CONFIG_SERIAL=y
1718
CONFIG_UART_INTERRUPT_DRIVEN=y
1819
CONFIG_UART_LINE_CTRL=y
19-
CONFIG_RING_BUFFER=y

0 commit comments

Comments
 (0)