🧰 Getting started
Write firmware in TypeScript. typeCAD/hal turns it into the C++ that runs on Zephyr boards — ESP32, nRF52, RP2040, STM32, and more. Common hardware mistakes are caught in your editor as you type, not after you upload, and the result runs as fast as hand-written code.
🧰 Requirements
Node.js is the only real requirement, and it works the same on Linux, macOS, and Windows (no WSL). No Python, conda, or SDK to set up first.
Example first
| Software | Notes | Link |
|---|---|---|
| Node.js | LTS version recommended — node --version to verify | nodejs.org |
| Visual Studio Code | Not required, but recommended — the typeCAD/hal extension comes vendored into every project | code.visualstudio.com |
| git | Optional | git-scm.com |
📦 Create your first project
One command scaffolds the project — config file, tsconfig wired to the board target,
a blink starter, and dependencies installed. --target picks the board; the framework's
full board catalog is fair game.
Example first
npx @typecad/hal create my-project
cd my-projectThen edit src/main.ts — this blinks the board LED, and it's the whole program.
Construction carries the configuration; there is no setup() to write:
import { GPIO, Time } from '@typecad/hal';
import { LED } from '@typecad/hal';
// Construction carries the configuration — there is no setup() to write.
const led = new GPIO(LED, GPIO.OUTPUT);
while (true) {
led.toggle();
Time.sleep(1000);
}➡️ Compile and upload
One build command compiles the TypeScript to C++, builds the Zephyr image, and flashes it over the serial port.
Example first
npx @typecad/hal build --compile --upload --port COM4Quick reference
| Task | Command |
|---|---|
| Create project | npx @typecad/hal create my-project |
| Compile | npx @typecad/hal build --compile |
| Upload | npx @typecad/hal build --upload --port COM4 |
| Watch mode | npx @typecad/hal build --watch --compile |
| Diagnostics | npx @typecad/hal build --diagnostics |
| Check environment | typecad-hal doctor |
Something here unclear or out of date? Open an issue — we'd rather hear about it.