Compare commits

..

2 Commits

Author SHA1 Message Date
Eduard Iten 842b204d36 refactor(build): Streamline multi-app CMake configuration
Remove the top-level  and configure each application to directly include the  directory as a module or root. This simplifies the build process by making each application more self-contained while still allowing access to shared boards and libraries.
2025-07-01 12:05:18 +02:00
Eduard Iten 5ce96a662d feat: Establish functional multi-app structure
This commit captures a working multi-app build where the board definition is located in the 'software' directory and explicitly included by the slave_node application. This serves as a stable baseline.
2025-07-01 11:05:12 +02:00
11 changed files with 154 additions and 13 deletions

View File

@ -1,8 +0,0 @@
# Top-level CMakeLists.txt for the irrigation system project
cmake_minimum_required(VERSION 3.20)
# Add the subdirectories for the applications and libraries
add_subdirectory(apps/gateway)
add_subdirectory(apps/slave_node)
add_subdirectory(lib)

View File

@ -1,5 +1,8 @@
cmake_minimum_required(VERSION 3.20)
# Include the main 'software' directory as a module to find boards, libs, etc.
list(APPEND ZEPHYR_EXTRA_MODULES ${CMAKE_CURRENT_SOURCE_DIR}/../..)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(gateway)

View File

@ -1,3 +1,2 @@
# Zephyr configuration for the Gateway
# Gateway Configuration
CONFIG_NETWORKING=y
CONFIG_NET_TCP=y

View File

@ -1,6 +1,10 @@
cmake_minimum_required(VERSION 3.20)
# Point BOARD_ROOT and DTS_ROOT to the 'software' directory, which contains 'boards'.
list(APPEND BOARD_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
list(APPEND DTS_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(slave_node)
target_sources(app PRIVATE src/main.c)
target_sources(app PRIVATE src/main.c)

View File

@ -1,2 +1,7 @@
# Zephyr configuration for the Slave Node
# --- Base Slave Node Config ---
CONFIG_GPIO=y
# Use RTT for console output instead of UART
CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y
CONFIG_UART_CONSOLE=n

View File

@ -8,6 +8,9 @@
int main(void)
{
printk("Hello from Slave Node!\n");
while (1) {
printk("Hello from Slave Node!\n");
k_msleep(1000);
}
return 0;
}

View File

@ -0,0 +1,5 @@
# Copyright (c) 2025 Eduard Iten
# SPDX-License-Identifier: Apache-2.0
config BOARD_BLUEPILL_F103RB
select SOC_STM32F103XB

View File

@ -0,0 +1,106 @@
/*
* Copyright (c) 2025 Eduard Iten
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <st/f1/stm32f1.dtsi>
#include <st/f1/stm32f103Xb.dtsi>
#include <st/f1/stm32f103r(8-b)tx-pinctrl.dtsi>
#include <zephyr/dt-bindings/input/input-event-codes.h>
/ {
model = "Blue-Pill STM32F103RB";
compatible = "iten,bluepill-f103rb";
chosen {
zephyr,console = &usart1;
zephyr,shell-uart = &usart1;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};
leds {
compatible = "gpio-leds";
led_status: led_status {
gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
label = "User LED";
};
};
aliases {
led0 = &led_status;
watchdog0 = &iwdg;
};
};
&clk_lsi {
status = "okay";
};
&clk_hse {
clock-frequency = <DT_FREQ_M(8)>;
status = "okay";
};
&pll {
mul = <9>;
clocks = <&clk_hse>;
status = "okay";
};
&rcc {
clocks = <&pll>;
clock-frequency = <DT_FREQ_M(72)>;
ahb-prescaler = <1>;
apb1-prescaler = <2>;
apb2-prescaler = <1>;
adc-prescaler = <6>;
};
&usart1 {
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
pinctrl-names = "default";
current-speed = <115200>;
status = "okay";
};
&iwdg {
status = "okay";
};
&clk_lsi {
status = "okay";
};
&clk_hse {
clock-frequency = <DT_FREQ_M(8)>;
status = "okay";
};
&pll {
mul = <9>;
clocks = <&clk_hse>;
status = "okay";
};
&rcc {
clocks = <&pll>;
clock-frequency = <DT_FREQ_M(72)>;
ahb-prescaler = <1>;
apb1-prescaler = <2>;
apb2-prescaler = <1>;
adc-prescaler = <6>;
};
&exti {
status = "okay";
};
&dma1 {
status = "okay";
};

View File

@ -0,0 +1,4 @@
# Copyright (c) 2025 Eduard Iten
# SPDX-License-Identifier: Apache-2.0
CONFIG_SERIAL=y
CONFIG_GPIO=y

View File

@ -0,0 +1,12 @@
# Copyright (c) 2025 Eduard Iten
# SPDX-License-Identifier: Apache-2.0
# keep first
board_runner_args(jlink "--device=STM32F103RB" "--speed=4000")
board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw")
# keep first
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake)
include(${ZEPHYR_BASE}/boards/common/openocd-stm32.board.cmake)
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake)

View File

@ -0,0 +1,8 @@
# Copyright (c) 2025 Eduard Iten
# SPDX-License-Identifier: Apache-2.0
board:
name: bluepill_f103rb
vendor: iten
socs:
- name: stm32f103xb