From 3f0d5a76c65cfbec12781dd59f3deaf34dedf1a1 Mon Sep 17 00:00:00 2001 From: Eduard Iten Date: Thu, 3 Jul 2025 14:31:17 +0200 Subject: [PATCH] feat(cdc_acm): Add CDC-ACM support and remove old test applications - Implemented CDC-ACM (USB Virtual COM Port) support for the slave_node application. - Removed the now obsolete 'hello_world' and 'stm32g431_tests' applications. --- software/apps/hello_world/CMakeLists.txt | 6 ------ software/apps/hello_world/prj.conf | 4 ---- software/apps/hello_world/src/main.c | 9 --------- software/apps/slave_node/cdc-acm.overlay | 10 ++++++++++ software/apps/slave_node/overlay-cdc-acm.conf | 4 ++++ software/apps/stm32g431_tests/CMakeLists.txt | 6 ------ software/apps/stm32g431_tests/prj.conf | 4 ---- software/apps/stm32g431_tests/src/main.c | 9 --------- 8 files changed, 14 insertions(+), 38 deletions(-) delete mode 100644 software/apps/hello_world/CMakeLists.txt delete mode 100644 software/apps/hello_world/prj.conf delete mode 100644 software/apps/hello_world/src/main.c create mode 100644 software/apps/slave_node/cdc-acm.overlay create mode 100644 software/apps/slave_node/overlay-cdc-acm.conf delete mode 100644 software/apps/stm32g431_tests/CMakeLists.txt delete mode 100644 software/apps/stm32g431_tests/prj.conf delete mode 100644 software/apps/stm32g431_tests/src/main.c diff --git a/software/apps/hello_world/CMakeLists.txt b/software/apps/hello_world/CMakeLists.txt deleted file mode 100644 index 8728b9c..0000000 --- a/software/apps/hello_world/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -cmake_minimum_required(VERSION 3.20) - -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(hello_world) - -target_sources(app PRIVATE src/main.c) diff --git a/software/apps/hello_world/prj.conf b/software/apps/hello_world/prj.conf deleted file mode 100644 index bfb4912..0000000 --- a/software/apps/hello_world/prj.conf +++ /dev/null @@ -1,4 +0,0 @@ - -CONFIG_CONSOLE=y -CONFIG_LOG=y -CONFIG_UART_CONSOLE=y \ No newline at end of file diff --git a/software/apps/hello_world/src/main.c b/software/apps/hello_world/src/main.c deleted file mode 100644 index dbec9a8..0000000 --- a/software/apps/hello_world/src/main.c +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include - -int main(void) -{ - printk("Hello World! %s\n", CONFIG_BOARD); - return 0; -} - diff --git a/software/apps/slave_node/cdc-acm.overlay b/software/apps/slave_node/cdc-acm.overlay new file mode 100644 index 0000000..4f20541 --- /dev/null +++ b/software/apps/slave_node/cdc-acm.overlay @@ -0,0 +1,10 @@ +&zephyr_udc0 { + cdc_acm_uart0: cdc_acm_uart0 { + compatible = "zephyr,cdc-acm-uart"; + + modbus0 { + compatible = "zephyr,modbus-serial"; + status = "okay"; + }; + }; +}; \ No newline at end of file diff --git a/software/apps/slave_node/overlay-cdc-acm.conf b/software/apps/slave_node/overlay-cdc-acm.conf new file mode 100644 index 0000000..2b6aa2e --- /dev/null +++ b/software/apps/slave_node/overlay-cdc-acm.conf @@ -0,0 +1,4 @@ +CONFIG_USB_DEVICE_STACK=y +CONFIG_USB_DEVICE_PRODUCT="Modbus slave node" +CONFIG_UART_LINE_CTRL=y +CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n \ No newline at end of file diff --git a/software/apps/stm32g431_tests/CMakeLists.txt b/software/apps/stm32g431_tests/CMakeLists.txt deleted file mode 100644 index 76964d1..0000000 --- a/software/apps/stm32g431_tests/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -cmake_minimum_required(VERSION 3.20) - -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(stm32g431_tests) - -target_sources(app PRIVATE src/main.c) diff --git a/software/apps/stm32g431_tests/prj.conf b/software/apps/stm32g431_tests/prj.conf deleted file mode 100644 index bfb4912..0000000 --- a/software/apps/stm32g431_tests/prj.conf +++ /dev/null @@ -1,4 +0,0 @@ - -CONFIG_CONSOLE=y -CONFIG_LOG=y -CONFIG_UART_CONSOLE=y \ No newline at end of file diff --git a/software/apps/stm32g431_tests/src/main.c b/software/apps/stm32g431_tests/src/main.c deleted file mode 100644 index dbec9a8..0000000 --- a/software/apps/stm32g431_tests/src/main.c +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include - -int main(void) -{ - printk("Hello World! %s\n", CONFIG_BOARD); - return 0; -} -