# saltek1/nexus-embedded-systems-portfolio architecture

> Architecture diagram of the GitHub repository saltek1/nexus-embedded-systems-portfolio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/saltek1/nexus-embedded-systems-portfolio
- Repository: https://github.com/saltek1/nexus-embedded-systems-portfolio

## Overview

Nexus is an STM32F4 embedded-systems portfolio progressing from bare-metal sensing to event-driven, low-power, multitask, and safety-oriented RTOS firmware. The principal workflow is sensor acquisition, application/state processing, and UART telemetry; later stages add event flags, power control, RTOS queues, filtering, persistence, supervision, and recovery. The graph combines documented milestone capabilities with sampled call paths. Several Guardian task relationships are intentionally left unconnected because their implementations were not sampled.

Main entry points: [`Nexus-RTOS-Guardian-Core/App/BSP/bsp_uart.c`](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/BSP/bsp_uart.c) (UART BSP), [`Nexus-RTOS-Guardian-Core/Core/Src/main.c`](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/Core/Src/main.c) (Guardian Main), [`Nexus-RTOS-Guardian-Core/App/BSP/bsp_adc.c`](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/BSP/bsp_adc.c) (ADC BSP), [`Nexus-Core-Low-Power-DAQ/App/Logic/app_logic.c`](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-Core-Low-Power-DAQ/App/Logic/app_logic.c) (Low Power Logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_baremetal["Bare-Metal Foundation"]
  node_core_main["Core Main<br/>[main.c]"]
  node_core_fsm["Core FSM<br/>[fsm.c]"]
  node_core_log["Core Logging<br/>[log_service.c]"]
end

subgraph group_daq["DAQ Variants"]
  node_lp_main["Low Power Main<br/>[main.c]"]
  node_lp_logic["Low Power Logic<br/>[app_logic.c]"]
  node_lp_power["Sleep Manager<br/>[power_manager.c]"]
  node_event_main["Event Main<br/>[main.c]"]
  node_event_logic["Event Logic<br/>[app_logic.c]"]
  node_event_manager["Event Manager<br/>[event_manager.c]"]
end

subgraph group_rtos["RTOS Runtime"]
  node_multi_main["Multitask Main<br/>[main.c]"]
  node_rtos_manager["RTOS IPC<br/>[rtos_manager.c]"]
  node_sensor_queue["Sensor Queue"]
end

subgraph group_guardian["Guardian Safety"]
  node_guardian_main["Guardian Main<br/>[main.c]"]
  node_guardian_fsm["Control FSM<br/>[fsm.c]"]
  node_supervisor["Safety Supervisor<br/>[supervisor.c]"]
  node_acquire_task["Acquire Task<br/>[acquire_task.c]"]
  node_processing_tasks["Processing Tasks<br/>[processing_tasks.c]"]
  node_filters["Signal Filters<br/>[filters.c]"]
  node_telemetry["Telemetry Service<br/>[telemetry.c]"]
  node_flash_service[("Flash Persistence<br/>[flash_service.c]")]
  node_system_config["System Configuration<br/>[system_config.c]"]
  node_watchdog["Hardware Watchdog<br/>[iwdg.c]"]
end

subgraph group_hardware["Hardware Abstraction"]
  node_adc_bsp["ADC BSP<br/>[bsp_adc.c]"]
  node_uart_bsp["UART BSP<br/>[bsp_uart.c]"]
  node_stm_hal["STM32 HAL<br/>[stm32f4xx_hal.c]"]
end

node_operator(("Host Operator"))
node_sensor(("Analog Sensor"))
node_nvm[("Nonvolatile Memory")]
node_uart_host["UART Console"]

node_sensor -->|"provides samples"| node_adc_bsp
node_core_main -->|"updates FSM"| node_core_fsm
node_core_main -->|"writes startup log"| node_core_log
node_lp_main -->|"updates logic"| node_lp_logic
node_lp_logic -->|"reads sensor"| node_adc_bsp
node_lp_logic -->|"sends telemetry"| node_uart_bsp
node_lp_main -->|"enters sleep"| node_lp_power
node_event_main -->|"updates logic"| node_event_logic
node_event_main -->|"initializes events"| node_event_manager
node_event_manager -->|"signals readiness"| node_event_logic
node_multi_main -->|"starts RTOS"| node_rtos_manager
node_rtos_manager -->|"queues samples"| node_sensor_queue
node_rtos_manager -->|"logs messages"| node_uart_host
node_guardian_main -->|"loads state"| node_flash_service
node_guardian_main -->|"saves state"| node_flash_service
node_guardian_main -->|"prints boot status"| node_uart_bsp
node_guardian_main -->|"starts supervision"| node_supervisor
node_supervisor -->|"manages recovery"| node_watchdog
node_acquire_task -->|"acquires samples"| node_adc_bsp
node_processing_tasks -->|"processes samples"| node_filters
node_telemetry -->|"exports telemetry"| node_uart_bsp
node_flash_service -->|"persists logs"| node_nvm
node_adc_bsp -->|"uses HAL"| node_stm_hal
node_uart_bsp -->|"uses HAL"| node_stm_hal
node_uart_bsp -->|"reports status"| node_operator

click node_core_main "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-Core/Core/Src/main.c"
click node_core_fsm "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-Core/App/Logic/fsm.c"
click node_core_log "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-Core/App/Services/log_service.c"
click node_lp_main "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-Core-Low-Power-DAQ/Core/Src/main.c"
click node_lp_logic "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-Core-Low-Power-DAQ/App/Logic/app_logic.c"
click node_lp_power "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-Core-Low-Power-DAQ/App/Services/power_manager.c"
click node_event_main "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-Event-Interrupt-DAQ/Core/Src/main.c"
click node_event_logic "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-Event-Interrupt-DAQ/App/Logic/app_logic.c"
click node_event_manager "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-Event-Interrupt-DAQ/App/Services/event_manager.c"
click node_multi_main "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Multitask-DAQ/Core/Src/main.c"
click node_rtos_manager "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Multitask-DAQ/App/Services/rtos_manager.c"
click node_guardian_main "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/Core/Src/main.c"
click node_guardian_fsm "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/Logic/fsm.c"
click node_supervisor "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/Supervisor/supervisor.c"
click node_acquire_task "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/Services/acquire_task.c"
click node_processing_tasks "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/Services/processing_tasks.c"
click node_filters "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/Services/filters.c"
click node_telemetry "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/Telemetry/telemetry.c"
click node_flash_service "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/Services/flash_service.c"
click node_system_config "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/Common/system_config.c"
click node_adc_bsp "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/BSP/bsp_adc.c"
click node_uart_bsp "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/BSP/bsp_uart.c"
click node_stm_hal "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c"
click node_watchdog "https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/Core/Src/iwdg.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_core_main,node_core_fsm,node_core_log toneBlue
class node_lp_main,node_lp_logic,node_lp_power,node_event_main,node_event_logic,node_event_manager,node_nvm toneAmber
class node_multi_main,node_rtos_manager,node_sensor_queue toneMint
class node_guardian_main,node_guardian_fsm,node_supervisor,node_acquire_task,node_processing_tasks,node_filters,node_telemetry,node_flash_service,node_system_config,node_watchdog toneRose
class node_adc_bsp,node_uart_bsp,node_stm_hal,node_operator,node_sensor,node_uart_host toneIndigo
```

## Components

### Bare-Metal Foundation

- [Core Main](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-Core/Core/Src/main.c): `Nexus-Core/Core/Src/main.c`
- [Core FSM](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-Core/App/Logic/fsm.c): `Nexus-Core/App/Logic/fsm.c`
- [Core Logging](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-Core/App/Services/log_service.c): `Nexus-Core/App/Services/log_service.c`

### DAQ Variants

- [Low Power Main](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-Core-Low-Power-DAQ/Core/Src/main.c): `Nexus-Core-Low-Power-DAQ/Core/Src/main.c`
- [Low Power Logic](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-Core-Low-Power-DAQ/App/Logic/app_logic.c): `Nexus-Core-Low-Power-DAQ/App/Logic/app_logic.c`
- [Sleep Manager](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-Core-Low-Power-DAQ/App/Services/power_manager.c): `Nexus-Core-Low-Power-DAQ/App/Services/power_manager.c`
- [Event Main](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-Event-Interrupt-DAQ/Core/Src/main.c): `Nexus-Event-Interrupt-DAQ/Core/Src/main.c`
- [Event Logic](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-Event-Interrupt-DAQ/App/Logic/app_logic.c): `Nexus-Event-Interrupt-DAQ/App/Logic/app_logic.c`
- [Event Manager](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-Event-Interrupt-DAQ/App/Services/event_manager.c): `Nexus-Event-Interrupt-DAQ/App/Services/event_manager.c`

### RTOS Runtime

- [Multitask Main](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Multitask-DAQ/Core/Src/main.c): `Nexus-RTOS-Multitask-DAQ/Core/Src/main.c`
- [RTOS IPC](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Multitask-DAQ/App/Services/rtos_manager.c): `Nexus-RTOS-Multitask-DAQ/App/Services/rtos_manager.c`
- **Sensor Queue**

### Guardian Safety

- [Guardian Main](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/Core/Src/main.c): `Nexus-RTOS-Guardian-Core/Core/Src/main.c`
- [Control FSM](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/Logic/fsm.c): `Nexus-RTOS-Guardian-Core/App/Logic/fsm.c`
- [Safety Supervisor](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/Supervisor/supervisor.c): `Nexus-RTOS-Guardian-Core/App/Supervisor/supervisor.c`
- [Acquire Task](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/Services/acquire_task.c): `Nexus-RTOS-Guardian-Core/App/Services/acquire_task.c`
- [Processing Tasks](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/Services/processing_tasks.c): `Nexus-RTOS-Guardian-Core/App/Services/processing_tasks.c`
- [Signal Filters](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/Services/filters.c): `Nexus-RTOS-Guardian-Core/App/Services/filters.c`
- [Telemetry Service](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/Telemetry/telemetry.c): `Nexus-RTOS-Guardian-Core/App/Telemetry/telemetry.c`
- [Flash Persistence](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/Services/flash_service.c): `Nexus-RTOS-Guardian-Core/App/Services/flash_service.c`
- [System Configuration](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/Common/system_config.c): `Nexus-RTOS-Guardian-Core/App/Common/system_config.c`
- [Hardware Watchdog](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/Core/Src/iwdg.c): `Nexus-RTOS-Guardian-Core/Core/Src/iwdg.c`

### Hardware Abstraction

- [ADC BSP](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/BSP/bsp_adc.c): `Nexus-RTOS-Guardian-Core/App/BSP/bsp_adc.c`
- [UART BSP](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/App/BSP/bsp_uart.c): `Nexus-RTOS-Guardian-Core/App/BSP/bsp_uart.c`
- [STM32 HAL](https://github.com/saltek1/nexus-embedded-systems-portfolio/blob/main/Nexus-RTOS-Guardian-Core/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c): `Nexus-RTOS-Guardian-Core/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c`

### Other components

- **Host Operator**
- **Analog Sensor**
- **Nonvolatile Memory**
- **UART Console**

## Connections

- Analog Sensor → ADC BSP: provides samples
- Core Main → Core FSM: updates FSM
- Core Main → Core Logging: writes startup log
- Low Power Main → Low Power Logic: updates logic
- Low Power Logic → ADC BSP: reads sensor
- Low Power Logic → UART BSP: sends telemetry
- Low Power Main → Sleep Manager: enters sleep
- Event Main → Event Logic: updates logic
- Event Main → Event Manager: initializes events
- Event Manager → Event Logic: signals readiness
- Multitask Main → RTOS IPC: starts RTOS
- RTOS IPC → Sensor Queue: queues samples
- RTOS IPC → UART Console: logs messages
- Guardian Main → Flash Persistence: loads state
- Guardian Main → Flash Persistence: saves state
- Guardian Main → UART BSP: prints boot status
- Guardian Main → Safety Supervisor: starts supervision
- Safety Supervisor → Hardware Watchdog: manages recovery
- Acquire Task → ADC BSP: acquires samples
- Processing Tasks → Signal Filters: processes samples
- Telemetry Service → UART BSP: exports telemetry
- Flash Persistence → Nonvolatile Memory: persists logs
- ADC BSP → STM32 HAL: uses HAL
- UART BSP → STM32 HAL: uses HAL
- UART BSP → Host Operator: reports status
