From 5208f1370dbed62adbf307a04072e48591481eff Mon Sep 17 00:00:00 2001 From: Eduard Iten Date: Thu, 3 Jul 2025 10:53:21 +0200 Subject: [PATCH] feat(slave_node): Support multi-board build for bluepill_f103rb and weact_stm32g431_core Refactor slave_node application to support building for both bluepill_f103rb and weact_stm32g431_core boards. - Moved RTT-specific console and shell backend configurations from prj.conf into board-specific .conf files (bluepill_f103rb.conf). - Configured USART2 as console/shell for weact_stm32g431_core. - Added Device Tree Overlay for weact_stm32g431_core to enable USART1 for Modbus communication (PA9/PA10). --- software/apps/slave_node/boards/bluepill_f103rb.conf | 6 ++++++ .../apps/slave_node/boards/weact_stm32g431_core.overlay | 9 +++++++++ software/apps/slave_node/prj.conf | 7 ------- 3 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 software/apps/slave_node/boards/bluepill_f103rb.conf create mode 100644 software/apps/slave_node/boards/weact_stm32g431_core.overlay diff --git a/software/apps/slave_node/boards/bluepill_f103rb.conf b/software/apps/slave_node/boards/bluepill_f103rb.conf new file mode 100644 index 0000000..975165e --- /dev/null +++ b/software/apps/slave_node/boards/bluepill_f103rb.conf @@ -0,0 +1,6 @@ +# Disable UART console +CONFIG_UART_CONSOLE=n + +# Enable RTT console +CONFIG_RTT_CONSOLE=y +CONFIG_USE_SEGGER_RTT=y \ No newline at end of file diff --git a/software/apps/slave_node/boards/weact_stm32g431_core.overlay b/software/apps/slave_node/boards/weact_stm32g431_core.overlay new file mode 100644 index 0000000..897a9c1 --- /dev/null +++ b/software/apps/slave_node/boards/weact_stm32g431_core.overlay @@ -0,0 +1,9 @@ +&usart1 { + modbus0 { + compatible = "zephyr,modbus-serial"; + status = "okay"; + }; + status = "okay"; + pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>; + pinctrl-names = "default"; +}; diff --git a/software/apps/slave_node/prj.conf b/software/apps/slave_node/prj.conf index 6ad01cb..6a66456 100644 --- a/software/apps/slave_node/prj.conf +++ b/software/apps/slave_node/prj.conf @@ -2,13 +2,6 @@ CONFIG_CONSOLE=y CONFIG_LOG=y -# Disable UART console -CONFIG_UART_CONSOLE=n - -# Enable RTT console -CONFIG_RTT_CONSOLE=y -CONFIG_USE_SEGGER_RTT=y - # Enable Shell CONFIG_SHELL=y CONFIG_SHELL_BACKEND_RTT=y