Skip to content

Instantly share code, notes, and snippets.

@lupyuen
Last active January 3, 2024 06:04
Show Gist options
  • Save lupyuen/31420bf5f413cd2a98b7b6c7f3efa476 to your computer and use it in GitHub Desktop.
Save lupyuen/31420bf5f413cd2a98b7b6c7f3efa476 to your computer and use it in GitHub Desktop.
Nim on Apache NuttX RTOS: Simple Nim for 32-bit RISC-V is OK. See https://github.com/apache/nuttx-apps/pull/2251
$ cat ../apps/examples/hello_nim/hello_nim_async.nim
proc hello_nim() {.exportc, cdecl.} =
echo "Hello Nim!"
GC_runOrc()
$ make
$ qemu-system-riscv32 \
-M virt,aclint=on \
-cpu rv32 \
-smp 8 \
-bios none \
-kernel nuttx \
-nographic
NuttShell (NSH) NuttX-12.0.3
nsh> uname -a
NuttX 12.0.3 bcc6374fb5d Jan 3 2024 02:22:42 risc-v rv-virt
nsh> hello_nim
Hello Nim!
nsh>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment