Skip to content

Instantly share code, notes, and snippets.

@lupyuen
Created August 29, 2022 11:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lupyuen/7e828ea476d12cffa5e535a215723908 to your computer and use it in GitHub Desktop.
Save lupyuen/7e828ea476d12cffa5e535a215723908 to your computer and use it in GitHub Desktop.
Build NuttX for PinePhone. See https://lupyuen.github.io/articles/uboot
#!/usr/bin/env bash
# Build NuttX for PinePhone
# TODO: Update PATH
export PATH="$PATH:/Applications/ArmGNUToolchain/11.3.rel1/aarch64-none-elf/bin"
set -e # Exit when any command fails
set -x # Echo commands
## Show the version of GCC
aarch64-none-elf-gcc -v
## Build the firmware
make -j
## Show the size
aarch64-none-elf-size nuttx
## Dump the disassembly to nuttx.S
aarch64-none-elf-objdump \
-t -S --demangle --line-numbers --wide \
nuttx \
>nuttx.S \
2>&1
## Compress the NuttX Image
cp nuttx.bin Image
rm -f Image.gz
gzip Image
## Copy to microSD
cp Image.gz "/Volumes/NO NAME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment