# rsankar1996/my_tinyml_app architecture

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

- Interactive diagram: https://gitdiagram.com/rsankar1996/my_tinyml_app
- Repository: https://github.com/rsankar1996/my_tinyml_app

## Overview

This is embedded TinyML firmware for running a weather model on a Renesas RA6M4 board. The visible entry point reaches the HAL, while the repository includes a compiled-in TFLite model and TensorFlow Lite Micro runtime components. The main application and HAL implementation were not sampled, so their detailed wiring and the exact input/output interface cannot be confirmed; the graph shows only the supported high-level workflow and runtime layers.

Main entry points: [`e2_studio_project/src/main_application.cpp`](https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/src/main_application.cpp) (Weather application), [`e2_studio_project/src/hal_entry.cpp`](https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/src/hal_entry.cpp) (HAL entry), [`e2_studio_project/src/tensorflow/lite/micro/all_ops_resolver.cc`](https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/src/tensorflow/lite/micro/all_ops_resolver.cc) (Operator resolver), [`e2_studio_project/src/tensorflow/lite/micro/micro_context.cc`](https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/src/tensorflow/lite/micro/micro_context.cc) (Tensor context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_firmware["Firmware app"]
  node_main["Firmware entry<br/>[main.c]"]
  node_hal["HAL entry<br/>[hal_entry.cpp]"]
  node_app["Weather application"]
end

subgraph group_tflm["TinyML runtime"]
  node_resolver["Operator resolver"]
  node_kernels["Inference kernels"]
  node_context["Tensor context<br/>[micro_context.cc]"]
  node_allocator["Arena allocator"]
end

subgraph group_model["Model data"]
  node_modeldata["Embedded model<br/>[weather_model.cc]"]
end

subgraph group_platform["Board platform"]
  node_board["Board initialization<br/>[board_init.c]"]
  node_fsp["Peripheral services<br/>[bsp_common.c]"]
end

node_input(("Weather input"))
node_output(("Weather result"))

node_input -->|"provides input"| node_app
node_main -->|"calls"| node_hal
node_hal -->|"enters"| node_app
node_app -->|"reads model"| node_modeldata
node_app -->|"configures operators"| node_resolver
node_app -->|"uses tensor context"| node_context
node_context -->|"allocates tensors"| node_allocator
node_resolver -->|"registers operators"| node_kernels
node_app -->|"produces result"| node_output
node_board -->|"uses services"| node_fsp

click node_main "https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/ra_gen/main.c"
click node_hal "https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/src/hal_entry.cpp"
click node_app "https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/src/main_application.cpp"
click node_modeldata "https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/src/weather_model.cc"
click node_resolver "https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/src/tensorflow/lite/micro/all_ops_resolver.cc"
click node_kernels "https://github.com/rsankar1996/my_tinyml_app/tree/main/e2_studio_project/src/tensorflow/lite/micro/kernels"
click node_context "https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/src/tensorflow/lite/micro/micro_context.cc"
click node_allocator "https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/src/tensorflow/lite/micro/arena_allocator/simple_memory_allocator.cc"
click node_board "https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/ra/board/ra6m4_ek/board_init.c"
click node_fsp "https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/ra/fsp/src/bsp/mcu/all/bsp_common.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_main,node_hal,node_app toneBlue
class node_resolver,node_kernels,node_context,node_allocator toneAmber
class node_modeldata toneMint
class node_board,node_fsp toneRose
class node_input,node_output toneIndigo
```

## Components

### Firmware app

- [Firmware entry](https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/ra_gen/main.c): `e2_studio_project/ra_gen/main.c`
- [HAL entry](https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/src/hal_entry.cpp): `e2_studio_project/src/hal_entry.cpp`
- [Weather application](https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/src/main_application.cpp): `e2_studio_project/src/main_application.cpp`

### TinyML runtime

- [Operator resolver](https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/src/tensorflow/lite/micro/all_ops_resolver.cc): `e2_studio_project/src/tensorflow/lite/micro/all_ops_resolver.cc`
- [Inference kernels](https://github.com/rsankar1996/my_tinyml_app/tree/main/e2_studio_project/src/tensorflow/lite/micro/kernels): `e2_studio_project/src/tensorflow/lite/micro/kernels`
- [Tensor context](https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/src/tensorflow/lite/micro/micro_context.cc): `e2_studio_project/src/tensorflow/lite/micro/micro_context.cc`
- [Arena allocator](https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/src/tensorflow/lite/micro/arena_allocator/simple_memory_allocator.cc): `e2_studio_project/src/tensorflow/lite/micro/arena_allocator/simple_memory_allocator.cc`

### Model data

- [Embedded model](https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/src/weather_model.cc): `e2_studio_project/src/weather_model.cc`

### Board platform

- [Board initialization](https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/ra/board/ra6m4_ek/board_init.c): `e2_studio_project/ra/board/ra6m4_ek/board_init.c`
- [Peripheral services](https://github.com/rsankar1996/my_tinyml_app/blob/main/e2_studio_project/ra/fsp/src/bsp/mcu/all/bsp_common.c): `e2_studio_project/ra/fsp/src/bsp/mcu/all/bsp_common.c`

### Other components

- **Weather input**
- **Weather result**

## Connections

- Weather input → Weather application: provides input
- Firmware entry → HAL entry: calls
- HAL entry → Weather application: enters
- Weather application → Embedded model: reads model
- Weather application → Operator resolver: configures operators
- Weather application → Tensor context: uses tensor context
- Tensor context → Arena allocator: allocates tensors
- Operator resolver → Inference kernels: registers operators
- Weather application → Weather result: produces result
- Board initialization → Peripheral services: uses services
