.github | ||
LICENSE | ||
README.md |
Apache NuttX RTOS on PinePhone
Apache NuttX RTOS runs on Cortex-A53 with Multi-Core SMP...
https://github.com/apache/incubator-nuttx/tree/master/boards/arm64/qemu/qemu-a53
Will NuttX run on PinePhone? PinePhone is based on Allwinner A64 SoC with 4 Cores of Arm Cortex-A53...
https://wiki.pine64.org/index.php/PinePhone
NuttX might be a fun way to teach more people about Phone Operating Systems. And someday we might have a cheap, fast and responsive phone running on NuttX!
Many thanks to qinwei2004 and the NuttX Team for implementing Cortex-A53 support!
Download NuttX
TODO
mkdir nuttx
cd nuttx
git clone --recursive --branch arm64 \
https://github.com/lupyuen/incubator-nuttx \
nuttx
git clone --recursive --branch arm64 \
https://github.com/lupyuen/incubator-nuttx-apps \
apps
cd nuttx
Install prerequisites, skip the RISC-V Toolchain...
https://lupyuen.github.io/articles/nuttx#install-prerequisites
Download Toolchain
TODO
Instructions:
https://github.com/apache/incubator-nuttx/tree/master/boards/arm64/qemu/qemu-a53
Download toolchain for AArch64 ELF bare-metal target (aarch64-none-elf)
https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads
For macOS:
For x64 Linux:
Add to PATH: /Applications/ArmGNUToolchain/11.3.rel1/aarch64-none-elf/bin
export PATH="$PATH:/Applications/ArmGNUToolchain/11.3.rel1/aarch64-none-elf/bin"
Download QEMU
TODO
Download QEMU: https://www.qemu.org/download/
brew install qemu
Build NuttX: Single Core
TODO
Configure NuttX and compile...
./tools/configure.sh -l qemu-a53:nsh
make
Test with qemu...
qemu-system-aarch64 -cpu cortex-a53 -nographic \
-machine virt,virtualization=on,gic-version=3 \
-net none -chardev stdio,id=con,mux=on -serial chardev:con \
-mon chardev=con,mode=readline -kernel ./nuttx
Build NuttX: Multi Core
TODO
Configure NuttX and compile...
./tools/configure.sh -l qemu-a53:nsh_smp
make
Test with qemu...
qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic \
-machine virt,virtualization=on,gic-version=3 \
-net none -chardev stdio,id=con,mux=on -serial chardev:con \
-mon chardev=con,mode=readline -kernel ./nuttx
Analyse PinePhone Image wit Ghidra
TODO: Disassemble a PinePhone Image with Ghidra to look at the Startup Code
https://github.com/dreemurrs-embedded/Jumpdrive
Download https://github.com/dreemurrs-embedded/Jumpdrive/releases/download/0.8/pine64-pinephone.img.xz
Expand pine64-pinephone.img.xz
Expand the files inside...
gunzip Image.gz
gunzip initramfs.gz
tar xvf initramfs
Import Image
as AARCH64:LE:v8A:default...
- Processor: AARCH64
- Variant: v8A
- Size: 64
- Endian: little
- Compiler: default
TODO
TODO: Verify that NuttX uses similar Startup Code
TODO: Build UART Driver in NuttX for Allwinner A64 SoC
TODO: Configure NuttX Memory Regions for Allwinner A64 SoC
TODO: Copy NuttX to microSD Card
TODO: Boot NuttX on PinePhone and test NuttX Shell