Frameworks

A framework is where your program runs. Zephyr is the flagship: real boards, real hardware, production firmware. Native compiles the same TypeScript to a desktop binary — no hardware, instant iteration, useful before the board arrives.

framework

Zephyr

Production firmware on Zephyr RTOS boards. The framework package installs and verifies the toolchain, generates out-of-tree boards for contract hardware, and lowers every HAL operation to its Zephyr API (gpio_pin_toggle_dt, k_msleep, k_uptime_get, and friends).

Example first

typecad-hal.config.ts
import type { TypecadConfig } from '@typecad/hal/config';

const config: TypecadConfig = {
  board: 'blackpill_f411ce/stm32f411xe',
  framework: '@typecad/framework-zephyr',
  zephyr: {
    kconfig: { CONFIG_MAIN_STACK_SIZE: '4096' },
    cmakeArgs: ['-DCONFIG_ASSERT=y'],
    probe: 'stlink',            // named probe method — or 'runner' below
    runnerArgs: ['--snr', '000000000'],
  },
};

export default config;
WhatHow it works
ToolchainInstalled with npx --package @typecad/framework-zephyr zephyr-installer — selective platforms keep the download small
Board targetsEvery variant in your Zephyr tree — see Boards & Targets. Zephyr ≥4.3 <5.0 supported, checked at build time
ProbesNamed probe methods per board (stlink, jlink, dfu, uf2, picotool, openocd...) — zephyr.probe picks one; zephyr.runner overrides west’s runner directly
Kconfig & CMakezephyr.kconfig and zephyr.cmakeArgs feed straight into the west build
PSRAMpsram: 'opi' | 'quad' emits the right Kconfig for boards that have it
framework

Native

A desktop C++ target built into the engine. Same language surface, no hardware layer — digital reads return low, and the UI system renders through SDL instead of a display panel.

Example first

typecad-hal.config.ts
import type { TypecadConfig } from '@typecad/hal/config';

const config: TypecadConfig = {
  framework: 'native',
  native: {
    compiler: 'g++',
    cxxStandard: 'c++17',
    includePaths: ['./vendor/include'],
    libraries: ['sdl2'],
    warnings: 'extra',          // none | basic | all | extra | error
    staticLink: true,
  },
};

export default config;

Choosing

ZephyrNative
TargetMicrocontrollers — ESP32, nRF52, RP2040, STM32Your desktop — Windows, macOS, Linux
Under the hoodZephyr kernel, devicetree, westPlain C++ compiled with g++ / clang++
numberint — widened to long long when values overflowlong long
TimersThread for background worksetTimeout / setInterval exist too
HardwareThe real thing — pins, buses, radiosSimulated pins; SDL for UI screens
Best atShipping firmwareFast logic tests and UI iteration without hardware
© 2026 typeCAD — code-defined electronics github