Skip to content

Commit 73e1e97

Browse files
update instructions
1 parent adecf03 commit 73e1e97

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

doc/selfsigned.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ make stm32f469disco
1717

1818
Read the [main readme](../README.md) to learn more, pay extra attention to the `READ_PROTECTION` and `WRITE_PROTECTION` parameters.
1919

20-
We recommend to make a bootloader without any protection at first, flash it, sign and flash the firmware, check that everything works, and then bump the version of the bootloader, recompile with `READ_PROTECTION=1` and `WRITE_PROTECTION=1`, sign and upload the bootloader upgrade.
20+
We recommend making a bootloader without any protection at first, flash it, sign and flash the firmware, check that signing procedure works, and then bump the version of the bootloader, recompile with `READ_PROTECTION=1` and `WRITE_PROTECTION=1`, sign and upload the bootloader upgrade.
21+
22+
If you are sure that everything works you can compile bootloader with all the protections right away.
2123

2224
## Creating initial firmware
2325

@@ -37,6 +39,8 @@ Now you can create initial firmware:
3739
python3 make-initial-firmware.py -s ../build/stm32f469disco/startup/release/startup.hex -b ../build/stm32f469disco/bootloader/release/bootloader.hex -bin initial_firmware.bin
3840
```
3941

42+
If you want to include main firmware there as well, just add `-f ../path/to/compiled/main/firmware.hex`. Note that firmware should be compiled with `USE_DBOOT=1` for that.
43+
4044
The resulting `initial_firmware.bin` can be copy-pasted to the `DIS_F469I` volume that appears when you connect the board with miniUSB.
4145

4246
Alternatively, if you have [`stlink-tools`](https://github.com/stlink-org/stlink) installed, you can flash the firmware with verification using:
@@ -46,6 +50,8 @@ st-flash write initial_firmware.bin 0x8000000
4650

4751
After flashing of this initial firmware you should see an error screen of the bootloader that "No valid firmware found" - this is what we expect because we didn't upload firmware yet. For that we can generate an upgrade file.
4852

53+
Note that release version of the bootloader (rc99) only accepts release versions of the firmware.
54+
4955
## Creating upgrade files
5056

5157
First, compile firmware of Specter-DIY with `USE_DBOOT=1` flag. It will create a `bin/specter-diy.hex` file:
@@ -69,15 +75,15 @@ Use this command to get the message to sign:
6975
python3 upgrade-generator.py message specter_upgrade.bin
7076
```
7177

72-
It will return something like `1.4.0rc3-1sujn22lsgatcpyesj9v8lf4zts6myds0cwdl9ukk7pqnasr06laq2gm2yt` - here you see that it's a firmware version 1.4.0-rc3 and bech32-encoded hash of the firmware. You can sign this message now and when you get a signature in base64 format you need to add it to the upgrade:
78+
It will return something like `1.4.0-1sujn22lsgatcpyesj9v8lf4zts6myds0cwdl9ukk7pqnasr06laq2gm2yt` - here you see that it's a firmware version 1.4.0 and bech32-encoded hash of the firmware. You can sign this message now and when you get a signature in base64 format you need to add it to the upgrade:
7379

7480
```sh
7581
python3 upgrade-generator.py import-sig -s IP6SuI23iNNxYLCyh/J3FsY8Zd687tfMNFR37ZppprGNDG1Ij3Oh4u3PvrYmdno/PRG9Lqourael5oAJ+kWT+d4= specter_upgrade.bin
7682
```
7783

7884
Repeat it for necessary number of signatures, now you should be able to copy this signed `specter_upgrade.bin` file to the SD card and load the firmware to the device.
7985

80-
Verify that upgrade process works, firmware is fine etc. After that you can upgrade the bootloader to "protected" one.
86+
Verify that upgrade process works, signing of the firmware went well etc. After that you can upgrade the bootloader to "protected" one.
8187

8288
## Protected bootloader
8389

0 commit comments

Comments
 (0)