This hobbyist project documents kits that developers can use to explore, develop, test, and debug the open source TREZOR One hardware and software.
These kits do NOT produce production TREZOR One cryptocurrency hardware wallet devices.
If you want an official TREZOR One hardware wallet, see: https://shop.trezor.io/
When contrasted to official production hardware, these kits are less safe to use for non-development purposes.
Necessarily, different selections were made for the key security properties of these developer kits vs. production hardware. For example, when used as documented here, these kits purposefully leave debug capabilities enabled, and do not apply write protections to bootloader flash memory. This is so that developers may repeatedly develop, test, and debug all types of changes.
Production hardware irreversibly disables debug capabilities and Device Firmware Upgrade (DFU) mode, and protects key memory areas as part of reducing attack surface and increasing depth of defenses. There may be other subtle, yet meaningful, weaknesses as well, depending on your usage and threat model.
USE THESE KITS AT YOUR OWN RISK
One key difference between these kits and production hardware is the microcontroller (MCU) used. Production hardware uses the STM32F205RET6 (and more recently, the STM32F205RGT6) MCU and these kits use the STM32F405RGT6 MCU. Note: the STM32F205RET6 is documented to have 512KB of flash memory, but it actually has 1MB. Apparently, it is more cost efficient for ST to not develop different chip-wafers. The former is an ARM® Cortex®-M3 and the latter is an ARM® Cortex®-M4. The Cortex-M4 architecture is a backwards compatible superset of Cortex-M3. The additional features, like hard float capability, do not matter for this project. The STM32F405RGT6 has 1MB of flash memory, a core clock frequency adjustable up to 168MHz (including the 205's 120MHz; with matching clock tree), and 128KB of SRAM (same as the 205; the 405 has an additional 64KB of CCMRAM, giving it 192KB of usable RAM). The STM32F405RGT6 is pin-to-pin compatible with the STM32F205RET6/STM32F205RGT6 and uses the same TRNG (reference: STM32F405xx datasheet section 2.1, and AN4230 section 1.2.1).
The Waveshare Core405R dev board has an 8MHz high-speed external (HSE) crystal (matching the reference hardware), a STM32F405RGT6 MCU, a USB connector, power circuitry, SWD debug interface, boot mode select switch, and all the pins needed, broken out and available for use.
Pay attention to the pinout that is specified on the debug adapter. Also, pay attention to the location of the notch on the header housing. Note that the white rectangle printed next to pin 5 on the pinout specification in Figure H20 denotes the notch.
Connect the Debug Adapter's SWDIO, SWCLK, and GND pins (any one of the ground pins is sufficient) to the corresponding pins on the Dev Board's SWD connector.
Note: Instead of using the JTAG/SWD connector, the debug adapter's SWDIO, SWCLK, and GND pins may also be connected to the dev board's PA13, PA14, and GND pins, respectively.
Set the Dev Board jumpers and switches as shown in Figure H29.
Use the following table to wire between the dev board and appropriate tie points on your breadboard. The following pictures are also helpful if you don't quite understand.
Pins on the dev board are documented by the silkscreen on the other side of the board. Pins on the display module are also documented by silkscreen.
Dev Board Pin | Breadboard Pin | Alternate Name | Comment |
---|---|---|---|
PC5 | Button 2 | Either button pin; connect GND to the other button pin; button is Active-Low | |
PA4 | CS | Chip Select | Pin 7 on Pictured Display |
PB0 | DC | Data/Command | Pin 6 on Pictured Display |
PB1 | RES | Reset | Pin 5 on Pictured Display |
PA7 | SDA | MOSI | Pin 4 on Pictured Display |
PA5 | SCK | SCLK | Pin 3 on Pictured Display |
3.3V | VDD | 3V3 | Pin 2 on Pictured Display |
GND | GND | Ground | Pin 1 on Pictured Display |
PC2 | Button 1 | Either button pin; connect GND to the other button pin; button is Active-Low |
This setup process comprises steps to install development and debugging tools on a temporary computer, then build and install a bootloader and firmware on the kit's MCU.
The following setup process was documented while running an Ubuntu 18.04 LTS Desktop (Bionic Beaver) Live CD as user ubuntu.
Note that the symbol files were changed above at a point in the debugging process near bootloader-exit/firmware-entry. This was done in order to add breakpoints based on symbols relevant to the code being executed.
Also, be sure to check the display module and progress past the unofficial firmware warning message by pressing the appropriate buttons. Otherwise, it will seem as though your debugging session has simply stopped working. In fact, the code is just waiting for your user input.
UPDATE: Loading officially signed firmware versions 1.6.1 and later onto your dev kit is NOT recommended. Doing so, risks your bootloader flash memory sectors being locked. For more info, see this and this.
In the setup process, a self-built bootloader and firmware was compiled, combined, and then loaded onto the MCU flash. To use an officially signed firmware, simply replace fw.bin in the setup process above before running prepare.py. Then run the prepare.py and load the newly created combined.bin onto the MCU.
An officially signed firmware can be downloaded with:
wget -O fw.bin https://wallet.trezor.io/data/firmware/trezor-1.5.2.bin
These kits can be used in a standalone configuration; without the debug adapter connected. Simply unplug and/or detach the debug adapter from the dev board and plug the dev board into your computer's USB port.
The setup process used OpenOCD to flash code into the MCU's flash memory and was done in non-Device Firmware Upgrade (DFU) mode. DFU mode can be used instead. Doing so just requires using different tools, moving a switch, and unplugging and replugging the dev board a couple of times. Using DFU mode is a little less convenient when compared to the flash process used above.
To use DFU mode