-
-
Notifications
You must be signed in to change notification settings - Fork 670
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(core) Update embedded build instraction, add DISC2 and TrustZone…
… section
- Loading branch information
Showing
4 changed files
with
80 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
DISC 2 | ||
|
||
DISC2 is an evaluation board STM32U5G9J used for firmware development of Trezor models with the STM32U5. | ||
|
||
The kit has accessible pins, a display, and an embedded ST-Link. | ||
|
||
To build and flash firmware to the DISC2 target, follow these instructions: | ||
|
||
1. Compile the firmware for the target with TREZOR_MODEL=DISC2 and BOOTLOADER_DEVEL=1 | ||
|
||
```sh | ||
cd core | ||
TREZOR_MODEL=DISC2 BOOTLOADER_DEVEL=1 make vendor build_boardloader build_bootloader build_firmware | ||
``` | ||
|
||
2. Ensure that TrustZone is enabled on the DISC2 device, as explained here. | ||
|
||
3. Connect the DISC2 ST-Link to the PC using a micro-USB cable (connector CN5). | ||
|
||
4. Erase the DISC2 flash. | ||
```sh | ||
TREZOR_MODEL=DISC2 make flash_erase | ||
``` | ||
5. Flash the freshly compiled firmware from step 1. | ||
|
||
```sh | ||
TREZOR_MODEL=DISC2 make flash | ||
```` | ||
6. Reset the device (you may need to do this a couple of times) until it boots up. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
|
||
# TrustZone | ||
|
||
New Trezor models are built on the STM32U5 series microcontrollers, which are based on the ARM Cortex-M33 and provide advanced security features, such as TrustZone. | ||
|
||
When building firmware for such a device (Blank Trezor device or DISC2 evaluation kit), you need to ensure that TrustZone is enabled in the STM32 microcontroller’s option bytes. | ||
|
||
## Enable TrustZone in STM32 Option Bytes | ||
|
||
1. Download and install [STM32CubeProgrammer](https://www.st.com/en/development-tools/stm32cubeprog.html#st-get-software). | ||
|
||
|
||
2. Connect the device via ST-Link (DISC2 has an embedded ST-Link; for Trezor devices, use an external one). | ||
|
||
3. Power on the device (connect via USB). | ||
|
||
4. Open STM32CubeProgrammer and connect to the device. | ||
|
||
5. Open the Option Bytes (OB) tab. | ||
|
||
6. In the User Configuration tab, enable TZEN, then press Apply. | ||
|
||
7. In the Boot Configuration tab, change the SECBOOTADD0 address to 0x0C004000, then press Apply. | ||
|
||
8. Disconnect the ST-Link and reset the device. |