# jabed-akhtar/canopenstm32_ architecture

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

- Interactive diagram: https://gitdiagram.com/jabed-akhtar/canopenstm32_
- Repository: https://github.com/jabed-akhtar/canopenstm32_

## Overview

CANopenNode_STM32 is an STM32 port and demo application for CANopen, supporting CAN/FDCAN hardware and both bare-metal and FreeRTOS examples. The documented primary workflow initializes the CANopen application, services it from a main loop or task, and handles timer interrupts; CAN messages enter through the controller’s interrupt-driven driver. The tree contains no CANopenNode protocol-stack sources, so protocol stages such as PDO, SDO, and NMT are not expanded into implementation nodes. Relationships for unsampled modern modules are limited to documented behavior.

Main entry points: [`legacy/stm32h7xx_fdcan_rtos/Src/main.c`](https://github.com/jabed-akhtar/canopenstm32_/blob/master/legacy/stm32h7xx_fdcan_rtos/Src/main.c) (FreeRTOS demo), [`CANopenNode_STM32/CO_app_STM32.c`](https://github.com/jabed-akhtar/canopenstm32_/blob/master/CANopenNode_STM32/CO_app_STM32.c) (CANopen app API), [`legacy/stm32h7xx_fdcan/Src/main.c`](https://github.com/jabed-akhtar/canopenstm32_/blob/master/legacy/stm32h7xx_fdcan/Src/main.c) (Bare-metal demo), [`CANopenNode_STM32/CO_driver_STM32.c`](https://github.com/jabed-akhtar/canopenstm32_/blob/master/CANopenNode_STM32/CO_driver_STM32.c) (STM32 CAN driver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_application["CANopen app API<br/>[CO_app_STM32.c]"]
  node_object_dictionary[("Object dictionary<br/>[OD.c]")]
  node_storage["Blank storage<br/>[CO_storageBlank.c]"]
end

subgraph group_port["STM32 Port"]
  node_stm_driver["STM32 CAN driver<br/>[CO_driver_STM32.c]"]
  node_stm_target["Target definitions<br/>[CO_driver_target.h]"]
end

subgraph group_legacy["Legacy Demos"]
  node_baremetal_demo["Bare-metal demo<br/>[main.c]"]
  node_rtos_demo["FreeRTOS demo<br/>[main.c]"]
  node_legacy_driver["Legacy CAN driver"]
  node_legacy_od[("Legacy dictionary<br/>[OD.c]")]
  node_legacy_comm["Debug communication"]
end

subgraph group_platform["Board Platform"]
  node_rtos_api["CMSIS-RTOS2 adapter<br/>[cmsis_os2.c]"]
  node_freertos["FreeRTOS kernel<br/>[tasks.c]"]
  node_hal["STM32 HAL<br/>[stm32h7xx_hal.h]"]
  node_hal_timer["HAL timer"]
end

node_developer(("Application integrator"))
node_can_bus(("CAN network"))

node_developer -->|"configures and runs"| node_application
node_application -.->|"uses CAN interface"| node_stm_driver
node_application -.->|"uses dictionary"| node_object_dictionary
node_application -.->|"optional storage"| node_storage
node_can_bus -.->|"sends CAN frames"| node_stm_driver
node_stm_driver -.->|"receives CAN frames"| node_can_bus
node_baremetal_demo -->|"uses dictionary"| node_legacy_od
node_baremetal_demo -->|"logs status"| node_legacy_comm
node_rtos_demo -->|"uses dictionary"| node_legacy_od
node_rtos_demo -->|"logs status"| node_legacy_comm
node_rtos_demo -->|"creates threads"| node_rtos_api
node_rtos_api -->|"adapts calls"| node_freertos
node_legacy_driver -->|"uses HAL"| node_hal
node_baremetal_demo -.->|"initializes CAN"| node_legacy_driver
node_rtos_demo -.->|"initializes CAN"| node_legacy_driver
node_hal_timer -->|"implements timer HAL"| node_hal

click node_application "https://github.com/jabed-akhtar/canopenstm32_/blob/master/CANopenNode_STM32/CO_app_STM32.c"
click node_object_dictionary "https://github.com/jabed-akhtar/canopenstm32_/blob/master/CANopenNode_STM32/OD.c"
click node_storage "https://github.com/jabed-akhtar/canopenstm32_/blob/master/CANopenNode_STM32/CO_storageBlank.c"
click node_stm_driver "https://github.com/jabed-akhtar/canopenstm32_/blob/master/CANopenNode_STM32/CO_driver_STM32.c"
click node_stm_target "https://github.com/jabed-akhtar/canopenstm32_/blob/master/CANopenNode_STM32/CO_driver_target.h"
click node_baremetal_demo "https://github.com/jabed-akhtar/canopenstm32_/blob/master/legacy/stm32h7xx_fdcan/Src/main.c"
click node_rtos_demo "https://github.com/jabed-akhtar/canopenstm32_/blob/master/legacy/stm32h7xx_fdcan_rtos/Src/main.c"
click node_legacy_driver "https://github.com/jabed-akhtar/canopenstm32_/blob/master/legacy/source/CO_driver_stm32h735g-dk.c"
click node_legacy_od "https://github.com/jabed-akhtar/canopenstm32_/blob/master/legacy/source/OD.c"
click node_legacy_comm "https://github.com/jabed-akhtar/canopenstm32_/blob/master/legacy/source/comm_stm32h735g-dk.c"
click node_rtos_api "https://github.com/jabed-akhtar/canopenstm32_/blob/master/legacy/libs/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c"
click node_freertos "https://github.com/jabed-akhtar/canopenstm32_/blob/master/legacy/libs/FreeRTOS/Source/tasks.c"
click node_hal "https://github.com/jabed-akhtar/canopenstm32_/blob/master/legacy/drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal.h"
click node_hal_timer "https://github.com/jabed-akhtar/canopenstm32_/blob/master/legacy/drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.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_application,node_object_dictionary,node_storage toneBlue
class node_stm_driver,node_stm_target toneAmber
class node_baremetal_demo,node_rtos_demo,node_legacy_driver,node_legacy_od,node_legacy_comm toneMint
class node_rtos_api,node_freertos,node_hal,node_hal_timer toneRose
class node_developer,node_can_bus toneIndigo
```

## Components

### Application

- [CANopen app API](https://github.com/jabed-akhtar/canopenstm32_/blob/master/CANopenNode_STM32/CO_app_STM32.c): `CANopenNode_STM32/CO_app_STM32.c`
- [Object dictionary](https://github.com/jabed-akhtar/canopenstm32_/blob/master/CANopenNode_STM32/OD.c): `CANopenNode_STM32/OD.c`
- [Blank storage](https://github.com/jabed-akhtar/canopenstm32_/blob/master/CANopenNode_STM32/CO_storageBlank.c): `CANopenNode_STM32/CO_storageBlank.c`

### STM32 Port

- [STM32 CAN driver](https://github.com/jabed-akhtar/canopenstm32_/blob/master/CANopenNode_STM32/CO_driver_STM32.c): `CANopenNode_STM32/CO_driver_STM32.c`
- [Target definitions](https://github.com/jabed-akhtar/canopenstm32_/blob/master/CANopenNode_STM32/CO_driver_target.h): `CANopenNode_STM32/CO_driver_target.h`

### Legacy Demos

- [Bare-metal demo](https://github.com/jabed-akhtar/canopenstm32_/blob/master/legacy/stm32h7xx_fdcan/Src/main.c): `legacy/stm32h7xx_fdcan/Src/main.c`
- [FreeRTOS demo](https://github.com/jabed-akhtar/canopenstm32_/blob/master/legacy/stm32h7xx_fdcan_rtos/Src/main.c): `legacy/stm32h7xx_fdcan_rtos/Src/main.c`
- [Legacy CAN driver](https://github.com/jabed-akhtar/canopenstm32_/blob/master/legacy/source/CO_driver_stm32h735g-dk.c): `legacy/source/CO_driver_stm32h735g-dk.c`
- [Legacy dictionary](https://github.com/jabed-akhtar/canopenstm32_/blob/master/legacy/source/OD.c): `legacy/source/OD.c`
- [Debug communication](https://github.com/jabed-akhtar/canopenstm32_/blob/master/legacy/source/comm_stm32h735g-dk.c): `legacy/source/comm_stm32h735g-dk.c`

### Board Platform

- [CMSIS-RTOS2 adapter](https://github.com/jabed-akhtar/canopenstm32_/blob/master/legacy/libs/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c): `legacy/libs/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c`
- [FreeRTOS kernel](https://github.com/jabed-akhtar/canopenstm32_/blob/master/legacy/libs/FreeRTOS/Source/tasks.c): `legacy/libs/FreeRTOS/Source/tasks.c`
- [STM32 HAL](https://github.com/jabed-akhtar/canopenstm32_/blob/master/legacy/drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal.h): `legacy/drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal.h`
- [HAL timer](https://github.com/jabed-akhtar/canopenstm32_/blob/master/legacy/drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.c): `legacy/drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.c`

### Other components

- **Application integrator**
- **CAN network**

## Connections

- Application integrator → CANopen app API: configures and runs
- CANopen app API → STM32 CAN driver: uses CAN interface
- CANopen app API → Object dictionary: uses dictionary
- CANopen app API → Blank storage: optional storage
- CAN network → STM32 CAN driver: sends CAN frames
- STM32 CAN driver → CAN network: receives CAN frames
- Bare-metal demo → Legacy dictionary: uses dictionary (evidence: `legacy/stm32h7xx_fdcan/Src/main.c`)
- Bare-metal demo → Debug communication: logs status (evidence: `legacy/stm32h7xx_fdcan/Src/main.c`)
- FreeRTOS demo → Legacy dictionary: uses dictionary (evidence: `legacy/stm32h7xx_fdcan_rtos/Src/main.c`)
- FreeRTOS demo → Debug communication: logs status (evidence: `legacy/stm32h7xx_fdcan_rtos/Src/main.c`)
- FreeRTOS demo → CMSIS-RTOS2 adapter: creates threads (evidence: `legacy/stm32h7xx_fdcan_rtos/Src/main.c`)
- CMSIS-RTOS2 adapter → FreeRTOS kernel: adapts calls (evidence: `legacy/libs/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c`)
- Legacy CAN driver → STM32 HAL: uses HAL (evidence: `legacy/source/CO_driver_stm32h735g-dk.c`)
- Bare-metal demo → Legacy CAN driver: initializes CAN
- FreeRTOS demo → Legacy CAN driver: initializes CAN
- HAL timer → STM32 HAL: implements timer HAL (evidence: `legacy/drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.c`)
