# amosproj/amos2024ss07-updating-flash-boot-loader architecture

> Architecture diagram of the GitHub repository amosproj/amos2024ss07-updating-flash-boot-loader, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amosproj/amos2024ss07-updating-flash-boot-loader
- Repository: https://github.com/amosproj/amos2024ss07-updating-flash-boot-loader

## Overview

##### Project type and purpose
- This is an embedded-plus-host application. On the embedded side you have a Flash Boot Loader (FBL) running on an Infineon AURIX™ TC375 microcontroller. On the host side you have a Windows GUI tool (built with Qt, CMake, Vector’s VXLAPI) that uses ISO-15765-2/CAN and UDS (ISO-14229) to update the firmware.

##### File structure
- Top-level:
- Deliverables, Documentation – static docs, design artifacts
- MCU_Aurix – embedded project (Eclipse/.cproject, .ads scripts)
– bootloader (src/inc)
– driver (CAN, flash, LED, reset)
– main (Cpu0_Main.c, Cpu1_Main.c, Cpu2_Main.c)
– Libraries: Infineon iLLD, SFR, Service, pinmapper, linker scripts
- WINDOWS_GUI – production GUI (C++/Qt)
– Communication (CAN wrapper, virtual driver)
– Communication_Layer (abstracted CommInterface)
– UDS_Layer, UDS_Spec
– UI (mainwindow.ui, controllers, flashmanager, validatemanager)
- TESTING_WINDOWS_GUI – unit/integration tests for the GUI and communication

##### README for additional insights
- Confirms embedded FBL goal and Windows PC GUI
- Mentions protocols: CAN, ISO-15765-2, UDS
- Lists key features: MCU reset, log window, firmware transfer

##### Elements
- Clear labels: e.g., “CAN Wrapper (VXLAPI)”, “UDS Layer”, “Bootloader Session Manager”
- From GUI button → FlashManager → UDS → CAN
- From MCU Bootloader → UDS → CAN → GUI log
- Network line style for CAN bus

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Host PC Layer
    subgraph "Host PC"
        direction TB
        UI["UI Layer (Qt Widgets)"]:::host
        FM["FlashManager"]:::host
        VM["ValidateManager"]:::host
        UDShost["UDS Layer (ISO-14229)"]:::host
        CANwrap["CAN Wrapper (VXLAPI / VirtualDriver)"]:::host
        PhysCAN["Physical CAN Driver"]:::host
        UI -->|user actions| FM
        UI -->|user actions| VM
        FM -->|calls UDS| UDShost
        VM -->|validates via UDS| UDShost
        UDShost -->|UDS frames| CANwrap
        CANwrap -->|CAN frames| PhysCAN
    end

    %% Test Harness Layer
    subgraph "Test Harness"
        direction TB
        TestGUI["Testing Application"]:::test
        TestGUI -->|uses UDS| UDShost
        TestGUI -->|uses CAN| CANwrap
    end

    %% CAN Bus Network
    CANBus(["CAN Bus"]):::network
    PhysCAN -.->|sends/receives| CANBus
    CANBus -.->|sends/receives| CANd

    %% Embedded MCU Layer
    subgraph "Embedded MCU"
        direction TB
        CPU["TriCore CPU"]:::embedded
        subgraph "Drivers"
            direction TB
            CANd["CAN Driver"]:::embedded
            Flashd["Flash Driver"]:::embedded
            LEDd["LED Driver"]:::embedded
            Resetd["Reset Driver"]:::embedded
        end
        subgraph "Middleware"
            direction TB
            ISOtp["ISO-TP Stack"]:::embedded
            UDSemu["UDS Handler"]:::embedded
            SessM["Session Manager"]:::embedded
        end
        subgraph "Bootloader Core"
            direction TB
            MemM["Memory Manager"]:::embedded
            CRC["CRC Module"]:::embedded
            FlashCore["Flashing Logic"]:::embedded
        end
        Storage([Flash Memory]):::storage
        CPU --> Drivers
        Drivers --> Middleware
        Middleware --> BootloaderCore
        BootloaderCore --> Storage
        Middleware -->|UDS frames| CANd
    end

    %% Click Events
    click UI "https://github.com/amosproj/amos2024ss07-updating-flash-boot-loader/blob/main/WINDOWS_GUI/mainwindow.ui"
    click FM "https://github.com/amosproj/amos2024ss07-updating-flash-boot-loader/blob/main/WINDOWS_GUI/flashmanager.cpp"
    click VM "https://github.com/amosproj/amos2024ss07-updating-flash-boot-loader/blob/main/WINDOWS_GUI/validatemanager.cpp"
    click UDShost "https://github.com/amosproj/amos2024ss07-updating-flash-boot-loader/blob/main/WINDOWS_GUI/UDS_Layer/UDS.cpp"
    click CANwrap "https://github.com/amosproj/amos2024ss07-updating-flash-boot-loader/blob/main/WINDOWS_GUI/Communication/Can_Wrapper.cpp"
    click TestGUI "https://github.com/amosproj/amos2024ss07-updating-flash-boot-loader/blob/main/TESTING_WINDOWS_GUI/main.cpp"
    click BootloaderCore "https://github.com/amosproj/amos2024ss07-updating-flash-boot-loader/tree/main/MCU_Aurix/bootloader/inc"
    click CANd "https://github.com/amosproj/amos2024ss07-updating-flash-boot-loader/blob/main/MCU_Aurix/driver/inc/can_driver.h"
    click Flashd "https://github.com/amosproj/amos2024ss07-updating-flash-boot-loader/blob/main/MCU_Aurix/driver/inc/flash_driver.h"
    click LEDd "https://github.com/amosproj/amos2024ss07-updating-flash-boot-loader/blob/main/MCU_Aurix/driver/inc/led_driver.h"
    click Resetd "https://github.com/amosproj/amos2024ss07-updating-flash-boot-loader/blob/main/MCU_Aurix/driver/inc/reset.h"
    click CPU "https://github.com/amosproj/amos2024ss07-updating-flash-boot-loader/blob/main/MCU_Aurix/main/Cpu0_Main.c"

    %% Styles
    classDef host fill:#a8d5e2,stroke:#07689f,color:#000;
    classDef embedded fill:#b8e994,stroke:#2d6a4f,color:#000;
    classDef storage fill:#adb5bd,stroke:#6c757d,color:#000,shape:cylinder;
    classDef network fill:none,stroke-dasharray: 5 5,stroke:#495057;
    classDef test fill:#ffcad4,stroke:#b5179e,color:#000;
    class BootloaderCore embedded
    class MemM,CRC,FlashCore embedded
    class Drivers,MIddleware embedded
```
