From edf0fb2563db94a86e15f11e32f791f023a7601a Mon Sep 17 00:00:00 2001 From: Eduard Iten Date: Tue, 8 Jul 2025 15:06:31 +0200 Subject: [PATCH] feat(slave_node): Add HSI clock configuration and cleanup Adds a commented-out clock configuration to the file. This allows switching the clock source from the external high-speed oscillator (HSE) to the internal high-speed oscillator (HSI), which can be useful if an external crystal is not present. Also, removes the debug log level for the settings subsystem from the project configuration. --- .../boards/weact_stm32g431_core.overlay | 21 +++++++++++++++++++ software/apps/slave_node/prj.conf | 1 - 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/software/apps/slave_node/boards/weact_stm32g431_core.overlay b/software/apps/slave_node/boards/weact_stm32g431_core.overlay index d86e8af..2481bba 100644 --- a/software/apps/slave_node/boards/weact_stm32g431_core.overlay +++ b/software/apps/slave_node/boards/weact_stm32g431_core.overlay @@ -13,6 +13,27 @@ }; }; +// Clock configuration: Uncomment the following section to use calibrated HSI instead of HSE +//&clk_hse { +// status = "disabled"; // Disable external crystal oscillator +//}; +// +//&clk_hsi { +// status = "okay"; // Enable internal high-speed oscillator (16 MHz, calibrated) +//}; +// +//&pll { +// // Change PLL source from HSE to HSI +// clocks = <&clk_hsi>; +// // Adjust multipliers to maintain 144 MHz system clock with 16 MHz HSI input +// // HSI = 16 MHz, div-m = 4, mul-n = 72, div-r = 2 +// // PLL_VCO = (16 MHz / 4) * 72 = 288 MHz +// // SYSCLK = 288 MHz / 2 = 144 MHz +// div-m = <4>; // Divide HSI by 4 (16 MHz / 4 = 4 MHz) +// mul-n = <72>; // Multiply by 72 (4 MHz * 72 = 288 MHz) +// div-r = <2>; // Divide by 2 for system clock (288 MHz / 2 = 144 MHz) +//}; + &usart1 { modbus0 { compatible = "zephyr,modbus-serial"; diff --git a/software/apps/slave_node/prj.conf b/software/apps/slave_node/prj.conf index 6002c6c..24aacee 100644 --- a/software/apps/slave_node/prj.conf +++ b/software/apps/slave_node/prj.conf @@ -13,7 +13,6 @@ CONFIG_NVS=y CONFIG_FLASH=y CONFIG_FLASH_MAP=y CONFIG_FLASH_PAGE_LAYOUT=y -CONFIG_SETTINGS_LOG_LEVEL_DBG=y # Config modbus CONFIG_UART_INTERRUPT_DRIVEN=y