Skip to content

Instantly share code, notes, and snippets.

View lupyuen's full-sized avatar
💭
Apache NuttX RTOS on StarPro64 RISC-V SBC / ESWIN EIC7700X

Lup Yuen Lee lupyuen

💭
Apache NuttX RTOS on StarPro64 RISC-V SBC / ESWIN EIC7700X
View GitHub Profile
luppy@thinkstation:/tmp$ sudo docker run -it ghcr.io/apache/nuttx/apache-nuttx-ci-linux:latest /bin/bash -c '
set -x ;
uname -a ;
cd ;
pwd ;
git clone https://github.com/anchao/nuttx nuttx --branch 25020501 ;
git clone https://github.com/anchao/nuttx-apps apps --branch 25020501 ;
pushd nuttx ; git reset --hard HEAD ; echo NuttX Source: https://github.com/apache/nuttx/tree/$(git rev-parse HEAD) ; popd ;
pushd apps ; git reset --hard HEAD ; echo NuttX Apps: https://github.com/apache/nuttx-apps/tree/$(git rev-parse HEAD) ; popd ;
cd nuttx ;
luppy@thinkstation:~/nuttx-test-bot$ cd /tmp
luppy@thinkstation:/tmp$ sudo docker run -it ghcr.io/apache/nuttx/apache-nuttx-ci-linux:latest /bin/bash -c '
set -x ;
uname -a ;
cd ;
pwd ;
git clone https://github.com/anchao/nuttx nuttx --branch 25020501 ;
git clone https://github.com/anchao/nuttx-apps apps --branch 25020501 ;
pushd nuttx ; git reset --hard HEAD ; echo NuttX Source: https://github.com/apache/nuttx/tree/$(git rev-parse HEAD) ; popd ;
pushd apps ; git reset --hard HEAD ; echo NuttX Apps: https://github.com/apache/nuttx-apps/tree/$(git rev-parse HEAD) ; popd ;
@lupyuen
lupyuen / gist:31db63ccfaf0e07c45ba0059814e0fd7
Last active April 9, 2025 09:07
Building and Running Python on NuttX
## Building and Running Python on NuttX:
## Based on https://nuttx.apache.org/docs/latest/applications/interpreters/python/index.html#building-and-running-python-on-nuttx
## Assume we have compiled rv-virt:python in Docker: https://gist.github.com/lupyuen/21167fe02656b89632d3cce54aa23024
## Copy the NuttX Image from Docker into Ubuntu
sudo docker cp c23ff7fbe548:/root/nuttx/nuttx .
riscv-none-elf-size nuttx
## Run NuttX Python with with QEMU
ls -l nuttx
@lupyuen
lupyuen / gist:21167fe02656b89632d3cce54aa23024
Last active April 9, 2025 08:55
`rv-virt:python` builds OK with Docker on Ubuntu 24.04.2 LTS
neofetch
sudo docker run \
-it \
ghcr.io/apache/nuttx/apache-nuttx-ci-linux:latest \
/bin/bash
## TODO: Update for the release
export release=12.9.0
export candidate=RC0
export hash=47cdb6a283
@lupyuen
lupyuen / boot-flow.md
Created April 9, 2025 04:34
“Attached is the Mermaid Flowchart for the Boot Flow for Apache NuttX RTOS. Please explain how NuttX boots.” (Gemini Pro 2.5)

“Attached is the Mermaid Flowchart for the Boot Flow for Apache NuttX RTOS. Please explain how NuttX boots.” (Gemini Pro 2.5)

Based on the provided Mermaid flowchart[cite: 1], here's an explanation of the Apache NuttX RTOS boot flow, specifically for the ARM64 architecture (a527 target):

  1. Low-Level Start (arm64_head): The process begins in the assembly file arm64_head.S. This initial code handles very early hardware setup, potentially involving low-level serial output (a527_lowputc.S) for debugging[cite: 1].
  2. Exception Level & C Transition: It then proceeds to initialize the ARM Exception Levels (EL), particularly EL1, where the OS typically runs (arm64_el_init, arm64_boot_el1_init)[cite: 1]. Control is then transferred to the primary C routine (arm64_boot_primary_c_routine in arm64_boot.c)[cite: 1].
  3. Chip & MMU Initialization: The C routine calls chip-specific boot functions (arm64_chip_boot in a527_boot.c)[cite: 1]. A crucial step here is setting up the Memory Mana
@lupyuen
lupyuen / gist:b8d23be87a9b29ec8e025002ec029de1
Last active April 10, 2025 22:20
OSTest on Oz64 SG2000 64-bit RISC-V SBC
cd $HOME/nuttx-build-farm
./build-test.sh oz64 \
/tmp/build-test.log \
HEAD HEAD \
https://github.com/anchao/nuttx 25020501 \
https://github.com/anchao/nuttx-apps 25020501
CC: nsh_parse.c CC: pthread_exit.c CC: nsh_printf.c CC: pthread_rwlock.c CC: pthread_rwlock_cancel.c CC: nsh_proccmds.c CC: nsh_prompt.c CC: nsh_script.c CC: restart.c CC: nsh_session.c CC: roundrobin.c CC: nsh_syscmds.c CC: robust.c CC: nsh_system.c CC: nsh_test.c CC: schedlock.c CC: sem.c CC: nsh_timcmds.c CC: nsh_wait.c CC: semtimed.c CC: setvbuf.c CC: sighand.c CC: sighelper.c CC: signest.c CC: sigprocmask.c CC: timedmqueue.c CC: timedmutex.c CC: timedwait.c CC: vfork.c CC: waitpid.c CC: wqueue.c fpu.c:57:8: warning: #warning "FPU test not built; Only available in the flat build (CONFIG_BUILD_FLAT)" [^[]8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wcpp^G-Wcpp^[]8;;^G]
Script started on 2025-04-11 06:15:58+08:00 [COMMAND="/home/luppy/nuttx-build-farm/build-test-oz64.sh HEAD HEAD
@lupyuen
lupyuen / gist:ae0a726e84bb318d4dfad101836fdfe9
Last active April 10, 2025 22:15
OSTest on Avaota-A1 A527 Arm64 SBC
cd $HOME/nuttx-build-farm
./build-test.sh avaota \
/tmp/build-test.log \
HEAD HEAD \
https://github.com/anchao/nuttx 25020501 \
https://github.com/anchao/nuttx-apps 25020501
Script started on 2025-04-11 06:11:02+08:00 [COMMAND="/home/luppy/nuttx-build-farm/build-test-avaota.sh HEAD HEAD https://github.com/anchao/nuttx 25020501 https://github.com/anchao/nuttx-apps 25020501" TERM="xterm-256color" TTY="/dev/pts/52" COLUMNS="128" LINES="71"]
Now running https://github.com/lupyuen/nuttx-build-farm/blob/main/build-test-avaota.sh HEAD HEAD https://github.com/anchao/nuttx 25020501 https://github.com/anchao/nuttx-apps 25020501
+ export AVAOTA_SERVER=thinkcentre
@lupyuen
lupyuen / validate-nuttx-release-star64-12.9.0-RC0-47cdb6a283.log
Created April 8, 2025 06:31
Validate NuttX Release for star64 (12.9.0 / RC0 / 47cdb6a283)
Script started on 2025-04-08 14:25:58+08:00 [COMMAND="/home/luppy/nuttx-release/release-star64.sh" TERM="xterm-256color" TTY="/dev/pts/40" COLUMNS="129" LINES="73"]
----- Validate NuttX Release for Star64
release=12.9.0
candidate=RC0
hash=47cdb6a283
https://github.com/lupyuen/nuttx-release/blob/main/release-star64.sh
----- Remove checkrelease folder
+ neofetch
.-/+oossssoo+/-.
`:+ssssssssssssssssss+:`
@lupyuen
lupyuen / validate-nuttx-release-pinephone-12.9.0-RC0-47cdb6a283.log
Created April 8, 2025 06:25
Validate NuttX Release for pinephone (12.9.0 / RC0 / 47cdb6a283)
Script started on 2025-04-08 14:17:18+08:00 [COMMAND="/home/luppy/nuttx-release/release-pinephone.sh" TERM="xterm-256color" TTY="/dev/pts/40" COLUMNS="129" LINES="73"]
----- Validate NuttX Release for PinePhone
release=12.9.0
candidate=RC0
hash=47cdb6a283
https://github.com/lupyuen/nuttx-release/blob/main/release-pinephone.sh
----- Remove checkrelease folder
+ neofetch
.-/+oossssoo+/-.
`:+ssssssssssssssssss+:`
@lupyuen
lupyuen / validate-nuttx-release-ox64-12.9.0-RC0-47cdb6a283.log
Created April 8, 2025 06:16
Validate NuttX Release for ox64 (12.9.0 / RC0 / 47cdb6a283)
Script started on 2025-04-08 14:11:21+08:00 [COMMAND="/home/luppy/nuttx-release/release-ox64.sh" TERM="xterm-256color" TTY="/dev/pts/40" COLUMNS="129" LINES="73"]
----- Validate NuttX Release for Ox64
release=12.9.0
candidate=RC0
hash=47cdb6a283
https://github.com/lupyuen/nuttx-release/blob/main/release-ox64.sh
----- Remove checkrelease folder
+ neofetch
.-/+oossssoo+/-.
`:+ssssssssssssssssss+:`