nihalpasham / 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.
MIT License
214 stars 21 forks source link

Flashdriver and rustboot support was added for stm32f334 board #38

Closed sarath3192 closed 2 years ago

sarath3192 commented 2 years ago

Command : cargo stm32f334 build rustBoot-only

sarathk@sarath:~/stm32f/PULL_REQUEST/rustBoot$ cargo stm32f334 build rustBoot-only
    Finished dev [unoptimized + debuginfo] target(s) in 0.05s
     Running `target/debug/xtask stm32f334 build rustBoot-only`
$ cargo build --release
   Compiling version_check v0.9.4
   Compiling autocfg v1.1.0
   Compiling typenum v1.15.0
   ...
   ...
   Comp
   Compiling ecdsa v0.13.4
   Compiling p256 v0.10.1
   Compiling rustBoot v0.1.0 (/home/sarathk/stm32f/PULL_REQUEST/rustBoot/rustBoot)
   Compiling rustBoot-hal v0.1.0 (/home/sarathk/stm32f/PULL_REQUEST/rustBoot/boards/hal)
   Compiling rustBoot-update v0.1.0 (/home/sarathk/stm32f/PULL_REQUEST/rustBoot/boards/update)
    Finished release [optimized] target(s) in 1m 38s

Command : cargo stm32f334 build pkgs-for

sarathk@sarath:~/stm32f/PULL_REQUEST/rustBoot$ cargo stm32f334 build pkgs-for
    Finished dev [unoptimized + debuginfo] target(s) in 0.05s
     Running `target/debug/xtask stm32f334 build pkgs-for`
$ cargo build --release
   Compiling panic-probe v0.3.0
   Compiling stm32f334_bootfw v0.1.0 (/home/sarathk/stm32f/PULL_REQUEST/rustBoot/boards/firmware/stm32f334/boot_fw_blinky_green)
    Finished release [optimized] target(s) in 1.79s
$ cargo build --release
   Compiling stm32f334_updtfw v0.1.0 (/home/sarathk/stm32f/PULL_REQUEST/rustBoot/boards/firmware/stm32f334/updt_fw_blinky_red)
    Finished release [optimized] target(s) in 1.13s
$ cargo build --release
    Finished release [optimized] target(s) in 0.15s

Command : cargo stm32f334 sign pkgs-for


sarathk@sarath:~/stm32f/PULL_REQUEST/rustBoot$ cargo stm32f334 sign pkgs-for
    Finished dev [unoptimized + debuginfo] target(s) in 0.06s
     Running `target/debug/xtask stm32f334 sign pkgs-for`
$ python3 convert2bin.py
$ python3 signer.py
['sign.py', '--ecc256', '--sha256', 'stm32f334_updtfw.bin', 'ecc256.der', '1235']
Update type:          Firmware
Input image:          stm32f334_updtfw.bin
Selected cipher:      ecc256
Public key:           ecc256.der
Output image:         stm32f334_updtfw_v1235_signed.bin
Not Encrypted
Calculating sha256 digest...
Signing the firmware...
Done.
Output image successfully created.
['sign.py', '--ecc256', '--sha256', 'stm32f334_bootfw.bin', 'ecc256.der', '1234']
Update type:          Firmware
Input image:          stm32f334_bootfw.bin
Selected cipher:      ecc256
Public key:           ecc256.der
Output image:         stm32f334_bootfw_v1234_signed.bin
Not Encrypted
Calculating sha256 digest...
Signing the firmware...
Done.
Output image successfully created.