Skip to content

Commit

Permalink
Merge #742: trezor: add Trezor Safe 5 support
Browse files Browse the repository at this point in the history
3f91b35 build: make sure Trezors are built with gcc 12 (matejcik)
5f32310 trezor: add Trezor Safe 5 and Trezor Safe 3 rev2 support (matejcik)

Pull request description:

  just updated definitions from upstream trezorlib

ACKs for top commit:
  achow101:
    ACK 3f91b35

Tree-SHA512: 94e235832082ca3920e9e53d2925d8b32863526fe97cd1d4958b38b237309f4872daad803d5ea998113fd211aeb8d31f5139574926cdeb342db7e34b643e9afc
  • Loading branch information
achow101 committed Aug 29, 2024
2 parents 4f0c047 + 3f91b35 commit fd19fa7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
31 changes: 30 additions & 1 deletion hwilib/devices/trezorlib/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@ class TrezorModel:
default_mapping=mapping.DEFAULT_MAPPING,
)

T3T1 = TrezorModel(
name="Safe 5",
internal_name="T3T1",
minimum_version=(2, 1, 0),
vendors=VENDORS,
usb_ids=((0x1209, 0x53C1), (0x1209, 0x53C0)),
default_mapping=mapping.DEFAULT_MAPPING,
)

T3B1 = TrezorModel(
name="Safe 3",
internal_name="T3B1",
minimum_version=(2, 1, 0),
vendors=VENDORS,
usb_ids=((0x1209, 0x53C1), (0x1209, 0x53C0)),
default_mapping=mapping.DEFAULT_MAPPING,
)

DISC1 = TrezorModel(
name="DISC1",
internal_name="D001",
Expand All @@ -72,15 +90,26 @@ class TrezorModel:
default_mapping=mapping.DEFAULT_MAPPING,
)

DISC2 = TrezorModel(
name="DISC2",
internal_name="D002",
minimum_version=(2, 1, 0),
vendors=VENDORS,
usb_ids=((0x1209, 0x53C1), (0x1209, 0x53C0)),
default_mapping=mapping.DEFAULT_MAPPING,
)

# ==== model based names ====

TREZOR_ONE = T1B1
TREZOR_T = T2T1
TREZOR_R = T2B1
TREZOR_SAFE3 = T2B1
TREZOR_SAFE5 = T3T1
TREZOR_DISC1 = DISC1
TREZOR_DISC2 = DISC2

TREZORS = {T1B1, T2T1, T2B1, DISC1}
TREZORS = {T1B1, T2T1, T2B1, T3T1, T3B1, DISC1, DISC2}


def by_name(name: Optional[str]) -> Optional[TrezorModel]:
Expand Down
2 changes: 2 additions & 0 deletions test/setup_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ if [[ -n ${build_trezor_1} || -n ${build_trezor_t} ]]; then
poetry install
cd legacy
export EMULATOR=1 TREZOR_TRANSPORT_V1=1 DEBUG_LINK=1 HEADLESS=1
export CC=gcc-12
poetry run pip install protobuf==3.20.0
poetry run script/setup
poetry run script/cibuild
Expand All @@ -108,6 +109,7 @@ if [[ -n ${build_trezor_1} || -n ${build_trezor_t} ]]; then
# But there should be some caching that makes this faster
poetry install
cd core
export CC=gcc-12
poetry run make build_unix
# Delete any emulator.img file
find . -name "trezor.flash" -exec rm {} \;
Expand Down

0 comments on commit fd19fa7

Please sign in to comment.