Closed abhishekdhamale closed 2 years ago
A couple of points:
rp2040-pac
as a dependency? Isn't rp2040-hal
enough?flash-driver
, describing the temporary cache required a data-read and write operation (for ex: during swapping).data.ram_func
After implementing the suggested changes I have pushed it the same PR.
Following is the command line output.
PS C:\Users\ELCOME\Documents\RustProjects\rustBoot-Abhishek\rustBoot> cargo rp2040 build-sign-flash rustBoot
Finished dev [unoptimized + debuginfo] target(s) in 0.37s
Running `target\debug\xtask.exe rp2040 build-sign-flash rustBoot`
$ cargo build --release
Finished release [optimized] target(s) in 0.42s
$ cargo build --release
Finished release [optimized] target(s) in 0.18s
$ cargo build --release
Finished release [optimized] target(s) in 0.20s
$ py convert2bin.py
$ py signer.py
['sign.py', '--ecc256', '--sha256', 'rp2040_bootfw.bin', 'ecc256.der', '1234']
Update type: Firmware
Input image: rp2040_bootfw.bin
Selected cipher: ecc256
Public key: ecc256.der
Output image: rp2040_bootfw_v1234_signed.bin
Not Encrypted
Calculating sha256 digest...
Signing the firmware...
Done.
Output image successfully created.
['sign.py', '--ecc256', '--sha256', 'rp2040_updtfw.bin', 'ecc256.der', '1235']
Update type: Firmware
Input image: rp2040_updtfw.bin
Selected cipher: ecc256
Public key: ecc256.der
Output image: rp2040_updtfw_v1235_signed.bin
Not Encrypted
Calculating sha256 digest...
Signing the firmware...
Done.
Output image successfully created.
$ probe-rs-cli download --format Bin --base-address 0x10020000 --chip RP2040 rp2040_bootfw_v1234_signed.bin
Erasing sectors ✔ [00:00:00] [######################################################################] 4.00KiB/ 4.00KiB @ 22.90KiB/s (eta 0s )
Programming pages ✔ [00:00:00] [######################################################################] 4.00KiB/ 4.00KiB @ 9.98KiB/s (eta 0s )
Finished in 0.504s
$ probe-rs-cli download --format Bin --base-address 0x10040000 --chip RP2040 rp2040_updtfw_v1235_signed.bin
Erasing sectors ✔ [00:00:00] [######################################################################] 4.00KiB/ 4.00KiB @ 21.86KiB/s (eta 0s )
Programming pages ✔ [00:00:00] [######################################################################] 4.00KiB/ 4.00KiB @ 9.53KiB/s (eta 0s )
Finished in 0.523s
$ cargo flash --chip RP2040 --release
Finished release [optimized] target(s) in 0.22s
Flashing C:\Users\ELCOME\Documents\RustProjects\rustBoot-Abhishek\rustBoot\boards\target\thumbv6m-none-eabi\release\rp2040
Erasing sectors ✔ [00:00:00] [######################################################################] 48.00KiB/48.00KiB @ 43.53KiB/s (eta 0s )
Programming pages ✔ [00:00:02] [######################################################################] 48.00KiB/48.00KiB @ 9.66KiB/s (eta 0s )
Finished in 3.301s
I have reviewed changes ,everything looks good now.
looks good. thank you @abhishekdhamale 💥
19
Added and tested both secure boot and update firmware with QSPI enabled external flash-driver on RP2040 Pico Board.
Command line output