Skip to content

Instantly share code, notes, and snippets.

@lupyuen
Created January 20, 2025 03:08
hello_rust_cargo on Apache NuttX RTOS rv-virt:leds64
luppy@thinkstation:~$ rm -rf .cargo .rustup rust rust2
luppy@thinkstation:~$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
info: downloading installer
Welcome to Rust!
This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.
Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:
/home/luppy/.rustup
This can be modified with the RUSTUP_HOME environment variable.
The Cargo home directory is located at:
/home/luppy/.cargo
This can be modified with the CARGO_HOME environment variable.
The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:
/home/luppy/.cargo/bin
This path will then be added to your PATH environment variable by
modifying the profile files located at:
/home/luppy/.profile
/home/luppy/.bashrc
You can uninstall at any time with rustup self uninstall and
these changes will be reverted.
Current installation options:
default host triple: x86_64-unknown-linux-gnu
default toolchain: stable (default)
profile: default
modify PATH variable: yes
1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation
>
info: profile set to 'default'
info: default host triple is x86_64-unknown-linux-gnu
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2025-01-09, rust version 1.84.0 (9fc6b4312 2025-01-07)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
16.5 MiB / 16.5 MiB (100 %) 11.1 MiB/s in 1s ETA: 0s
info: downloading component 'rust-std'
29.0 MiB / 29.0 MiB (100 %) 10.8 MiB/s in 2s ETA: 0s
info: downloading component 'rustc'
70.6 MiB / 70.6 MiB (100 %) 13.6 MiB/s in 5s ETA: 0s
info: downloading component 'rustfmt'
info: installing component 'cargo'
8.8 MiB / 8.8 MiB (100 %) 7.1 MiB/s in 1s ETA: 0s
info: installing component 'clippy'
info: installing component 'rust-docs'
16.5 MiB / 16.5 MiB (100 %) 4.1 MiB/s in 4s ETA: 0s
info: installing component 'rust-std'
29.0 MiB / 29.0 MiB (100 %) 6.3 MiB/s in 4s ETA: 0s
info: installing component 'rustc'
70.6 MiB / 70.6 MiB (100 %) 8.1 MiB/s in 9s ETA: 0s
info: installing component 'rustfmt'
info: default toolchain set to 'stable-x86_64-unknown-linux-gnu'
stable-x86_64-unknown-linux-gnu installed - rustc 1.84.0 (9fc6b4312 2025-01-07)
Rust is installed now. Great!
To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
Cargo's bin directory ($HOME/.cargo/bin).
To configure your current shell, you need to source
the corresponding env file under $HOME/.cargo.
This is usually done by running one of the following (note the leading DOT):
. "$HOME/.cargo/env" # For sh/bash/zsh/ash/dash/pdksh
source "$HOME/.cargo/env.fish" # For fish
luppy@thinkstation:~$ . "$HOME/.cargo/env"
luppy@thinkstation:~$ rustup update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: checking for self-update
stable-x86_64-unknown-linux-gnu unchanged - rustc 1.84.0 (9fc6b4312 2025-01-07)
info: cleaning up downloads & tmp directories
luppy@thinkstation:~$ rustup toolchain install nightly
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: latest update on 2025-01-20, rust version 1.86.0-nightly (9a1d156f3 2025-01-19)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
info: downloading component 'rustc'
69.3 MiB / 69.3 MiB (100 %) 65.5 MiB/s in 15s ETA: 0s
info: downloading component 'rustfmt'
info: installing component 'cargo'
8.8 MiB / 8.8 MiB (100 %) 7.2 MiB/s in 1s ETA: 0s
info: installing component 'clippy'
info: installing component 'rust-docs'
18.2 MiB / 18.2 MiB (100 %) 4.1 MiB/s in 4s ETA: 0s
info: installing component 'rust-std'
26.8 MiB / 26.8 MiB (100 %) 6.4 MiB/s in 4s ETA: 0s
info: installing component 'rustc'
69.3 MiB / 69.3 MiB (100 %) 9.1 MiB/s in 14s ETA: 0s
2 IO-ops / 2 IO-ops (100 %) 1 IOPS in 1s ETA: 0s
info: installing component 'rustfmt'
nightly-x86_64-unknown-linux-gnu installed - rustc 1.86.0-nightly (9a1d156f3 2025-01-19)
info: checking for self-update
luppy@thinkstation:~$ rustup default nightly
info: using existing install for 'nightly-x86_64-unknown-linux-gnu'
info: default toolchain set to 'nightly-x86_64-unknown-linux-gnu'
nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.86.0-nightly (9a1d156f3 2025-01-19)
luppy@thinkstation:~$ rustc --version
rustc 1.86.0-nightly (9a1d156f3 2025-01-19)
luppy@thinkstation:~$ rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
info: downloading component 'rust-src'
info: installing component 'rust-src'
luppy@thinkstation:~$ mkdir rust
luppy@thinkstation:~$ cd rust
luppy@thinkstation:~/rust$ git clone https://github.com/apache/nuttx
Cloning into 'nuttx'...
remote: Enumerating objects: 839358, done.
remote: Counting objects: 100% (1347/1347), done.
remote: Compressing objects: 100% (345/345), done.
remote: Total 839358 (delta 1081), reused 1006 (delta 1000), pack-reused 838011 (from 2)
Receiving objects: 100% (839358/839358), 308.91 MiB | 10.88 MiB/s, done.
Resolving deltas: 100% (656313/656313), done.
Updating files: 100% (23812/23812), done.
luppy@thinkstation:~/rust$ git clone https://github.com/apache/nuttx-apps apps
Cloning into 'apps'...
remote: Enumerating objects: 94008, done.
remote: Counting objects: 100% (1582/1582), done.
remote: Compressing objects: 100% (591/591), done.
remote: Total 94008 (delta 1255), reused 991 (delta 991), pack-reused 92426 (from 4)
Receiving objects: 100% (94008/94008), 27.35 MiB | 14.50 MiB/s, done.
Resolving deltas: 100% (75041/75041), done.
luppy@thinkstation:~/rust$ cd nuttx
luppy@thinkstation:~/rust/nuttx$ git status && hash1=`git rev-parse HEAD`
pushd ../apps
git status && hash2=`git rev-parse HEAD`
popd
echo NuttX Source: https://github.com/apache/nuttx/tree/$hash1 >nuttx.hash
echo NuttX Apps: https://github.com/apache/nuttx-apps/tree/$hash2 >>nuttx.hash
cat nuttx.hash
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
~/rust/apps ~/rust/nuttx
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
~/rust/nuttx
NuttX Source: https://github.com/apache/nuttx/tree/4857ea211f069ba1d2602edc1f1946f2d2917c08
NuttX Apps: https://github.com/apache/nuttx-apps/tree/9b6de015bc69f3c30159a1b967db25fb5c59b8bc
luppy@thinkstation:~/rust/nuttx$ make distclean
NuttX has not been configured!
To configure the project:
tools/configure.sh <config>
For a list of available configurations:
tools/configure.sh -L
luppy@thinkstation:~/rust/nuttx$ tools/configure.sh rv-virt:leds64
Copy files
Select CONFIG_HOST_LINUX=y
Refreshing...
CP: arch/dummy/Kconfig to /home/luppy/rust/nuttx/arch/dummy/dummy_kconfig
CP: boards/dummy/Kconfig to /home/luppy/rust/nuttx/boards/dummy/dummy_kconfig
LN: platform/board to /home/luppy/rust/apps/platform/dummy
LN: include/arch to arch/risc-v/include
LN: include/arch/board to /home/luppy/rust/nuttx/boards/risc-v/qemu-rv/rv-virt/include
LN: drivers/platform to /home/luppy/rust/nuttx/drivers/dummy
LN: include/arch/chip to /home/luppy/rust/nuttx/arch/risc-v/include/qemu-rv
LN: arch/risc-v/src/chip to /home/luppy/rust/nuttx/arch/risc-v/src/qemu-rv
LN: arch/risc-v/src/board to /home/luppy/rust/nuttx/boards/risc-v/qemu-rv/rv-virt/src
mkkconfig in /home/luppy/rust/apps/audioutils
mkkconfig in /home/luppy/rust/apps/benchmarks
mkkconfig in /home/luppy/rust/apps/boot
mkkconfig in /home/luppy/rust/apps/canutils
mkkconfig in /home/luppy/rust/apps/crypto
mkkconfig in /home/luppy/rust/apps/database
mkkconfig in /home/luppy/rust/apps/examples/mcuboot
mkkconfig in /home/luppy/rust/apps/examples/module
mkkconfig in /home/luppy/rust/apps/examples/rust
mkkconfig in /home/luppy/rust/apps/examples/sotest
mkkconfig in /home/luppy/rust/apps/examples
mkkconfig in /home/luppy/rust/apps/fsutils
mkkconfig in /home/luppy/rust/apps/games
mkkconfig in /home/luppy/rust/apps/graphics
mkkconfig in /home/luppy/rust/apps/industry
mkkconfig in /home/luppy/rust/apps/inertial
mkkconfig in /home/luppy/rust/apps/interpreters/luamodules
mkkconfig in /home/luppy/rust/apps/interpreters
mkkconfig in /home/luppy/rust/apps/logging
mkkconfig in /home/luppy/rust/apps/lte
mkkconfig in /home/luppy/rust/apps/math
mkkconfig in /home/luppy/rust/apps/mlearning
mkkconfig in /home/luppy/rust/apps/netutils
mkkconfig in /home/luppy/rust/apps/sdr
mkkconfig in /home/luppy/rust/apps/system
mkkconfig in /home/luppy/rust/apps/testing
mkkconfig in /home/luppy/rust/apps/videoutils
mkkconfig in /home/luppy/rust/apps/wireless/bluetooth
mkkconfig in /home/luppy/rust/apps/wireless/ieee802154
mkkconfig in /home/luppy/rust/apps/wireless
mkkconfig in /home/luppy/rust/apps
#
# configuration written to .config
#
luppy@thinkstation:~/rust/nuttx$ grep STACK .config
CONFIG_ARCH_HAVE_STACKCHECK=y
CONFIG_STACK_COLORATION=y
# CONFIG_STACK_CANARIES is not set
# CONFIG_STACK_USAGE is not set
CONFIG_STACK_USAGE_WARNING=0
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARCH_STACKDUMP_MAX_LENGTH=0
CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
CONFIG_ARCH_INTERRUPTSTACK=2048
CONFIG_IRQ_WORK_STACKSIZE=2048
CONFIG_INIT_STACKSIZE=3072
CONFIG_SCHED_STACK_RECORD=0
CONFIG_BOARD_INITTHREAD_STACKSIZE=2048
CONFIG_DEFAULT_TASK_STACKSIZE=2048
CONFIG_IDLETHREAD_STACKSIZE=2048
CONFIG_PTHREAD_STACK_MIN=256
CONFIG_PTHREAD_STACK_DEFAULT=2048
CONFIG_ELF_STACKSIZE=2048
CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=2048
CONFIG_EXAMPLES_HELLO_STACKSIZE=2048
CONFIG_EXAMPLES_LEDS_STACKSIZE=2048
# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set
CONFIG_SYSTEM_NSH_STACKSIZE=3072
# CONFIG_SYSTEM_STACKMONITOR is not set
CONFIG_TESTING_GETPRIME_STACKSIZE=2048
CONFIG_TESTING_OSTEST_STACKSIZE=8192
CONFIG_TESTING_OSTEST_FPUSTACKSIZE=2048
luppy@thinkstation:~/rust/nuttx$ ## Disable CONFIG_ARCH_FPU
kconfig-tweak --disable CONFIG_ARCH_FPU
## Enable CONFIG_SYSTEM_TIME64 / CONFIG_FS_LARGEFILE / CONFIG_DEV_URANDOM / CONFIG_TLS_NELEM = 16
kconfig-tweak --enable CONFIG_SYSTEM_TIME64
kconfig-tweak --enable CONFIG_FS_LARGEFILE
kconfig-tweak --enable CONFIG_DEV_URANDOM
kconfig-tweak --set-val CONFIG_TLS_NELEM 16
## Enable Hello Rust Cargo App
kconfig-tweak --enable CONFIG_EXAMPLES_HELLO_RUST_CARGO
## For knsh64
kconfig-tweak --set-val CONFIG_EXAMPLES_HELLO_RUST_CARGO_STACKSIZE 8192
## Update the Kconfig Dependencies
make olddefconfig
CP: arch/dummy/Kconfig to /home/luppy/rust/nuttx/arch/dummy/dummy_kconfig
CP: boards/dummy/Kconfig to /home/luppy/rust/nuttx/boards/dummy/dummy_kconfig
LN: platform/board to /home/luppy/rust/apps/platform/dummy
LN: include/arch to arch/risc-v/include
LN: include/arch/board to /home/luppy/rust/nuttx/boards/risc-v/qemu-rv/rv-virt/include
LN: drivers/platform to /home/luppy/rust/nuttx/drivers/dummy
LN: include/arch/chip to /home/luppy/rust/nuttx/arch/risc-v/include/qemu-rv
LN: arch/risc-v/src/chip to /home/luppy/rust/nuttx/arch/risc-v/src/qemu-rv
LN: arch/risc-v/src/board to /home/luppy/rust/nuttx/boards/risc-v/qemu-rv/rv-virt/src
#
# configuration written to .config
#
luppy@thinkstation:~/rust/nuttx$ grep STACK .config
CONFIG_ARCH_HAVE_STACKCHECK=y
CONFIG_STACK_COLORATION=y
# CONFIG_STACK_CANARIES is not set
# CONFIG_STACK_USAGE is not set
CONFIG_STACK_USAGE_WARNING=0
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARCH_STACKDUMP_MAX_LENGTH=0
CONFIG_ARCH_HAVE_INTERRUPTSTACK=y
CONFIG_ARCH_INTERRUPTSTACK=2048
CONFIG_IRQ_WORK_STACKSIZE=2048
CONFIG_INIT_STACKSIZE=3072
CONFIG_SCHED_STACK_RECORD=0
CONFIG_BOARD_INITTHREAD_STACKSIZE=2048
CONFIG_DEFAULT_TASK_STACKSIZE=2048
CONFIG_IDLETHREAD_STACKSIZE=2048
CONFIG_PTHREAD_STACK_MIN=256
CONFIG_PTHREAD_STACK_DEFAULT=2048
CONFIG_ELF_STACKSIZE=2048
CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE=2048
CONFIG_EXAMPLES_HELLO_STACKSIZE=2048
CONFIG_EXAMPLES_LEDS_STACKSIZE=2048
CONFIG_EXAMPLES_HELLO_RUST_CARGO_STACKSIZE=8192
# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set
CONFIG_SYSTEM_NSH_STACKSIZE=3072
# CONFIG_SYSTEM_STACKMONITOR is not set
CONFIG_TESTING_GETPRIME_STACKSIZE=2048
CONFIG_TESTING_OSTEST_STACKSIZE=8192
luppy@thinkstation:~/rust/nuttx$ ## Remember to patch fs.rs
luppy@thinkstation:~/rust/nuttx$ vi $HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/pal/unix/fs.rs
luppy@thinkstation:~/rust/nuttx$ head -n 1049 $HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/pal/unix/fs.rs | tail -n 17
target_os = "vita",
target_os = "hurd",
)))]
fn name_cstr(&self) -> &CStr {
// Previously: unsafe { CStr::from_ptr(self.entry.d_name.as_ptr()) }
unsafe { CStr::from_ptr(self.entry.d_name.as_ptr() as *const u8) }
}
#[cfg(any(
target_os = "android",
target_os = "linux",
target_os = "solaris",
target_os = "illumos",
target_os = "fuchsia",
target_os = "redox",
target_os = "aix",
target_os = "nto",
target_os = "vita",
luppy@thinkstation:~/rust/nuttx$ make -j
Create version.h
CPP: nxfonts_convert.c-> nxfonts_convert_16bpp.i LN: platform/board to /home/luppy/rust/apps/platform/dummy
Updating crates.io index
Archive: fdt/dtc.zip
039a99414e778332d8f9c04cbd3072e1dcc62798
creating: fdt/dtc-1.7.0/
inflating: fdt/dtc-1.7.0/.cirrus.yml
inflating: fdt/dtc-1.7.0/.editorconfig
inflating: fdt/dtc-1.7.0/.gitignore
inflating: fdt/dtc-1.7.0/.travis.yml
inflating: fdt/dtc-1.7.0/BSD-2-Clause
inflating: fdt/dtc-1.7.0/CONTRIBUTING.md
creating: fdt/dtc-1.7.0/Documentation/
inflating: fdt/dtc-1.7.0/Documentation/dt-object-internal.txt
inflating: fdt/dtc-1.7.0/Documentation/dtc-paper.bib
inflating: fdt/dtc-1.7.0/Documentation/dtc-paper.tex
inflating: fdt/dtc-1.7.0/Documentation/dts-format.txt
inflating: fdt/dtc-1.7.0/Documentation/manual.txt
inflating: fdt/dtc-1.7.0/GPL
inflating: fdt/dtc-1.7.0/MANIFEST.in
inflating: fdt/dtc-1.7.0/Makefile
inflating: fdt/dtc-1.7.0/Makefile.convert-dtsv0
inflating: fdt/dtc-1.7.0/Makefile.dtc
inflating: fdt/dtc-1.7.0/Makefile.utils
inflating: fdt/dtc-1.7.0/README.license
inflating: fdt/dtc-1.7.0/README.md
inflating: fdt/dtc-1.7.0/TODO
inflating: fdt/dtc-1.7.0/checks.c
inflating: fdt/dtc-1.7.0/convert-dtsv0-lexer.l
inflating: fdt/dtc-1.7.0/data.c
inflating: fdt/dtc-1.7.0/dtc-lexer.l
inflating: fdt/dtc-1.7.0/dtc-parser.y
inflating: fdt/dtc-1.7.0/dtc.c
inflating: fdt/dtc-1.7.0/dtc.h
inflating: fdt/dtc-1.7.0/dtdiff
inflating: fdt/dtc-1.7.0/fdtdump.c
inflating: fdt/dtc-1.7.0/fdtget.c
inflating: fdt/dtc-1.7.0/fdtoverlay.c
inflating: fdt/dtc-1.7.0/fdtput.c
inflating: fdt/dtc-1.7.0/flattree.c
inflating: fdt/dtc-1.7.0/fstree.c
creating: fdt/dtc-1.7.0/libfdt/
extracting: fdt/dtc-1.7.0/libfdt/.gitignore
inflating: fdt/dtc-1.7.0/libfdt/Makefile.libfdt
inflating: fdt/dtc-1.7.0/libfdt/TODO
inflating: fdt/dtc-1.7.0/libfdt/fdt.c
inflating: fdt/dtc-1.7.0/libfdt/fdt.h
inflating: fdt/dtc-1.7.0/libfdt/fdt_addresses.c
inflating: fdt/dtc-1.7.0/libfdt/fdt_check.c
inflating: fdt/dtc-1.7.0/libfdt/fdt_empty_tree.c
inflating: fdt/dtc-1.7.0/libfdt/fdt_overlay.c
inflating: fdt/dtc-1.7.0/libfdt/fdt_ro.c
inflating: fdt/dtc-1.7.0/libfdt/fdt_rw.c
inflating: fdt/dtc-1.7.0/libfdt/fdt_strerror.c
inflating: fdt/dtc-1.7.0/libfdt/fdt_sw.c
inflating: fdt/dtc-1.7.0/libfdt/fdt_wip.c
inflating: fdt/dtc-1.7.0/libfdt/libfdt.h
inflating: fdt/dtc-1.7.0/libfdt/libfdt_env.h
inflating: fdt/dtc-1.7.0/libfdt/libfdt_internal.h
inflating: fdt/dtc-1.7.0/libfdt/meson.build
inflating: fdt/dtc-1.7.0/libfdt/version.lds
inflating: fdt/dtc-1.7.0/livetree.c
inflating: fdt/dtc-1.7.0/meson.build
inflating: fdt/dtc-1.7.0/meson_options.txt
creating: fdt/dtc-1.7.0/pylibfdt/
inflating: fdt/dtc-1.7.0/pylibfdt/.gitignore
inflating: fdt/dtc-1.7.0/pylibfdt/Makefile.pylibfdt
inflating: fdt/dtc-1.7.0/pylibfdt/libfdt.i
inflating: fdt/dtc-1.7.0/pylibfdt/meson.build
creating: fdt/dtc-1.7.0/scripts/
inflating: fdt/dtc-1.7.0/scripts/kup-dtc
inflating: fdt/dtc-1.7.0/scripts/setlocalversion
inflating: fdt/dtc-1.7.0/setup.py
inflating: fdt/dtc-1.7.0/srcpos.c
inflating: fdt/dtc-1.7.0/srcpos.h
creating: fdt/dtc-1.7.0/tests/
inflating: fdt/dtc-1.7.0/tests/.gitignore
inflating: fdt/dtc-1.7.0/tests/Makefile.tests
inflating: fdt/dtc-1.7.0/tests/add_subnode_with_nops.c
inflating: fdt/dtc-1.7.0/tests/addr_size_cells.c
inflating: fdt/dtc-1.7.0/tests/addr_size_cells2.c
inflating: fdt/dtc-1.7.0/tests/addresses.dts
inflating: fdt/dtc-1.7.0/tests/aliases.dts
inflating: fdt/dtc-1.7.0/tests/appendprop.dts
inflating: fdt/dtc-1.7.0/tests/appendprop1.c
inflating: fdt/dtc-1.7.0/tests/appendprop2.c
inflating: fdt/dtc-1.7.0/tests/appendprop_addrrange.c
inflating: fdt/dtc-1.7.0/tests/asm_tree_dump.c
inflating: fdt/dtc-1.7.0/tests/bad-chosen.dts
inflating: fdt/dtc-1.7.0/tests/bad-dma-ranges.dts
inflating: fdt/dtc-1.7.0/tests/bad-empty-ranges.dts
inflating: fdt/dtc-1.7.0/tests/bad-gpio.dts
inflating: fdt/dtc-1.7.0/tests/bad-graph.dts
inflating: fdt/dtc-1.7.0/tests/bad-interrupt-cells.dts
inflating: fdt/dtc-1.7.0/tests/bad-interrupt-controller.dts
inflating: fdt/dtc-1.7.0/tests/bad-interrupt-map-mask.dts
inflating: fdt/dtc-1.7.0/tests/bad-interrupt-map-parent.dts
inflating: fdt/dtc-1.7.0/tests/bad-interrupt-map.dts
inflating: fdt/dtc-1.7.0/tests/bad-name-property.dts
inflating: fdt/dtc-1.7.0/tests/bad-ncells.dts
extracting: fdt/dtc-1.7.0/tests/bad-octal-literal.dts
inflating: fdt/dtc-1.7.0/tests/bad-phandle-cells.dts
inflating: fdt/dtc-1.7.0/tests/bad-reg-ranges.dts
inflating: fdt/dtc-1.7.0/tests/bad-size-cells.dts
inflating: fdt/dtc-1.7.0/tests/bad-string-props.dts
inflating: fdt/dtc-1.7.0/tests/base01.asm
extracting: fdt/dtc-1.7.0/tests/base01.cmd
inflating: fdt/dtc-1.7.0/tests/base01.dts
inflating: fdt/dtc-1.7.0/tests/base01.stderr
inflating: fdt/dtc-1.7.0/tests/boot-cpuid.c
inflating: fdt/dtc-1.7.0/tests/boot-cpuid.dts
inflating: fdt/dtc-1.7.0/tests/cell-overflow-results.dts
inflating: fdt/dtc-1.7.0/tests/cell-overflow.dts
inflating: fdt/dtc-1.7.0/tests/char_literal.c
inflating: fdt/dtc-1.7.0/tests/char_literal.dts
inflating: fdt/dtc-1.7.0/tests/check_full.c
inflating: fdt/dtc-1.7.0/tests/check_header.c
inflating: fdt/dtc-1.7.0/tests/check_path.c
inflating: fdt/dtc-1.7.0/tests/comments-cmp.dts
inflating: fdt/dtc-1.7.0/tests/comments.dts
inflating: fdt/dtc-1.7.0/tests/data.S
inflating: fdt/dtc-1.7.0/tests/default-addr-size.dts
inflating: fdt/dtc-1.7.0/tests/del_node.c
inflating: fdt/dtc-1.7.0/tests/del_property.c
inflating: fdt/dtc-1.7.0/tests/delete_reinstate_multilabel.dts
inflating: fdt/dtc-1.7.0/tests/delete_reinstate_multilabel_ref.dts
inflating: fdt/dtc-1.7.0/tests/dependencies.cmp
inflating: fdt/dtc-1.7.0/tests/dependencies.dts
extracting: fdt/dtc-1.7.0/tests/deps_inc1.dtsi
extracting: fdt/dtc-1.7.0/tests/deps_inc2.dtsi
inflating: fdt/dtc-1.7.0/tests/division-by-zero.dts
inflating: fdt/dtc-1.7.0/tests/dtb_reverse.c
inflating: fdt/dtc-1.7.0/tests/dtbs_equal_ordered.c
inflating: fdt/dtc-1.7.0/tests/dtbs_equal_unordered.c
inflating: fdt/dtc-1.7.0/tests/dtc-checkfails.sh
inflating: fdt/dtc-1.7.0/tests/dtc-fails.sh
inflating: fdt/dtc-1.7.0/tests/dtc-fatal.sh
inflating: fdt/dtc-1.7.0/tests/dumptrees.c
inflating: fdt/dtc-1.7.0/tests/dup-nodename.dts
inflating: fdt/dtc-1.7.0/tests/dup-phandle.dts
inflating: fdt/dtc-1.7.0/tests/dup-propname.dts
inflating: fdt/dtc-1.7.0/tests/embedded_nul.dts
inflating: fdt/dtc-1.7.0/tests/embedded_nul_equiv.dts
extracting: fdt/dtc-1.7.0/tests/empty.dts
inflating: fdt/dtc-1.7.0/tests/escapes.dts
inflating: fdt/dtc-1.7.0/tests/extra-terminating-null.c
inflating: fdt/dtc-1.7.0/tests/extra-terminating-null.dts
inflating: fdt/dtc-1.7.0/tests/fdtdump-runtest.sh
inflating: fdt/dtc-1.7.0/tests/fdtdump.dts
inflating: fdt/dtc-1.7.0/tests/fdtget-runtest.sh
inflating: fdt/dtc-1.7.0/tests/fdtoverlay-runtest.sh
inflating: fdt/dtc-1.7.0/tests/fdtput-runtest.sh
inflating: fdt/dtc-1.7.0/tests/find_property.c
extracting: fdt/dtc-1.7.0/tests/fixup-ref-to-path.dts
inflating: fdt/dtc-1.7.0/tests/fs_tree1.c
inflating: fdt/dtc-1.7.0/tests/get_alias.c
inflating: fdt/dtc-1.7.0/tests/get_mem_rsv.c
inflating: fdt/dtc-1.7.0/tests/get_name.c
inflating: fdt/dtc-1.7.0/tests/get_next_tag_invalid_prop_len.c
inflating: fdt/dtc-1.7.0/tests/get_path.c
inflating: fdt/dtc-1.7.0/tests/get_phandle.c
inflating: fdt/dtc-1.7.0/tests/get_prop_offset.c
inflating: fdt/dtc-1.7.0/tests/getprop.c
inflating: fdt/dtc-1.7.0/tests/good-gpio.dts
extracting: fdt/dtc-1.7.0/tests/incbin.bin
inflating: fdt/dtc-1.7.0/tests/incbin.c
inflating: fdt/dtc-1.7.0/tests/incbin.dts
inflating: fdt/dtc-1.7.0/tests/include0.dts
inflating: fdt/dtc-1.7.0/tests/include1.dts
inflating: fdt/dtc-1.7.0/tests/include2.dts
extracting: fdt/dtc-1.7.0/tests/include3.dts
extracting: fdt/dtc-1.7.0/tests/include4.dts
extracting: fdt/dtc-1.7.0/tests/include5.dts
extracting: fdt/dtc-1.7.0/tests/include5a.dts
extracting: fdt/dtc-1.7.0/tests/include6.dts
inflating: fdt/dtc-1.7.0/tests/include7.dts
extracting: fdt/dtc-1.7.0/tests/include8.dts
inflating: fdt/dtc-1.7.0/tests/integer-expressions.c
inflating: fdt/dtc-1.7.0/tests/label01.dts
inflating: fdt/dtc-1.7.0/tests/label_repeated.dts
inflating: fdt/dtc-1.7.0/tests/line_directives.dts
inflating: fdt/dtc-1.7.0/tests/lorem.txt
inflating: fdt/dtc-1.7.0/tests/mangle-layout.c
inflating: fdt/dtc-1.7.0/tests/meson.build
inflating: fdt/dtc-1.7.0/tests/minusone-phandle.dts
inflating: fdt/dtc-1.7.0/tests/move_and_save.c
inflating: fdt/dtc-1.7.0/tests/multilabel.dts
inflating: fdt/dtc-1.7.0/tests/multilabel_merge.dts
inflating: fdt/dtc-1.7.0/tests/node_check_compatible.c
inflating: fdt/dtc-1.7.0/tests/node_offset_by_compatible.c
inflating: fdt/dtc-1.7.0/tests/node_offset_by_phandle.c
inflating: fdt/dtc-1.7.0/tests/node_offset_by_prop_value.c
inflating: fdt/dtc-1.7.0/tests/nonexist-label-ref.dts
inflating: fdt/dtc-1.7.0/tests/nonexist-node-ref.dts
inflating: fdt/dtc-1.7.0/tests/nonexist-node-ref2.dts
inflating: fdt/dtc-1.7.0/tests/nop_node.c
inflating: fdt/dtc-1.7.0/tests/nop_property.c
inflating: fdt/dtc-1.7.0/tests/nopulate.c
inflating: fdt/dtc-1.7.0/tests/notfound.c
inflating: fdt/dtc-1.7.0/tests/nul-in-escape.dts
extracting: fdt/dtc-1.7.0/tests/nul-in-line-info1.dts
extracting: fdt/dtc-1.7.0/tests/nul-in-line-info2.dts
inflating: fdt/dtc-1.7.0/tests/obsolete-chosen-interrupt-controller.dts
inflating: fdt/dtc-1.7.0/tests/omit-no-ref.dts
inflating: fdt/dtc-1.7.0/tests/open_pack.c
inflating: fdt/dtc-1.7.0/tests/overlay.c
inflating: fdt/dtc-1.7.0/tests/overlay_bad_fixup.c
inflating: fdt/dtc-1.7.0/tests/overlay_bad_fixup_bad_index.dts
inflating: fdt/dtc-1.7.0/tests/overlay_bad_fixup_base.dtsi
inflating: fdt/dtc-1.7.0/tests/overlay_bad_fixup_empty.dts
inflating: fdt/dtc-1.7.0/tests/overlay_bad_fixup_empty_index.dts
inflating: fdt/dtc-1.7.0/tests/overlay_bad_fixup_index_trailing.dts
inflating: fdt/dtc-1.7.0/tests/overlay_bad_fixup_path_empty_prop.dts
inflating: fdt/dtc-1.7.0/tests/overlay_bad_fixup_path_only.dts
inflating: fdt/dtc-1.7.0/tests/overlay_bad_fixup_path_only_sep.dts
inflating: fdt/dtc-1.7.0/tests/overlay_bad_fixup_path_prop.dts
inflating: fdt/dtc-1.7.0/tests/overlay_base.dts
inflating: fdt/dtc-1.7.0/tests/overlay_base_manual_symbols.dts
inflating: fdt/dtc-1.7.0/tests/overlay_overlay.dts
inflating: fdt/dtc-1.7.0/tests/overlay_overlay_bypath.dts
inflating: fdt/dtc-1.7.0/tests/overlay_overlay_local_merge.dts
inflating: fdt/dtc-1.7.0/tests/overlay_overlay_long_path.dts
inflating: fdt/dtc-1.7.0/tests/overlay_overlay_manual_fixups.dts
inflating: fdt/dtc-1.7.0/tests/overlay_overlay_no_fixups.dts
inflating: fdt/dtc-1.7.0/tests/overlay_overlay_nosugar.dts
inflating: fdt/dtc-1.7.0/tests/overlay_overlay_simple.dts
inflating: fdt/dtc-1.7.0/tests/parent_offset.c
inflating: fdt/dtc-1.7.0/tests/path-references.c
inflating: fdt/dtc-1.7.0/tests/path-references.dts
inflating: fdt/dtc-1.7.0/tests/path_offset.c
inflating: fdt/dtc-1.7.0/tests/path_offset_aliases.c
inflating: fdt/dtc-1.7.0/tests/pci-bridge-bad1.dts
inflating: fdt/dtc-1.7.0/tests/pci-bridge-bad2.dts
inflating: fdt/dtc-1.7.0/tests/pci-bridge-ok.dts
inflating: fdt/dtc-1.7.0/tests/phandle-args-overflow.dts
inflating: fdt/dtc-1.7.0/tests/phandle_format.c
inflating: fdt/dtc-1.7.0/tests/prop-after-subnode.dts
inflating: fdt/dtc-1.7.0/tests/property_iterate.c
inflating: fdt/dtc-1.7.0/tests/property_iterate.dts
inflating: fdt/dtc-1.7.0/tests/propname_escapes.c
inflating: fdt/dtc-1.7.0/tests/propname_escapes.dts
inflating: fdt/dtc-1.7.0/tests/pylibfdt_tests.py
inflating: fdt/dtc-1.7.0/tests/references.c
inflating: fdt/dtc-1.7.0/tests/references.dts
inflating: fdt/dtc-1.7.0/tests/reg-ranges-root.dts
inflating: fdt/dtc-1.7.0/tests/reg-without-unit-addr.dts
inflating: fdt/dtc-1.7.0/tests/relref_merge.c
inflating: fdt/dtc-1.7.0/tests/relref_merge.dts
inflating: fdt/dtc-1.7.0/tests/reuse-label.dts
inflating: fdt/dtc-1.7.0/tests/reuse-label1.dts
inflating: fdt/dtc-1.7.0/tests/reuse-label2.dts
inflating: fdt/dtc-1.7.0/tests/reuse-label3.dts
inflating: fdt/dtc-1.7.0/tests/reuse-label4.dts
inflating: fdt/dtc-1.7.0/tests/reuse-label5.dts
inflating: fdt/dtc-1.7.0/tests/reuse-label6.dts
inflating: fdt/dtc-1.7.0/tests/root_node.c
inflating: fdt/dtc-1.7.0/tests/run_tests.sh
inflating: fdt/dtc-1.7.0/tests/rw_oom.c
inflating: fdt/dtc-1.7.0/tests/rw_tree1.c
creating: fdt/dtc-1.7.0/tests/search_dir/
extracting: fdt/dtc-1.7.0/tests/search_dir/search_test.dtsi
extracting: fdt/dtc-1.7.0/tests/search_dir/search_test2.dtsi
creating: fdt/dtc-1.7.0/tests/search_dir_b/
extracting: fdt/dtc-1.7.0/tests/search_dir_b/search_paths_subdir.dts
extracting: fdt/dtc-1.7.0/tests/search_dir_b/search_test_b.dtsi
extracting: fdt/dtc-1.7.0/tests/search_dir_b/search_test_b2.dtsi
extracting: fdt/dtc-1.7.0/tests/search_dir_b/search_test_c.dtsi
extracting: fdt/dtc-1.7.0/tests/search_paths.dts
extracting: fdt/dtc-1.7.0/tests/search_paths_b.dts
inflating: fdt/dtc-1.7.0/tests/set_name.c
inflating: fdt/dtc-1.7.0/tests/setprop.c
inflating: fdt/dtc-1.7.0/tests/setprop_inplace.c
inflating: fdt/dtc-1.7.0/tests/sized_cells.c
inflating: fdt/dtc-1.7.0/tests/sized_cells.dts
inflating: fdt/dtc-1.7.0/tests/sourceoutput.dts
inflating: fdt/dtc-1.7.0/tests/stacked_overlay_addlabel.dts
inflating: fdt/dtc-1.7.0/tests/stacked_overlay_bar.dts
inflating: fdt/dtc-1.7.0/tests/stacked_overlay_base.dts
inflating: fdt/dtc-1.7.0/tests/stacked_overlay_base_nolabel.dts
inflating: fdt/dtc-1.7.0/tests/stacked_overlay_baz.dts
inflating: fdt/dtc-1.7.0/tests/string_escapes.c
inflating: fdt/dtc-1.7.0/tests/stringlist.c
inflating: fdt/dtc-1.7.0/tests/stringlist.dts
inflating: fdt/dtc-1.7.0/tests/subnode_iterate.c
inflating: fdt/dtc-1.7.0/tests/subnode_iterate.dts
inflating: fdt/dtc-1.7.0/tests/subnode_offset.c
inflating: fdt/dtc-1.7.0/tests/supernode_atdepth_offset.c
inflating: fdt/dtc-1.7.0/tests/sw_states.c
inflating: fdt/dtc-1.7.0/tests/sw_tree1.c
inflating: fdt/dtc-1.7.0/tests/test01.asm
inflating: fdt/dtc-1.7.0/tests/test01.dts
inflating: fdt/dtc-1.7.0/tests/test01.stderr
inflating: fdt/dtc-1.7.0/tests/test_kernel_dts
inflating: fdt/dtc-1.7.0/tests/test_label_ref.dts
inflating: fdt/dtc-1.7.0/tests/test_props.dts
inflating: fdt/dtc-1.7.0/tests/test_tree1.dts
inflating: fdt/dtc-1.7.0/tests/test_tree1_delete.dts
inflating: fdt/dtc-1.7.0/tests/test_tree1_label_noderef.dts
inflating: fdt/dtc-1.7.0/tests/test_tree1_merge.dts
inflating: fdt/dtc-1.7.0/tests/test_tree1_merge_labelled.dts
inflating: fdt/dtc-1.7.0/tests/test_tree1_merge_path.dts
inflating: fdt/dtc-1.7.0/tests/test_tree1_wrong1.dts
inflating: fdt/dtc-1.7.0/tests/test_tree1_wrong2.dts
inflating: fdt/dtc-1.7.0/tests/test_tree1_wrong3.dts
inflating: fdt/dtc-1.7.0/tests/test_tree1_wrong4.dts
inflating: fdt/dtc-1.7.0/tests/test_tree1_wrong5.dts
inflating: fdt/dtc-1.7.0/tests/test_tree1_wrong6.dts
inflating: fdt/dtc-1.7.0/tests/test_tree1_wrong7.dts
inflating: fdt/dtc-1.7.0/tests/test_tree1_wrong8.dts
inflating: fdt/dtc-1.7.0/tests/test_tree1_wrong9.dts
inflating: fdt/dtc-1.7.0/tests/testdata.h
inflating: fdt/dtc-1.7.0/tests/tests.h
inflating: fdt/dtc-1.7.0/tests/testutils.c
inflating: fdt/dtc-1.7.0/tests/testutils.sh
inflating: fdt/dtc-1.7.0/tests/trees.S
inflating: fdt/dtc-1.7.0/tests/truncated_memrsv.c
inflating: fdt/dtc-1.7.0/tests/truncated_property.c
inflating: fdt/dtc-1.7.0/tests/truncated_string.c
inflating: fdt/dtc-1.7.0/tests/type-preservation.dt.yaml
inflating: fdt/dtc-1.7.0/tests/type-preservation.dts
inflating: fdt/dtc-1.7.0/tests/unit-addr-leading-0s.dts
inflating: fdt/dtc-1.7.0/tests/unit-addr-leading-0x.dts
inflating: fdt/dtc-1.7.0/tests/unit-addr-simple-bus-compatible.dts
inflating: fdt/dtc-1.7.0/tests/unit-addr-simple-bus-reg-mismatch.dts
inflating: fdt/dtc-1.7.0/tests/unit-addr-unique.dts
inflating: fdt/dtc-1.7.0/tests/unit-addr-without-reg.dts
inflating: fdt/dtc-1.7.0/tests/utilfdt_test.c
inflating: fdt/dtc-1.7.0/tests/value-labels.c
inflating: fdt/dtc-1.7.0/tests/value-labels.dts
inflating: fdt/dtc-1.7.0/tests/zero-phandle.dts
inflating: fdt/dtc-1.7.0/treesource.c
inflating: fdt/dtc-1.7.0/util.c
inflating: fdt/dtc-1.7.0/util.h
extracting: fdt/dtc-1.7.0/version_gen.h.in
inflating: fdt/dtc-1.7.0/yamltree.c
Locking 30 packages to latest compatible versions
Downloaded itoa v1.0.14
Downloaded quote v1.0.38
Downloaded unicode-ident v1.0.14
Downloaded proc-macro2 v1.0.93
Downloaded serde_derive v1.0.217
Downloaded ryu v1.0.18
Downloaded serde v1.0.217
Downloaded memchr v2.7.4
Downloaded pin-project-lite v0.2.16
Downloaded serde_json v1.0.137
Downloaded syn v2.0.96
Downloaded tokio v1.43.0
Downloaded 12 crates (1.7 MB) in 0.32s
Updating crates.io index
Downloaded cfg-if v1.0.0
Downloaded getopts v0.2.21
Downloaded adler2 v2.0.0
Downloaded rustc-demangle v0.1.24
Downloaded allocator-api2 v0.2.21
Downloaded addr2line v0.24.2
Downloaded miniz_oxide v0.8.3
Downloaded hashbrown v0.15.2
Downloaded compiler_builtins v0.1.143
Downloaded gimli v0.31.1
Downloaded unicode-width v0.1.14
Downloaded object v0.36.7
Downloaded libc v0.2.169
Downloaded 13 crates (2.2 MB) in 0.31s
Compiling compiler_builtins v0.1.143
Compiling core v0.0.0 (/home/luppy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
Compiling libc v0.2.169
Compiling object v0.36.7
Compiling std v0.0.0 (/home/luppy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std)
Compiling proc-macro2 v1.0.93
Compiling unicode-ident v1.0.14
Compiling serde v1.0.217
Compiling serde_json v1.0.137
Compiling quote v1.0.38
Compiling syn v2.0.96
Compiling serde_derive v1.0.217
Compiling rustc-std-workspace-core v1.99.0 (/home/luppy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
Compiling alloc v0.0.0 (/home/luppy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc)
Compiling cfg-if v1.0.0
Compiling adler2 v2.0.0
Compiling memchr v2.7.4
Compiling rustc-demangle v0.1.24
Compiling unwind v0.0.0 (/home/luppy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/unwind)
Compiling rustc-std-workspace-alloc v1.99.0 (/home/luppy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-alloc)
Compiling panic_unwind v0.0.0 (/home/luppy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/panic_unwind)
Compiling panic_abort v0.0.0 (/home/luppy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/panic_abort)
Compiling gimli v0.31.1
Compiling std_detect v0.1.5 (/home/luppy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/stdarch/crates/std_detect)
Compiling hashbrown v0.15.2
Compiling miniz_oxide v0.8.3
Compiling addr2line v0.24.2
Compiling proc_macro v0.0.0 (/home/luppy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro)
Compiling ryu v1.0.18
Compiling itoa v1.0.14
Compiling pin-project-lite v0.2.16
Compiling tokio v1.43.0
Compiling hello v0.1.0 (/home/luppy/rust/apps/examples/rust/hello)
Finished `release` profile [optimized] target(s) in 54.18s
Register: leds
Register: hello_rust_cargo
Register: nsh
Register: sh
Register: ostest
Register: getprime
Register: hello
CPP: /home/luppy/rust/nuttx/boards/risc-v/qemu-rv/rv-virt/scripts/ld.script-LD: nuttx
riscv-none-elf-ld: warning: /home/luppy/rust/nuttx/nuttx has a LOAD segment with RWX permissions
Memory region Used Size Region Size %age Used
luppy@thinkstation:~/rust/nuttx$ qemu-system-riscv64 \
-semihosting \
-M virt,aclint=on \
-cpu rv64 \
-bios none \
-kernel nuttx \
-nographic
ABCboard_userled: LED 1 set to 0
board_userled: LED 2 set to 0
board_userled: LED 3 set to 0
NuttShell (NSH) NuttX-12.8.0
nsh> uname -a
NuttX 12.8.0 4857ea211f Jan 20 2025 11:06:33 risc-v rv-virt
nsh> hello
Hello, World!!
nsh> hello_rust_cargo
{"name":"John","age":30}
{"name":"Jane","age":25}
Deserialized: Alice is 28 years old
Pretty JSON:
{
"name": "Alice",
"age": 28
}
Hello world from tokio!
QEMU: Terminated
luppy@thinkstation:~/rust/nuttx$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment