nimbme Nim bare-metal environment for embedded targets. headless mode Actual implemented target: raspberry pi1 / pi zero (bcm2835) General target requirements: at least 4KiB ram at least 20KiB flash 1 UART for terminal 1 hardware timer [cycle counter] software interrupt mechanism features cooperative scheduler (actual simple round-robin scheme / deadline-scheduler planned) code runs under system-mode (armv6) async programming model (requirement: do not block the event loop) easy portable / most of the stuff is in nim - only a 'few' lines of asm project rationale bare-metal playground and research no vendor specific API's - just Nim and direct hardware access having fun Dependencies GNU-ARM a terminal for uploading files (CoolTerm, yat(supports 3000000baud) , realterm or something else) usb to serial adapter [!!! 3.3Vmax on the line !!!] (ftdi, CH340..) Remarks tested with Nim compiler devel / GNU-ARM toolchain 13.3Rel1 with windows11 host older toolchains are also fine but not 14.2Rel1 (actually not investigated) current baudrate is set to 3000000 / highest one for 250mHz core clock - changeable in envconfig.nim [config_uartBaudRate] Installation (raspberry pi1 or pi zero 1) checkout project and compile the demo with "nim build_rp1 project.nims" configure host terminal (EOL is linefeed) copy kernel.img to raspberry´s sd-card (consecutive builds are uploadable via terminal (Motorola SRecord format used)) wire gpio14 (TxD0) to adapter's rx-line wire gpio15 (RxD0) to adapter's tx-line Rx/Tx wires should be short as possible (10cm jumper wired will work) / the ftdi runs fine with 3000000baud (other vendors not tested) wire ground (I always use pin39) to adapter ground power target on follow the instructions on terminal :-) whats implemented so far.. stdio is retargeted to UART the demo spawns up to 10 'processes' (at the moment no posix api) the complete runtime in cycles (per process) is collected (irq cycles are also collected but at the moment not related to the actu...
First seen: 2025-06-27 21:28
Last seen: 2025-06-28 01:29