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.
This commit is contained in:
parent
fbeaa916b9
commit
5ce96a662d
|
|
@ -1,8 +1,6 @@
|
|||
# Top-level CMakeLists.txt for the irrigation system project
|
||||
# Top-level CMakeLists.txt for the multi-app setup
|
||||
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,2 @@
|
|||
# Zephyr configuration for the Gateway
|
||||
# Gateway Configuration
|
||||
CONFIG_NETWORKING=y
|
||||
CONFIG_NET_TCP=y
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
# Point BOARD_ROOT and DTS_ROOT to the main 'software' directory
|
||||
# so Zephyr can find the 'boards' subdirectory there.
|
||||
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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
# Copyright (c) 2025 Eduard Iten
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config BOARD_BLUEPILL_F103RB
|
||||
select SOC_STM32F103XB
|
||||
|
|
@ -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";
|
||||
};
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# Copyright (c) 2025 Eduard Iten
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
CONFIG_SERIAL=y
|
||||
CONFIG_GPIO=y
|
||||
|
|
@ -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)
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
# Copyright (c) 2025 Eduard Iten
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
board:
|
||||
name: bluepill_f103rb
|
||||
vendor: iten
|
||||
socs:
|
||||
- name: stm32f103xb
|
||||
Loading…
Reference in New Issue