How atmosic/openair works
Project Type and Purpose
• This is an embedded‐firmware SDK (Atmosic Zephyr SDK) built on top of the Zephyr RTOS.
• It provides board support (ATMx2xx, ATM33xx), HAL modules, drivers, device trees, libraries, example applications, build‐tooling scripts, and west manifest integration to enable rapid development for Atmosic SoCs.
High‐Level Architectural Layers
• Host Toolchain & Orchestration
• Zephyr Build System (CMake + Kconfig + west)
• Zephyr RTOS Core & Subsystems
• Atmosic SoC Support (soc/, modules/hal_atmosic/, dts/)
• Platform Abstraction (drivers/, lib/)
• Board Support & Device Trees (boards/, applications/fmna_tag/)
• Firmware Artifacts (samples/, applications/, tests/)
• Deployment & Programming Tools (tools/scripts/)
Main Components and Relationships
a. Host Toolchain & Orchestration
• west (west.yml, west/…)
• Python scripts under tools/scripts/ (e.g., atm_openocd.py, atm_otp.py)
→ Orchestrates repo cloning, dependency fetch, build invocation, flashing, DFU.
b. Zephyr Build System
• CMakeLists.txt at top level, cmake/common.cmake
• Kconfig, Kconfig.sysbuild
• Uses west to assemble modules & passes configuration to CMake/Kconfig for building.
c. Zephyr RTOS Core & Subsystems
• zephyr/module.yml (pulls in the actual Zephyr kernel)
• subsys/ (settings, mgmt, etc.)
• dts/arm/atmosic/ and dts/bindings/ for device‐tree includes.
d. Atmosic SoC Support
• soc/atmosic/{ATM33, ATMx2}/ provides linker scripts, soc.c/h, default-configs.
• modules/hal_atmosic provides Hardware Abstraction Layer (power, PMU, AES, SHA, vendor drivers, BLE radio stack, OpenOCD scripts).
e. Platform Abstraction Libraries
• drivers/ (adc, gpio, i2c, serial, sensor, etc.)
• lib/ (utility libraries: atm_utils, mcuboot hooks, debug/auth, test_common)
→ Built as static objects or linked into the firmware.
f. Board Support & Device Trees
• boards/atmosic/… defines board .dts, .yaml, defconfigs, overlays.
• applications/fmna_tag/ a concrete example application with its own board overlays, project config, sample.yaml, main.c.
g. Firmware Artifacts
• samples/ and tests/ show example usage of drivers and subsystems.
• each sample has CMakeLists.txt, Kconfig, prj.conf, sample.yaml, source code, overlay files.
→ Illustrate how end users will write and build their own firmware.
h. Deployment & Programming Tools
• tools/scripts/ for partition info, DFU, tag data generation, secure‐boot unlocking, OpenOCD server scripts.
• sysbuild/ and scripts/sysbuild/ for sample project generation.
Architectural Patterns & Principles
• Layered / Separation of Concerns: each layer (kernel, HAL, drivers, board, app) is loosely coupled via build config and device‐tree includes.
• Modularity via west manifests, allowing independent inclusion and versioning of modules (hal_atmosic, soc, drivers).
• Hardware Abstraction: HAL (modules/hal_atmosic) sits between RTOS and SoC hardware.
• Configuration through Kconfig/prj.conf and YAML overlays ensures portable builds across boards.