# topst-development/freertos-vcp architecture

> Architecture diagram of the GitHub repository topst-development/freertos-vcp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/topst-development/freertos-vcp
- Repository: https://github.com/topst-development/freertos-vcp

## Overview

This repository is a Telechips TCC70xx MCU board-support and sample-application codebase, with a separate firmware-updater application and bundled FreeRTOS/FreeRTOS+TCP runtime. The visible application workflow starts in `cmain`, initializes the system, and creates enabled demo tasks; the console exposes driver and demo functionality. Peripheral drivers provide the hardware-facing layer, while HSM management supports secure operations and firmware-update storage. The README is empty, and sampled excerpts are partial, so links for unsampled subsystems are omitted rather than inferred.

Main entry points: [`sources/app.drivers/hsm/tcc70xx/hsm_manager.c`](https://github.com/topst-development/freertos-vcp/blob/develop/sources/app.drivers/hsm/tcc70xx/hsm_manager.c) (HSM manager), [`sources/dev.drivers/pdm/pdm.c`](https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/pdm/pdm.c) (PDM driver), [`sources/app.sample/app.base/main.c`](https://github.com/topst-development/freertos-vcp/blob/develop/sources/app.sample/app.base/main.c) (Application startup), [`sources/dev.drivers/can/can_drv.c`](https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/can/can_drv.c) (CAN driver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_apps["Sample applications"]
  node_startup["Application startup<br/>[main.c]"]
  node_console["Demo console<br/>[console.c]"]
  node_can_demo["CAN demo<br/>[can_demo.c]"]
  node_power_demo["Power demo<br/>[power_app.c]"]
end

subgraph group_security["Security and updates"]
  node_fw_update["Firmware update<br/>[fwupdate.c]"]
  node_hsm["HSM manager<br/>[hsm_manager.c]"]
end

subgraph group_drivers["Device drivers"]
  node_mailbox["Mailbox driver<br/>[mbox.c]"]
  node_serial_flash["Serial flash<br/>[snor_mio.c]"]
  node_eflash["Embedded flash<br/>[eflash.c]"]
  node_can_driver["CAN driver<br/>[can_drv.c]"]
  node_can_port["CAN porting<br/>[can_porting.c]"]
  node_can_regs["CAN registers<br/>[can_reg.h]"]
  node_pdm["PDM driver<br/>[pdm.c]"]
  node_gpio["GPIO driver<br/>[gpio.c]"]
  node_pmio["PMIO interface<br/>[pmio.h]"]
  node_fmu["FMU interface<br/>[fmu.h]"]
end

subgraph group_runtime["OS and networking"]
  node_freertos_tasks["FreeRTOS tasks<br/>[tasks.c]"]
  node_freertos_api["Task API<br/>[task.h]"]
  node_tcp_ip["TCP/IP task<br/>[FreeRTOS_TCP_IP.c]"]
  node_tcp_private["TCP internals"]
end

node_startup -->|"creates task"| node_console
node_startup -->|"starts demo"| node_power_demo
node_console -->|"dispatches demo"| node_can_demo
node_hsm -->|"sends commands"| node_mailbox
node_hsm -->|"uses update definitions"| node_fw_update
node_hsm -->|"selects storage"| node_serial_flash
node_hsm -->|"selects storage"| node_eflash
node_can_driver -->|"uses porting"| node_can_port
node_can_driver -->|"uses registers"| node_can_regs
node_pdm -->|"uses GPIO"| node_gpio
node_pdm -->|"uses PMIO"| node_pmio
node_pdm -->|"uses FMU"| node_fmu
node_freertos_tasks -->|"implements API"| node_freertos_api
node_tcp_ip -->|"uses internals"| node_tcp_private

click node_startup "https://github.com/topst-development/freertos-vcp/blob/develop/sources/app.sample/app.base/main.c"
click node_console "https://github.com/topst-development/freertos-vcp/blob/develop/sources/app.sample/app.console/console.c"
click node_can_demo "https://github.com/topst-development/freertos-vcp/blob/develop/sources/app.sample/app.can.demo/can_demo.c"
click node_power_demo "https://github.com/topst-development/freertos-vcp/blob/develop/sources/app.sample/app.expwr.demo/power_app.c"
click node_fw_update "https://github.com/topst-development/freertos-vcp/blob/develop/sources/app.sample/app.fw.update/fwupdate.c"
click node_hsm "https://github.com/topst-development/freertos-vcp/blob/develop/sources/app.drivers/hsm/tcc70xx/hsm_manager.c"
click node_mailbox "https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/mailbox/mbox.c"
click node_serial_flash "https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/sfmc/tcc70xx/snor_mio.c"
click node_eflash "https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/eflash/tcc70xx/eflash.c"
click node_can_driver "https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/can/can_drv.c"
click node_can_port "https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/can/tcc70xx/can_porting.c"
click node_can_regs "https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/can/tcc70xx/can_reg.h"
click node_pdm "https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/pdm/pdm.c"
click node_gpio "https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/gpio/tcc70xx/gpio.c"
click node_pmio "https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/pmio/pmio.h"
click node_fmu "https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/fmu/fmu.h"
click node_freertos_tasks "https://github.com/topst-development/freertos-vcp/blob/develop/sources/os/freertos/FreeRTOS-Kernel/tasks.c"
click node_freertos_api "https://github.com/topst-development/freertos-vcp/blob/develop/sources/os/freertos/FreeRTOS-Kernel/include/task.h"
click node_tcp_ip "https://github.com/topst-development/freertos-vcp/blob/develop/sources/os/freertos/FreeRTOS-Plus-TCP/FreeRTOS_TCP_IP.c"
click node_tcp_private "https://github.com/topst-development/freertos-vcp/blob/develop/sources/os/freertos/FreeRTOS-Plus-TCP/include/FreeRTOS_IP_Private.h"

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_startup,node_console,node_can_demo,node_power_demo toneBlue
class node_fw_update,node_hsm toneAmber
class node_mailbox,node_serial_flash,node_eflash,node_can_driver,node_can_port,node_can_regs,node_pdm,node_gpio,node_pmio,node_fmu toneMint
class node_freertos_tasks,node_freertos_api,node_tcp_ip,node_tcp_private toneRose
```

## Components

### Sample applications

- [Application startup](https://github.com/topst-development/freertos-vcp/blob/develop/sources/app.sample/app.base/main.c): `sources/app.sample/app.base/main.c`
- [Demo console](https://github.com/topst-development/freertos-vcp/blob/develop/sources/app.sample/app.console/console.c): `sources/app.sample/app.console/console.c`
- [CAN demo](https://github.com/topst-development/freertos-vcp/blob/develop/sources/app.sample/app.can.demo/can_demo.c): `sources/app.sample/app.can.demo/can_demo.c`
- [Power demo](https://github.com/topst-development/freertos-vcp/blob/develop/sources/app.sample/app.expwr.demo/power_app.c): `sources/app.sample/app.expwr.demo/power_app.c`

### Security and updates

- [Firmware update](https://github.com/topst-development/freertos-vcp/blob/develop/sources/app.sample/app.fw.update/fwupdate.c): `sources/app.sample/app.fw.update/fwupdate.c`
- [HSM manager](https://github.com/topst-development/freertos-vcp/blob/develop/sources/app.drivers/hsm/tcc70xx/hsm_manager.c): `sources/app.drivers/hsm/tcc70xx/hsm_manager.c`

### Device drivers

- [Mailbox driver](https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/mailbox/mbox.c): `sources/dev.drivers/mailbox/mbox.c`
- [Serial flash](https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/sfmc/tcc70xx/snor_mio.c): `sources/dev.drivers/sfmc/tcc70xx/snor_mio.c`
- [Embedded flash](https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/eflash/tcc70xx/eflash.c): `sources/dev.drivers/eflash/tcc70xx/eflash.c`
- [CAN driver](https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/can/can_drv.c): `sources/dev.drivers/can/can_drv.c`
- [CAN porting](https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/can/tcc70xx/can_porting.c): `sources/dev.drivers/can/tcc70xx/can_porting.c`
- [CAN registers](https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/can/tcc70xx/can_reg.h): `sources/dev.drivers/can/tcc70xx/can_reg.h`
- [PDM driver](https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/pdm/pdm.c): `sources/dev.drivers/pdm/pdm.c`
- [GPIO driver](https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/gpio/tcc70xx/gpio.c): `sources/dev.drivers/gpio/tcc70xx/gpio.c`
- [PMIO interface](https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/pmio/pmio.h): `sources/dev.drivers/pmio/pmio.h`
- [FMU interface](https://github.com/topst-development/freertos-vcp/blob/develop/sources/dev.drivers/fmu/fmu.h): `sources/dev.drivers/fmu/fmu.h`

### OS and networking

- [FreeRTOS tasks](https://github.com/topst-development/freertos-vcp/blob/develop/sources/os/freertos/FreeRTOS-Kernel/tasks.c): `sources/os/freertos/FreeRTOS-Kernel/tasks.c`
- [Task API](https://github.com/topst-development/freertos-vcp/blob/develop/sources/os/freertos/FreeRTOS-Kernel/include/task.h): `sources/os/freertos/FreeRTOS-Kernel/include/task.h`
- [TCP/IP task](https://github.com/topst-development/freertos-vcp/blob/develop/sources/os/freertos/FreeRTOS-Plus-TCP/FreeRTOS_TCP_IP.c): `sources/os/freertos/FreeRTOS-Plus-TCP/FreeRTOS_TCP_IP.c`
- [TCP internals](https://github.com/topst-development/freertos-vcp/blob/develop/sources/os/freertos/FreeRTOS-Plus-TCP/include/FreeRTOS_IP_Private.h): `sources/os/freertos/FreeRTOS-Plus-TCP/include/FreeRTOS_IP_Private.h`

## Connections

- Application startup → Demo console: creates task (evidence: `sources/app.sample/app.base/main.c`)
- Application startup → Power demo: starts demo (evidence: `sources/app.sample/app.base/main.c`)
- Demo console → CAN demo: dispatches demo (evidence: `sources/app.sample/app.console/console.c`)
- HSM manager → Mailbox driver: sends commands (evidence: `sources/app.drivers/hsm/tcc70xx/hsm_manager.c`)
- HSM manager → Firmware update: uses update definitions (evidence: `sources/app.drivers/hsm/tcc70xx/hsm_manager.c`)
- HSM manager → Serial flash: selects storage (evidence: `sources/app.drivers/hsm/tcc70xx/hsm_manager.c`)
- HSM manager → Embedded flash: selects storage (evidence: `sources/app.drivers/hsm/tcc70xx/hsm_manager.c`)
- CAN driver → CAN porting: uses porting (evidence: `sources/dev.drivers/can/can_drv.c`)
- CAN driver → CAN registers: uses registers (evidence: `sources/dev.drivers/can/can_drv.c`)
- PDM driver → GPIO driver: uses GPIO (evidence: `sources/dev.drivers/pdm/pdm.c`)
- PDM driver → PMIO interface: uses PMIO (evidence: `sources/dev.drivers/pdm/pdm.c`)
- PDM driver → FMU interface: uses FMU (evidence: `sources/dev.drivers/pdm/pdm.c`)
- FreeRTOS tasks → Task API: implements API (evidence: `sources/os/freertos/FreeRTOS-Kernel/tasks.c`)
- TCP/IP task → TCP internals: uses internals (evidence: `sources/os/freertos/FreeRTOS-Plus-TCP/FreeRTOS_TCP_IP.c`)
