How agh-space-systems-rover/kalman-electronics-master-v3 works
Master-v3 is rover-control firmware: after STM32 peripheral setup, it initializes application logic and starts FreeRTOS tasks that process UART and CAN communications alongside GPIO-expander and status work. UART packets are parsed, queued, validated, then dispatched to command handlers; CAN has corresponding manager and handler tasks. The command families cover rover subsystems such as motors, the arm, science, drill, and power distribution. Source excerpts establish task creation and UART dispatch, but do not show most parser, CAN, or hardware command implementations, so those links are documented or left unverified.
Main entry points: tasks.c Runtime tasks · uart_parser.c UART parser · uart_packet_handler.c UART dispatch · can_manager.c CAN manager
Components 25
Firmware startup
- Boot and peripherals
Core/Src/main.c - Application init
Src/Master_Main/Master_Main.c - Peripheral configuration
Src/config.c - UART peripherals
Core/Src/usart.c
RTOS runtime
- Task creation
master_lib/shared/tasks.c - Runtime tasks
master_lib/shared/tasks.c - Shared state and queues
master_lib/shared/common.h - Traffic and timeout timers
master_lib/timers/timer.c - GPIO expander
master_lib/shared/gpio_expander.c - Status reporting
master_lib/shared/status_info.c
UART communications
- UART parser
master_lib/uart/handler/uart_parser.c - UART packet queue
master_lib/uart/handler/uart_packet_handler.c - UART dispatch
master_lib/uart/handler/uart_packet_handler.c - UART encoder
master_lib/uart/handler/uart_encoder.h
CAN communications
- CAN manager
master_lib/can/handler/can_manager.c - CAN packet queue
master_lib/can/handler/can_packet_handler.c - CAN dispatch
master_lib/can/handler/can_packet_handler.c - CAN packet format
master_lib/can/can_packet.h
Rover command domains
- UART command handlers
master_lib/uart/commands/uart_cmd.c - UART command registry
master_lib/uart/uart_packet_defs.h - CAN command handlers
master_lib/can/commands/can_cmd.c - Rover hardware actions
master_lib/hw/hw.c
Other components
- Rover MCU
- Rover clients and modules
- CAN bus devices
Connections 30
- Rover MCU → Boot and peripherals: boots
Core/Src/main.c - Boot and peripherals → Peripheral configuration: initializes peripherals
Core/Src/main.c - Boot and peripherals → Application init: calls Init
Core/Src/main.c - Application init → Task creation: creates tasks
- Task creation → Runtime tasks: registers
master_lib/shared/tasks.c - Runtime tasks → UART parser: starts parser
master_lib/shared/tasks.c - Runtime tasks → UART dispatch: starts handler
master_lib/shared/tasks.c - Runtime tasks → UART encoder: starts encoder
master_lib/shared/tasks.c - Runtime tasks → CAN manager: starts manager
master_lib/shared/tasks.c - Runtime tasks → CAN dispatch: starts handler
master_lib/shared/tasks.c - Runtime tasks → GPIO expander: starts task
master_lib/shared/tasks.c - Runtime tasks → Status reporting: starts task
master_lib/shared/tasks.c - UART peripherals → UART parser: provides input
- UART parser → UART packet queue: enqueues packets
- UART packet queue → UART dispatch: dequeues packets
master_lib/uart/handler/uart_packet_handler.c - UART dispatch → UART command registry: looks up command
master_lib/uart/handler/uart_packet_handler.c - UART dispatch → UART command handlers: executes handler
- UART command handlers → Rover hardware actions: controls hardware
- UART encoder → Rover clients and modules: sends responses
- Rover clients and modules → UART parser: sends commands
- CAN manager → CAN packet queue: queues packets
- CAN packet queue → CAN dispatch: dispatches packets
master_lib/can/handler/can_packet_handler.c - CAN dispatch → CAN packet format: processes frames
master_lib/can/handler/can_packet_handler.c - CAN dispatch → CAN command handlers: executes commands
- CAN command handlers → Rover hardware actions: controls hardware
- CAN manager → CAN bus devices: receives and sends
- Traffic and timeout timers → UART command handlers: triggers actions
- Traffic and timeout timers → CAN command handlers: triggers actions
- Shared state and queues → UART parser: shares runtime state
- Shared state and queues → CAN manager: shares runtime state