Giter Site home page Giter Site logo

nihalpasham / rustboot Goto Github PK

View Code? Open in Web Editor NEW
184.0 11.0 20.0 167.3 MB

rustBoot is a standalone bootloader written entirely in `Rust`, designed to run on anything from a microcontroller to a system on chip. It can be used to boot into bare-metal firmware or Linux.

License: MIT License

Rust 98.72% C 0.05% Assembly 0.99% RPC 0.24%
cortex-a cortex-m embedded firmware microcontroller rust bootloaders security

rustboot's Introduction

GitHub ci chat

rustBoot

rustBoot is a standalone bootloader, written entirely in Rust, designed to run on anything from a microcontroller to a system on chip. It can be used to boot into bare-metal firmware or Linux.

rustBoot

Why rustBoot?

rustBoot aims to offer an OS and micro-architecture agnostic (i.e. highly portable) secure bootloader which is standards-compatible and easy to integrate into existing embedded software projects.

What is rustBoot

Features currently supported:

  • support for ARM Cortex-M, Cortex-A micro-architectures
  • support for multi-slot partitioning of microcontroller flash memory. This allows us to implement the boot/update approach for bare-metal firmware updates.
  • support for Aarch64 linux booting
  • elliptic curve cryptography for integrity and authenticity verification using RustCrypto crates
  • a tiny hardware abstraction layer for non-volatile memory (i.e. flash) access.
  • anti-rollback protection via version numbering.
  • a fully memory safe core-bootloader implementation with safe parsers and firmware-update logic.
  • power-interruptible firmware updates along with the assurance of fall-back availability.
  • a signing utility to sign bare-metal firmware and fit-image(s), written in pure rust.

Features planned:

  • support for external flash devices (ex: SPI flash) and serial/console logging interfaces.
  • support for ARM TrustZone-M and A and certified secure hardware elements - microchip ATECC608a, NXP SE050, STSAFE-100
  • support for secure, distributed and efficient firmware transport over ipfs.

Documentation:

You can read the book for free online..

Note: rustBoot and the book are still in development (i.e. a work in progress).

Acknowledgment:

rustBoot exists as we could not find a suitable (open-source) option that meets our security goals. It is the result of an exhaustive evaluation of 'pretty much' the entire embedded-bootloader landscape.

Having said that, it does take inspiration from similar projects (such as u-boot, zephyr, mcuboot, coreboot, wolfBoot etc). However, the key differentiator is security-above-all-else. To that extent, its built entirely in rust, takes full advantage of rust's memory safety guarantees while leveraging safer parsing libraries, compile-time state-transition checks coupled with (safe) community sourced rust-crates (such as boards, HALs drivers etc.)

Support:

For questions, issues, feature requests, and other changes, please file an issue in the github project.

License:

rustBoot is licensed under

Contributing:

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the MIT license, shall be licensed as above, without any additional terms or conditions.

rustboot's People

Contributors

abhishekdhamale avatar imrank03 avatar lionelains avatar nihalpasham avatar sarath3192 avatar strange21 avatar udayakumarhidakal avatar yashwanthsinghm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rustboot's Issues

Install cargo install cargo-binutils failed

Dear Nihal,

I have an issue related to installing cargo-binutils .

Following you document, Cargo-binutils is necessary for developing rustboot.

When I run command:
cargo install cargo-binutils

the issues happen as below:

Updating crates.io index
 Downloaded cargo-binutils v0.3.4
 Downloaded 1 crate (25.0 KB) in 0.82s
 Installing cargo-binutils v0.3.4
 Downloaded adler v1.0.2
 Downloaded cfg-if v1.0.0
 Downloaded failure v0.1.8
 Downloaded cargo_metadata v0.11.4
 Downloaded itoa v1.0.1
 Downloaded memchr v2.4.1
 Downloaded cc v1.0.72
 Downloaded failure_derive v0.1.8
 Downloaded miniz_oxide v0.4.4
 Downloaded object v0.27.1
 Downloaded quote v1.0.14
 Downloaded proc-macro2 v1.0.36
 Downloaded regex v1.5.4
 Downloaded rustc-demangle v0.1.21
 Downloaded serde v1.0.133
 Downloaded semver v0.10.0
 Downloaded synstructure v0.12.6
 Downloaded toml v0.5.8
 Downloaded unicode-width v0.1.9
 Downloaded libc v0.2.112
 Downloaded semver-parser v0.7.0
 Downloaded unicode-xid v0.2.2
 Downloaded rustc-cfg v0.4.0
 Downloaded addr2line v0.17.0
 Downloaded syn v1.0.85
 Downloaded bitflags v1.3.2
 Downloaded autocfg v1.0.1
 Downloaded atty v0.2.14
 Downloaded aho-corasick v0.7.18
 Downloaded serde_json v1.0.74
 Downloaded vec_map v0.8.2
 Downloaded anyhow v1.0.52
 Downloaded ansi_term v0.12.1
 Downloaded backtrace v0.3.63
 Downloaded rustc_version v0.2.3
 Downloaded clap v2.34.0
 Downloaded gimli v0.26.1
 Downloaded regex-syntax v0.6.25
 Downloaded textwrap v0.11.0
 Downloaded serde_derive v1.0.133
 Downloaded strsim v0.8.0
 Downloaded semver v0.9.0
 Downloaded ryu v1.0.9
 Downloaded 43 crates (3.7 MB) in 1.09s
  Compiling proc-macro2 v1.0.36
  Compiling unicode-xid v0.2.2
  Compiling syn v1.0.85
  Compiling memchr v2.4.1
  Compiling libc v0.2.112
  Compiling serde_derive v1.0.133
  Compiling autocfg v1.0.1
  Compiling serde v1.0.133
  Compiling cc v1.0.72
error: linker `cc` not found
 |
 = note: No such file or directory (os error 2)

error: could not compile `serde` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-binutils v0.3.4`, intermediate artifacts can be found at `/tmp/cargo-install5CVCfB`

Caused by:
 build failed

Could you support me fix this issue.

Thanks,

Best regards,

Dinh Thanh Viet

Rust based driver development for secure element STSAFE-A100

STSAFE-A100
The STSAFE-A100 is a highly secure solution that acts as a secure element providing
authentication and data management services to a local or remote host.

Features

  1. Authentication .
  2. Secure channel establishment with remote host including transport layer security (TLS) handshake.
  3. Signature verification service (secure boot and firmware upgrade).
  4. Usage monitoring with secure counters Pairing and secure channel with host application processor.
  5. Wrapping and unwrapping of local or remote host envelopes.
  6. On-chip key pair generation.

sub-tasks

  • I2C driver for STSAFE-A100 crypto authentication HW .
  • A method for sending commands to the STSAFE-A100 and retrieving the associated response.
  • rustBoot demonstration with secure element.

Note:
Communication between the host and STSAFE-A100 will be through I²C-bus slave interface with 7 bit addressing mode up to 400kbps transmission speed.

Add a rust-based flash driver for 'STM32L562E-DK' board

In order to port rustBoot to the STM32L562E-DK board, we'll need to implement a flash-driver written in rust.

Sub-tasks:

  • The flash driver should support lock and unlock flash operations.
  • The flash driver must read, write and erase data-blocks from the device's internal flash memory.
  • Finally, it must implement rustBoot's FlashInterface trait.

Additional notes:

You only need to implement the methods (of FlashInterface trait), applicable to your board.

Where are Peripherals, NVMC object placed ?

Dear Nihal,
I am walking through class FlashWriterEraser in nrf52840.rs which should be refer for implementing a HAL of another board
I see there are 2 class Peripherals, NVMC (Non Volatile Memory Controller) which are not presented in the source dir.
So I guess these classes were generated from nrf52840.svd, right ?
if yes, kindly show me:
What tool is used to generate these class?
Where are generated classes placed ?

Thank you.
Viet

Add a rust-based secure element "NXP SE050" driver for ARM TrustZone-M and A

Need to implement a secure element NXP SE050 driver with support for ARM TrustZone-M.

Sub-tasks:

  • I2C driver for NXP's crypto authentication HW (i.e. secure element NXP SE050).
  • A method for sending commands to the NXP SE050 and retrieving the associated response.
  • rustBoot demonstration with secure element.
  • ARM TrustZone-M

Add a rust-based flash driver for STM32F334 dev-board

In order to port rustBoot to the STM32F334 board, we'll need to implement a flash-driver written in rust.

Sub-tasks:

  • The flash driver should support lock and unlock flash operations.
  • The flash driver must read, write and erase data-blocks from the device's internal flash memory.
  • Finally, it must implement rustBoot's FlashInterface trait.

Additional notes:

  • You only need to implement the methods (of FlashInterface trait), applicable to your board.

Add rust-based flash driver for the "STM32F746ZG" board

In order to port rustBoot to the STM32F746ZG board, we'll need to implement a flash-driver written in rust.

Sub-tasks:

  • The flash driver should support lock and unlock flash operations.
  • The flash driver must write and erase data-blocks from the device's internal flash memory.
  • Finally, it must implement rustBoot's FlashInterface trait.

Additional notes:

  • You only need to implement the methods (of FlashInterface trait), applicable to your board.

imports wolfcrypt libraries

Dear Nihal

Currently, I have an issue related to wolfcrypt libraries when I compile Rustboot on native ubuntu.

home@home:~/Prj_Security/SourceCode/rustBoot-main/rustBoot$ rustup override set nightly
info: using existing install for 'nightly-x86_64-unknown-linux-gnu'
info: override toolchain for '/home/home/Prj_Security/SourceCode/rustBoot-main/rustBoot' set to 'nightly-x86_64-unknown-linux-gnu'
nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.59.0-nightly (f8abed9ed 2021-12-26)
home@home:~/Prj_Security/SourceCode/rustBoot-main/rustBoot$ cargo xtask build-sign-flash rustBoot nrf52840
Finished dev [unoptimized + debuginfo] target(s) in 1.07s
Running `/home/home/Prj_Security/SourceCode/rustBoot-main/target/debug/xtask build-sign-flash rustBoot nrf52840`
$ cargo build --release
    Finished release [optimized + debuginfo] target(s) in 0.74s
$ cargo build --release
    Finished release [optimized + debuginfo] target(s) in 0.04s
$ cargo build --release
    Finished release [optimized + debuginfo] target(s) in 0.08s
$ python3 convert2bin.py
$ python3 signer.py
Traceback (most recent call last):
File "sign.py", line 28, in <module>
from wolfcrypt import ciphers, hashes
ModuleNotFoundError: No module named 'wolfcrypt'
Traceback (most recent call last):
File "sign.py", line 28, in <module>
 from wolfcrypt import ciphers, hashes
ModuleNotFoundError: No module named 'wolfcrypt'
$ pyocd erase -t nrf52 --mass-erase
usage: pyocd [-h] [-V] [--help-options]  ...
pyocd: error: unrecognized arguments: --mass-erase
Error: command `pyocd erase -t nrf52 --mass-erase` failed, exit status: 2

As your recommendation in previous topic, I try to install wolfCrypt with below command
pip install wolfcrypt
but issue occurs as below

home@home:~/Prj_Security/SourceCode/rustBoot-main/rustBoot$ pip install wolfcrypt
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: wolfcrypt in /home/home/.local/lib/python3.6/site-packages (4.1.0.post0)
Requirement already satisfied: cffi in /home/home/.local/lib/python3.6/site-packages (from wolfcrypt) (1.15.0)
Requirement already satisfied: pycparser in /home/home/.local/lib/python3.6/site-packages (from cffi->wolfcrypt) (2.21)

I try to work around with another command
https://github.com/wolfSSL/wolfBoot/blob/master/docs/Signing.md#install-python3

git clone https://github.com/wolfSSL/wolfssl.git
cd wolfssl
./configure --enable-keygen --enable-rsa --enable-ecc --enable-ed25519 --enable-ed448 --enable-des3 CFLAGS="-DWOLFSSL_PUBLIC_MP"
sudo make install

and issue occurs as below

home@home:~/Prj_Security/SourceCode/rustBoot-main/rustBoot/wolfssl$ ./configure --enable-keygen --enable-rsa --enable-ecc --enable-ed25519 --enable-ed448 --enable-des3 CFLAGS="-DWOLFSSL_PUBLIC_MP"
bash: ./configure: No such file or directory
home@home:~/Prj_Security/SourceCode/rustBoot-main/rustBoot/wolfssl$ ls
async-check.sh   examples              m4                  scripts             wolfcrypt
AUTHORS          fips-check.sh         Makefile.am         SCRIPTS-LIST        wolfssl
autogen.sh       fips-hash.sh          mcapi               src                 wolfssl64.sln
certs            gencertbuf.pl         mplabx              sslSniffer          wolfssl.rc
ChangeLog.md     IDE                   mqx                 stamp-h.in          wolfssl.sln
cmake            input                 pre-commit.sh       support             wolfssl.vcproj
CMakeLists.txt   INSTALL               pre-push.sh         tests               wolfssl.vcxproj
commit-tests.sh  IPP                   pull_to_vagrant.sh  testsuite           wrapper
configure.ac     lib                   quit                tirtos              zephyr
COPYING          LICENSING             README              Vagrantfile
ctaocrypt        linuxkm               README.md           valgrind-bash.supp
cyassl           LPCExpresso.cproject  resource.h          valgrind-error.sh
doc              LPCExpresso.project   rpm                 wnr-example.conf

Could you please support me fix issue related to wolfcrypt libraries

Thank you

No available debug probes are connected

Dear Nihal

I have an issue related to pyocd driver for nrf52840 kit purchased on market (https://infocenter.nordicsemi.com/pdf/nRF52840_DK_User_Guide_v1.2.pdf)

I install pyocd driver and usb library on native ubuntu 18.4 and I can detect pyocd version and SEGGER device

home@home:~/Prj_Security/SourceCode/rustBoot-main$ pyocd --version
0.30.4.dev253
home@home:~/Prj_Security/SourceCode/rustBoot-main$ lsusb
Bus 002 Device 003: ID 1366:1015 SEGGER
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 17ef:6044 Lenovo
Bus 001 Device 003: ID 138a:003c Validity Sensors, Inc. VFS471 Fingerprint Reader
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
home@home:~/Prj_Security/SourceCode/rustBoot-main$

but when I compile Rustboot, It seems that there are no available debug probes are connected

home@home:~/Prj_Security/SourceCode/rustBoot-main$ pyocd list
**No available debug probes are connected**
home@home:~/Prj_Security/SourceCode/rustBoot-main$ rustup override set nightly

info: using existing install for 'nightly-x86_64-unknown-linux-gnu'
info: override toolchain for '/home/home/Prj_Security/SourceCode/rustBoot-main' set to 'nightly-x86_64-unknown-linux-gnu'
nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.59.0-nightly (f8abed9ed 2021-12-26)
home@home:~/Prj_Security/SourceCode/rustBoot-main$ cargo xtask build-sign-flash rustBoot nrf52840
Finished dev [unoptimized + debuginfo] target(s) in 0.90s
Running `target/debug/xtask build-sign-flash rustBoot nrf52840`
$ cargo build --release
    Finished release [optimized + debuginfo] target(s) in 0.59s
$ cargo build --release
    Finished release [optimized + debuginfo] target(s) in 0.04s
$ cargo build --release
    Finished release [optimized + debuginfo] target(s) in 0.08s
$ python3 convert2bin.py
$ python3 signer.py
Traceback (most recent call last):
  File "sign.py", line 28, in <module>
    from wolfcrypt import ciphers, hashes
ModuleNotFoundError: No module named 'wolfcrypt'
Traceback (most recent call last):
  File "sign.py", line 28, in <module>
    from wolfcrypt import ciphers, hashes
ModuleNotFoundError: No module named 'wolfcrypt'
$ pyocd erase -t nrf52 --mass
Waiting for a debug probe to be connected...

I hope that Rustboot can support below nrf52840 development kit (https://infocenter.nordicsemi.com/pdf/nRF52840_DK_User_Guide_v1.2.pdf)

If you have any solutions, please give me advice.

Add rust-based flash driver for the "STM32H723ZG" board

In order to port rustBoot to the STM32H723ZG board, we'll need to implement a flash-driver written in rust.

Sub-tasks:

  • The flash driver should support lock and unlock flash operations.
  • The flash driver must write and erase data-blocks from the device's internal flash memory.
  • Finally, it must implement rustBoot's FlashInterface trait.

Additional notes:

  • You only need to implement the methods (of FlashInterface trait), applicable to your board.

Add a rust-based NVMC driver for the STM32F446RE board

In order to port rustBoot to the STM32F446RE board, we'll need to implement a flash-driver written in rust.

Sub-tasks:

  • The flash driver should support lock and unlock flash operations.
  • The flash driver must read, write and erase data-blocks from the device's internal flash memory.
  • Finally, it must implement rustBoot's FlashInterface trait.

Additional notes:

  • You only need to implement the methods (of FlashInterface trait), applicable to your board.

Add support for STM32F469 MCU in examples

Hello, and first of all, thanks for this great work.

I have tried to add support for the STM32F469 MCU in the STM HAL.
This chip is used on the STM32F469-IDISCO board and supporting should be very close to the existing code implemented for STM32F411 and STM32F446.
However, I am wondering how to adjust the value for the constant FW_RESET_VTR, for which the definition is based on an offset...
[This offset is 0xA9 in the current STM446 implementation]
(

pub const FW_RESET_VTR : u32 = BASE_ADDR + RB_HDR_SIZE + VTR_TABLE_SIZE + 0xA9;
)
...and 0x99 in the STM411 implementation.

What is the meaning of this offset? How can I adjust this for STM32F469?
In the STM32 programming manual (PM201), the vector table is identical regardless of the chip STM32F411 or STM32F446...

How to support rpi3/rpi4 in rustBoot

Dear Nihal

I understand that the current source code only supports for nrf52840. In case, I want to modify rustboot to support rpi3/rpi4, I have to modify hardware abstraction layer in rpi3.rs/rpi4.rs and something else

Below are steps to support rpi3 in wolfBoot.
Compiling the kernel

  • Get raspberry-pi linux kernel:
    git clone https://github.com/raspberrypi/linux linux-rpi -b rpi-4.19.y --depth=1
  • Build kernel image:
    cd linux-rpi
    make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcmrpi3_defconfig
    make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
  • Copy Image and .dtb to the wolfboot directory
    cp Image arch/arm64/boot/dts/broadcom/bcm2710-rpi-3-b.dtb $wolfboot_dir
    cd $wolfboot_dir

Testing with qemu-system-aarch64

  • Build wolfboot using the example configuration (RSA4096, SHA3)
    cp config/examples/raspi3.config .config
    make wolfboot-align.bin
  • Sign Image
    tools/keytools/sign.py --rsa4096 --sha3 Image rsa4096.der 1
  • Compose the image
    cat wolfboot-align.bin Image_v1_signed.bin >wolfboot_linux_raspi.bin
    dd if=bcm2710-rpi-3-b.dtb of=wolfboot_linux_raspi.bin bs=1 seek=128K conv=notrunc
  • Test boot using qemu
    qemu-system-aarch64 -M raspi3 -m 512 -serial stdio -kernel wolfboot_linux_raspi.bin -append "terminal=ttyS0 rootwait" -dtb ./bcm2710-rpi-3-b.dtb -cpu cortex-a53

Could you please advise me how to support rpi3/rpi4 in your rustboot.

Dat Nguyen

Unknown command: python3 in wsl

Dear Nihal

I have an issue related to wsl and python3. when i run command

wsl python3 signer.py

and issue happens as below

$ python3 convert2bin.py
$ wsl python3 signer.py
Unknown command: python3
WSL
Wsman Shell commandLine, version 0.2.1

USAGE: wsl COMMAND [PARAMS...]

COMMANDS:
identify - WS-Identify
enum - WS-Enumerate
get - WS-Get
put - WS-Put
invoke - WS-Invoke
xclean - Delete all files generated by this tool set
xcred - Create or display credential file
xcert - Get server certificate (saved to .crt)

PARAMS specification is specific to a COMMAND.

Output will be saved to ./response.xml. If you want to run parallel
executions in the same directory, define RTFILEPREFIX in the environment.
Doing so may significantly increase files generated.

Requires: curl, xmllint, GNU core utilities.
Optional: xsltproc for output formatting, gpg for encrypted credential.
Optional: wget as alternate for curl when not available.
Error: command wsl python3 signer.py failed, exit status: 1
home@home:/media/home/3BBA6BB21611231A/data/Prj_Security/SourceCode/rustBoot-main/rustBoot$ python --version
Python 3.6.9

I think python3 is not recognized in wsl even python3 is installed

https://www.codegrepper.com/code-examples/python/wsl+install+python+3.10
https://www.codegrepper.com/code-examples/shell/bash%3A+python%3A+command+not+found

Could you please support me fix issue related to wsl and python3

Dat Nguyen

The value of State

Hi Nihal,

Kindly clear me how do below values come with corresponding state:
StateNew : 0xFF
StateUpdating: 0x70
StateTesting: 0x10
StateSuccess: 0x00

Thank you,
Viet

Potential for putting partitions in invalid state for smt32h723

// Checks if flags page.
// STM32H7: Due to ECC functionality, it is not possible to write partition/sector
// flags and signature more than once. This flags_cache is used to intercept write operations and
// ensures that the sector is always erased before each write.
if stm32h7_boot_flag_page(addr as u32) {
self.hal_flash_lock();
self.hal_flash_erase((STM32H7_PART_BOOT_FLAGS_PAGE_ADDRESS as usize), 1);
self.hal_flash_unlock();
} else if stm32h7_update_flag_page(addr as u32) {
self.hal_flash_lock();
self.hal_flash_erase((STM32H7_PART_UPDATE_FLAGS_PAGE_ADDRESS as usize), 1);
self.hal_flash_unlock();
}

If the board get rebooted immediately after this section if part of the partitions have been swapped I believe we end up with a board that won't boot.

On possible solution would be two spread out the flag and status bits over several flash words (256 bits) so that each time a new value is written only bits in a previously untouched 256 bit word is zeroed. This way we avoid erasing the sector.

how to build Rustboot for nrf52840 Development kit.

Dear Nihal

I have one nrf52840 kit purchased on market (https://infocenter.nordicsemi.com/pdf/nRF52840_DK_User_Guide_v1.2.pdf)
and I try to modify test-firmware and build Rustboot with below command

cargo xtask build-sign-flash rustBoot nrf52840

as your comment in
https://github.com/nihalpasham/rustBoot/tree/main/boards/test_impls/nrf52840
but currently, I have an issue as below.

nad6hc@VM-NAD6HC-OSD5:~/Prj_Security/SourceCode/rustBoot-main$ cargo xtask build-sign-flash rustBoot nrf52840
Compiling version_check v0.9.3
Compiling typenum v1.14.0
Compiling p256 v0.9.0
Compiling defmt-macros v0.2.3
.....................
Compiling rustBoot v0.1.0 (/home/nad6hc/Prj_Security/SourceCode/rustBoot-main/rustBoot)

error[E0554]: #![feature] may not be used on the stable release channel
--> rustBoot/src/lib.rs:3:1
|
3 | #![feature(once_cell)]
| ^^^^^^^^^^^^^^^^^^^^^^
For more information about this error, try rustc --explain E0554.

error: could not compile rustBoot due to previous error
nad6hc@VM-NAD6HC-OSD5:~/Prj_Security/SourceCode/rustBoot-main$

could you please support me fix the issue in Rustboot.

Dat Nguyen

Upgrade board specific dependencies

If I try to upgrade board specific dependencies I get Cortex-m-rt conflicts error, because all board specific dependencies depend on Cortex-m-rt version number 0.6.15. All board specific and Cortex-m-rt dependencies need to be updated.

Build issue in Windows due to toolchain

Hi all,
I have tried to compile and build rustBoot on Windows. When I set to nightly (nightly-x86_64-pc-windows-msvc), I face to this error:

PS D:\Rust\rustBoot> cargo xtask build-sign-flash rustBoot nrf52840
Compiling xtask v0.1.0 (D:\Rust\rustBoot\xtask)
error: linking with link.exe failed: exit code: 1120
|
= note: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX64\x64\link.exe" "/NOLOGO" "D:\Rust\rustBoot\target\debug\deps\xtask.10zrahq0ct7ie1kq.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.11yv8jm96n8ck2g3.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.12waeh2yapqnuxkn.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.13mu7d720nrys3hq.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.1887fvruxi4hkcuh.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.1ag6mao993j9e25.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.1cf6hba0unm2qeys.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.1jid1qxcrv7ehk93.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.1m1dyp3d6mtyycc4.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.1wgptagz904k7p07.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.1wqypglyaf00u3r9.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.243ifb2w5fnl8yyc.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.2440ds706iz49f6t.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.2aslgu09oynkptme.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.2br3ubn01wfv3ert.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.2c49wbx7xmv7ri6w.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.2dlvzihqx4qrczh6.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.2g9khjj5r7usq86c.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.2ki16w91nexwith6.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.2m1n10zysmjvvzy.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.2nrm31xruaalg4ry.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.2pv8tfj0kbr3ijdx.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.2pxg04pbk458fq7w.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.2q2f2hjtpp1pycfl.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.2wvdpqfbvok9xsf9.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.34l1h754ivate3k.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.36dath1lt8ldmi4d.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.3elsavyr477bk3jm.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.3f0s19kqtzvckfmg.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.3gjjugz0f8z4x2za.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.3gxkand5t2jos48e.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.3ohd3f84gysdjmhi.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.3qcn0a8lipmjyiuu.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.3ucomvf372qxo147.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.3vkwzuhcpl8g8drp.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.3wp9ij24d8aj7k2c.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.3xzuotiuf7s9qcsz.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.3zx0uhia4j1nd8hw.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.460bywmz7n51ol4w.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.49tghx9nvk762kch.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.4b33nncmec1is9hf.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.4i568fpcvgc68b09.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.4ke5paun12r7z1ok.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.4knwyrkq7koj3jp.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.4kou600ew92hpq2r.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.4kwvh4tdvq4g56i1.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.4o3x10gjkyx4e50s.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.4v26y4vmbero89th.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.4ybtx91zhxcl5gnt.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.51q26rucibbgtbef.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.55r07zcxvnswnit8.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.7hdnf4i2d0kb84q.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.99n3kp4grqd49kd.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.bjdfyn63wvnm9zl.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.ej7gz5omvz3oxbj.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.ostn8ce0hao362t.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.xzmgupirrawq4tm.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.z0s3cy11woong10.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.ztcagat28r9muxt.rcgu.o" "D:\Rust\rustBoot\target\debug\deps\xtask.5ccptqy7k36900z9.rcgu.o" "/LIBPATH:D:\Rust\rustBoot\target\debug\deps" "/LIBPATH:D:\Rust\rustBoot\target\debug\build\defmt-0312fcda029d8a93\out" "/LIBPATH:C:\Users\Admin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib" "D:\Rust\rustBoot\target\debug\deps\libanyhow-889e1d5c5ce55de2.rlib" "D:\Rust\rustBoot\target\debug\deps\libxshell-e5ab19e67fe61b78.rlib" "D:\Rust\rustBoot\target\debug\deps\librustBoot-2b6bd830c403f363.rlib" "D:\Rust\rustBoot\target\debug\deps\libnom-7c1ff9e36a84177d.rlib" "D:\Rust\rustBoot\target\debug\deps\libmemchr-070d3c24fd04df62.rlib" "D:\Rust\rustBoot\target\debug\deps\libdefmt-4b894d4929c16506.rlib" "D:\Rust\rustBoot\target\debug\deps\libp256-c04a47e9c84dd93a.rlib" "D:\Rust\rustBoot\target\debug\deps\libsha2-43102365c4b23b5f.rlib" "D:\Rust\rustBoot\target\debug\deps\libcpufeatures-9d8a08f29f58f6c3.rlib" "D:\Rust\rustBoot\target\debug\deps\libcfg_if-b01931459ea167fc.rlib" "D:\Rust\rustBoot\target\debug\deps\libopaque_debug-4883419788e55551.rlib" "D:\Rust\rustBoot\target\debug\deps\libblock_buffer-dd1ac6ac4cfea08d.rlib" "D:\Rust\rustBoot\target\debug\deps\libecdsa-9374177494f3853b.rlib" "D:\Rust\rustBoot\target\debug\deps\libsignature-e4073c033e79d9d9.rlib" "D:\Rust\rustBoot\target\debug\deps\libhmac-a34009256324a971.rlib" "D:\Rust\rustBoot\target\debug\deps\libdigest-87773c94c8960f94.rlib" "D:\Rust\rustBoot\target\debug\deps\libcrypto_mac-418adc1965a4b1ea.rlib" "D:\Rust\rustBoot\target\debug\deps\libder-a9d06eb49c9b8942.rlib" "D:\Rust\rustBoot\target\debug\deps\libelliptic_curve-9a587acf13e4e3d8.rlib" "D:\Rust\rustBoot\target\debug\deps\libcrypto_bigint-b8c1fac78962db5b.rlib" "D:\Rust\rustBoot\target\debug\deps\libgroup-590a7fce134fe30d.rlib" "D:\Rust\rustBoot\target\debug\deps\libff-ff25d6cfe4d40b0f.rlib" "D:\Rust\rustBoot\target\debug\deps\librand_core-4cc1d6a3585099d8.rlib" "D:\Rust\rustBoot\target\debug\deps\libzeroize-26869226754f3a98.rlib" "D:\Rust\rustBoot\target\debug\deps\libgeneric_array-02ec51fcdb956bc7.rlib" "D:\Rust\rustBoot\target\debug\deps\libtypenum-b1793961ce700d11.rlib" "D:\Rust\rustBoot\target\debug\deps\libsubtle-40eab3c15edc7bfb.rlib" "C:\Users\Admin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libstd-0f7e1853181d29c2.rlib" "C:\Users\Admin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libpanic_unwind-ee8804a073a629b8.rlib" "C:\Users\Admin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libstd_detect-f320e82b0baaad6d.rlib" "C:\Users\Admin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\librustc_demangle-cede8d1fca99fc93.rlib" "C:\Users\Admin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libhashbrown-a6db156d99b5f701.rlib" "C:\Users\Admin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\librustc_std_workspace_alloc-31a385e2e15a7a71.rlib" "C:\Users\Admin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libunwind-c431fe701788effd.rlib" "C:\Users\Admin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libcfg_if-9c55022353a90ed5.rlib" "C:\Users\Admin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\liblibc-5c6e234e3431724c.rlib" "C:\Users\Admin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\liballoc-c4009c6b42e3b42a.rlib" "C:\Users\Admin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\librustc_std_workspace_core-665ed95809278e59.rlib" "C:\Users\Admin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libcore-c2100e40c13f915d.rlib" "C:\Users\Admin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libcompiler_builtins-e57a7d82dcc1d66d.rlib" "kernel32.lib" "ws2_32.lib" "bcrypt.lib" "advapi32.lib" "userenv.lib" "kernel32.lib" "msvcrt.lib" "/NXCOMPAT" "/LIBPATH:C:\Users\Admin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib" "/OUT:D:\Rust\rustBoot\target\debug\deps\xtask.exe" "/OPT:REF,NOICF" "/DEBUG" "/NATVIS:C:\Users\Admin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\etc\intrinsic.natvis" "/NATVIS:C:\Users\Admin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\etc\liballoc.natvis" "/NATVIS:C:\Users\Admin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\etc\libcore.natvis" "/NATVIS:C:\Users\Admin\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\etc\libstd.natvis"
= note: libdefmt-4b894d4929c16506.rlib(defmt-4b894d4929c16506.defmt.153a5f11-cgu.12.rcgu.o) : error LNK2019: unresolved external symbol _defmt_acquire referenced in function _ZN5defmt6export7acquire17he8397d0b502dd5f8E
libdefmt-4b894d4929c16506.rlib(defmt-4b894d4929c16506.defmt.153a5f11-cgu.12.rcgu.o) : error LNK2019: unresolved external symbol _defmt_release referenced in function _ZN5defmt6export7release17h9c88e361c85610ffE
libdefmt-4b894d4929c16506.rlib(defmt-4b894d4929c16506.defmt.153a5f11-cgu.12.rcgu.o) : error LNK2019: unresolved external symbol _defmt_timestamp referenced in function _ZN5defmt6export9timestamp17he4ccfc9bd2c739beE
libdefmt-4b894d4929c16506.rlib(defmt-4b894d4929c16506.defmt.153a5f11-cgu.12.rcgu.o) : error LNK2019: unresolved external symbol _defmt_panic referenced in function _ZN5defmt6export5panic17ha99baa72aa2f80d9E
D:\Rust\rustBoot\target\debug\deps\xtask.exe : fatal error LNK1120: 4 unresolved externals
error: could not compile xtask due to previous error

Am I have any missing step?

Support for NRF9160DK

Add support for NRF9160 board

  • Enable Trustzone-M support for NRF9160 board.
  • Initialize the secure and non-secure space.
  • Make the transition from secure to non-secure space.
  • Check for the available helper crates to manage TrustZone-M.
  • Prepare a micro bootloader which initializes the secure and non-secure space, and jumps to a blinky firmware.
  • Integrate the TrustZone-M support for rustBoot
  • Implement the Hal flash driver for NRF9160 board

    • Search for the well maintained HAL crate for the board
    • Get the Blinky code working
    • Get the write and erase functions working on the flash
    • Integrate the write and erase functions in rust boot
    • Create the Boot and Update firmware using different LEDs
    • Integrate and Test the rustBoot project for the NRF9160 board

Add a rust-based NVMC driver for the ATSAM4L8-XPRO board

In order to port rustBoot to the ATSAM4L8-XPRO board, we'll need to implement a flash-driver written in rust.

Sub-tasks:

  • The flash driver must read, write and erase data-blocks from the device's internal flash memory.
  • Finally, it must implement rustBoot's FlashInterface trait.

Additional notes:

  • You only need to implement the methods (of FlashInterface trait), applicable to your board.

Add support for a QSPI enabled flash-driver for the RP2040 board

In order to port rustBoot to the RP2040 board, we'll need to implement a flash-driver written in rust.

Sub-tasks:

  • The flash driver must write and erase data-blocks from the device's external flash memory.
  • More specifically, the RP2040 includes an Q-SPI flash chip, the flash driver must be a QSPI driver capable of performing block write and erase operations.
  • Finally, it must implement rustBoot's FlashInterface trait.

Additional notes:

  • You only need to implement the methods (of FlashInterface trait), applicable to your board.

Order IMX-8 chip set.

Need to order the NXP IMX8 series evaluation board.

  • Look for a list of vendors, board availability and estimated lead-time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.