Skip to main content

Python generator guide

The nobro-rtos Python package turns a small JSON workload into the C and assembly boundary used by compact byte-addressed targets. It also parses supported linker reports so a firmware build can fail when its program or data budget is exceeded.

Install

python -m pip install nobro_rtos

The distribution preserves both import nobro_rtos and the compact nobro_core module. It installs the equivalent nobro and nobro-core commands. For a checked-out release, run python tools/nobro_core.py.

Generate an application

Start from ports/byte/examples/useful/app.json:

{
  "schema": "nobro-rtos-core-byte-v1",
  "tick_unit_us": 1000,
  "program_capacity_bytes": 2048,
  "application_reserve_bytes": 1024,
  "mailbox_capacity": 2,
  "idle_hook": true,
  "watchdog_hook": true,
  "tasks": [
    {
      "name": "sensor",
      "period_ticks": 10,
      "dispatch_deadline_ticks": 3,
      "budget_ticks": 1
    }
  ]
}

Generate the fixed configuration and receipt:

nobro-core app.json --out generated

Unknown fields, invalid identifiers, impossible utilization/response bounds, ambiguous wrap intervals, and capacity violations fail closed. Output includes the normalized contract digest, fixed ABI/configuration, task bridge, assembly symbols, and a machine-readable receipt.

Python API

from pathlib import Path
from nobro_rtos import generate

receipt = generate(Path("app.json"), Path("generated"))
print(receipt["kernel_data_bytes"])

Gate a linked image

nobro-core --map firmware.mem --format sdcc-mem \
  --program-limit 1024 --data-limit 32

Supported report formats include SDCC MCS-51/STM8, IAR 8051, Keil C51, GNU size, and MPLAB XC8/XC16 forms. Format selection is explicit; the tool does not guess a compiler from local filenames.

Metadata

Release files for nobro-rtos 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nobro-rtos 1.0.1
File Size Uploaded
nobro_rtos-1.0.1.tar.gz 26.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nobro-rtos 1.0.1
File Interpreter ABI Platform
nobro_rtos-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 49.3 kB

Release files / nobro_rtos-1.0.1.tar.gz

Download URL nobro_rtos-1.0.1.tar.gz
Size 26.6 kB
Tags Source
SHA-256 checksum
How to use checksums
169acd5e22001e544122e90244a67e60016f15dc49335fe2c258891ac41b7380
BLAKE2b-256 checksum
How to use checksums
b1c928f0fb0d613dcbd1c3e55f235f817b98022665af0c9b360c1b0055ec810b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / nobro_rtos-1.0.1-py3-none-any.whl

Download URL nobro_rtos-1.0.1-py3-none-any.whl
Size 22.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5dc44283928e72a9a375dcbc6235f72a73c436e7ccc45fff1b8607d6682d9419
BLAKE2b-256 checksum
How to use checksums
8f70434b8e94402f7334c6762755922ba9404a7e17297b6aea3771fce56ad6ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

0.3.2

2 release files

0.3.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page