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.
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;| What | How it works |
|---|---|
| Toolchain | Installed with npx --package @typecad/framework-zephyr zephyr-installer — selective platforms keep the download small |
| Board targets | Every variant in your Zephyr tree — see Boards & Targets. Zephyr ≥4.3 <5.0 supported, checked at build time |
| Probes | Named probe methods per board (stlink, jlink, dfu, uf2, picotool, openocd...) — zephyr.probe picks one; zephyr.runner overrides west’s runner directly |
| Kconfig & CMake | zephyr.kconfig and zephyr.cmakeArgs feed straight into the west build |
| PSRAM | psram: 'opi' | 'quad' emits the right Kconfig for boards that have it |
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
| Zephyr | Native | |
|---|---|---|
| Target | Microcontrollers — ESP32, nRF52, RP2040, STM32 | Your desktop — Windows, macOS, Linux |
| Under the hood | Zephyr kernel, devicetree, west | Plain C++ compiled with g++ / clang++ |
| number | int — widened to long long when values overflow | long long |
| Timers | Thread for background work | setTimeout / setInterval exist too |
| Hardware | The real thing — pins, buses, radios | Simulated pins; SDL for UI screens |
| Best at | Shipping firmware | Fast logic tests and UI iteration without hardware |