Skip to content

Commit fd19fa7

Browse files
committed
Merge #742: trezor: add Trezor Safe 5 support
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
2 parents 4f0c047 + 3f91b35 commit fd19fa7

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

hwilib/devices/trezorlib/models.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,24 @@ class TrezorModel:
6363
default_mapping=mapping.DEFAULT_MAPPING,
6464
)
6565

66+
T3T1 = TrezorModel(
67+
name="Safe 5",
68+
internal_name="T3T1",
69+
minimum_version=(2, 1, 0),
70+
vendors=VENDORS,
71+
usb_ids=((0x1209, 0x53C1), (0x1209, 0x53C0)),
72+
default_mapping=mapping.DEFAULT_MAPPING,
73+
)
74+
75+
T3B1 = TrezorModel(
76+
name="Safe 3",
77+
internal_name="T3B1",
78+
minimum_version=(2, 1, 0),
79+
vendors=VENDORS,
80+
usb_ids=((0x1209, 0x53C1), (0x1209, 0x53C0)),
81+
default_mapping=mapping.DEFAULT_MAPPING,
82+
)
83+
6684
DISC1 = TrezorModel(
6785
name="DISC1",
6886
internal_name="D001",
@@ -72,15 +90,26 @@ class TrezorModel:
7290
default_mapping=mapping.DEFAULT_MAPPING,
7391
)
7492

93+
DISC2 = TrezorModel(
94+
name="DISC2",
95+
internal_name="D002",
96+
minimum_version=(2, 1, 0),
97+
vendors=VENDORS,
98+
usb_ids=((0x1209, 0x53C1), (0x1209, 0x53C0)),
99+
default_mapping=mapping.DEFAULT_MAPPING,
100+
)
101+
75102
# ==== model based names ====
76103

77104
TREZOR_ONE = T1B1
78105
TREZOR_T = T2T1
79106
TREZOR_R = T2B1
80107
TREZOR_SAFE3 = T2B1
108+
TREZOR_SAFE5 = T3T1
81109
TREZOR_DISC1 = DISC1
110+
TREZOR_DISC2 = DISC2
82111

83-
TREZORS = {T1B1, T2T1, T2B1, DISC1}
112+
TREZORS = {T1B1, T2T1, T2B1, T3T1, T3B1, DISC1, DISC2}
84113

85114

86115
def by_name(name: Optional[str]) -> Optional[TrezorModel]:

test/setup_environment.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ if [[ -n ${build_trezor_1} || -n ${build_trezor_t} ]]; then
9090
poetry install
9191
cd legacy
9292
export EMULATOR=1 TREZOR_TRANSPORT_V1=1 DEBUG_LINK=1 HEADLESS=1
93+
export CC=gcc-12
9394
poetry run pip install protobuf==3.20.0
9495
poetry run script/setup
9596
poetry run script/cibuild
@@ -108,6 +109,7 @@ if [[ -n ${build_trezor_1} || -n ${build_trezor_t} ]]; then
108109
# But there should be some caching that makes this faster
109110
poetry install
110111
cd core
112+
export CC=gcc-12
111113
poetry run make build_unix
112114
# Delete any emulator.img file
113115
find . -name "trezor.flash" -exec rm {} \;

0 commit comments

Comments
 (0)