picotool encryption example
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- cpp, raspberry-pi
- Domain
- documentation, embedded-iot, security
Research direction
Start with the secure-boot documentation and the picotool commands shown in the issue, including the generated sketch.elf, sketch.enc.elf, out.json, private.pem, privateaes.bin, and ivsalt.bin files. Reproduce the Arduino IDE flow on a Raspberry Pi 5 and document the complete working sequence, including whether an address or the secure-boot enable step is required.
Written by the indexing model from the issue text.
Description
Hi everyone,
I think it would be useful for many of us to have a complete example showing how to enable secure boot and program encryption with picotool, starting from a UF2 file generated by the Arduino IDE.
For example I have this Arduino sketch:
---------------------------------
sketch.ino
---------------------------------
void setup() {
pinMode(LED_BUILTIN, OUTPUT); // Initialize onboard LED as output
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // Turn LED on
delay(500);
digitalWrite(LED_BUILTIN, LOW); // Turn LED off
delay(500);
}
After compiling in the folder C:\Users$user\AppData\Local\arduino\sketches<sketch_id>I can find sketch.uf2, skecth.bin, sketch.elf.
I moved this 3 files under my Raspberry Pi 5 with picotool compiled from source.
I followed your docs to create my private.pem, privateaes.bin and ivsalt.bin and I moved them under key folder.
The next step I made was try to encrypt with picotool:
picotool encrypt --embed --sign --hash sketch.elf sketch.enc.elf key/privateaes.bin key/ivsalt.bin key/private.pem out.json
I added embed options because I haven't my custom bootloader.
After the execution I have in the folder sketch.enc.elf and out.json.
So I loaded them with:
picotool load sketch.enc.elf
picotool otp load out.json
I get positive result from picotool, but on Pico2 the led is not blinking, so I not sent the cmd to enable secure boot.
picotool otp set OTP_DATA_CRIT1.SECURE_BOOT_ENABLE 1
Maybe when I load the sketch.enc.elf I have to specify the address?
Thank you!
- Dominant language
- C++
- Stars
- 999
- Forks
- 189
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raspberrypi/picotool
-
picotool load file.bin -o 0x11000000 always fails with second flash chip present and configured Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
raspberrypi/picotool#360 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
raspberrypi/picotool#347 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
raspberrypi/picotool#348 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
raspberrypi/picotool#344 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
raspberrypi/picotool#330 · 1 comment ·
All issues in raspberrypi/picotool
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Sensor initialization takes very long when `--initial-sim-time` is set to current UNIX timestamp Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gazebosim/gz-sensors#662 · 1 comment ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
LadybirdBrowser/ladybird#12123 ·