Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T3W1 support #275

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
- **emulator-start**
- **action**: start the specified emulator (identified by model + version) (and if one already runs, kills it)
- **arguments**:
- **model**: `str` (enum of new model names - `["T1B1", "T2T1", "T2B1", "T3T1"]`) - needs to be supplied
- **model**: `str` (enum of new model names - `["T1B1", "T2T1", "T2B1", "T3T1", "T3W1"]`) - needs to be supplied
- **version**: `str` (1.9.4, 2.4.0., etc.) - default is the latest version from master/main branch (`-main`)
- `-latest` can be used to get the latest released version of that model (by release tag, e.g. 2.9.0)
- **wipe**: `bool` (default=False) whether to delete the emulator profile before starting it
Expand All @@ -37,7 +37,7 @@
- **action**: downloads emulator from specified URL and runs it
- **arguments**:
- **url**: `str` from where to download the emulator
- **model**: `str` which emulator it is - `["T1B1", "T2T1", "T2B1", "T3T1"]`
- **model**: `str` which emulator it is - `["T1B1", "T2T1", "T2B1", "T3T1", "T3W1"]`
- **wipe**: `bool` (default=False) whether to delete the emulator profile before starting it
- **output_to_logfile**: `bool` (default=True) whether the debug output should go to a logfile - otherwise it goes to stdout
- **save_screenshots**: `bool` (default=False) whether to save screenshots to enable calling **emulator-get-screenshot**
Expand Down
345 changes: 182 additions & 163 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ authors = ["SatoshiLabs <info@satoshilabs.com>"]
[tool.poetry.dependencies]
python = "^3.11"
termcolor = "^1.1.0"
trezor = "^0.13.9"
trezor = { git = "https://github.com/trezor/trezor-firmware.git", branch = "main", subdirectory = "python" }
vdovhanych marked this conversation as resolved.
Show resolved Hide resolved
websockets = "^10.1"
psutil = "^5.8.0"
Pillow = "^9.1.0"
Expand Down
4 changes: 3 additions & 1 deletion src/binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@
USER_DOWNLOADED_DIR = FIRMWARE_BIN_DIR / "user_downloaded"
USER_DOWNLOADED_DIR.mkdir(exist_ok=True)

Model = Literal["T1B1", "T2T1", "T2B1", "T3T1"]
Model = Literal["T1B1", "T2T1", "T2B1", "T3T1", "T3W1"]
FIRMWARES: Dict[Model, Dict[str, str]] = {
"T1B1": OrderedDict(),
"T2T1": OrderedDict(),
"T2B1": OrderedDict(),
"T3T1": OrderedDict(),
"T3W1": OrderedDict(),
}

MODEL_IDENTIFIERS: Dict[Model, str] = {
"T1B1": "trezor-emu-legacy-T1B1-v",
"T2T1": "trezor-emu-core-T2T1-v",
"T2B1": "trezor-emu-core-T2B1-v",
"T3T1": "trezor-emu-core-T3T1-v",
"T3W1": "trezor-emu-core-T3W1-v",
}

BRIDGES: List[str] = []
Expand Down
6 changes: 6 additions & 0 deletions src/binaries/firmware/bin/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ if [[ $SYSTEM_ARCH == x86_64* ]]; then
wget https://data.trezor.io/dev/firmware/emu-nightly/trezor-emu-core-T3T1-universal
mv trezor-emu-core-T3T1-universal ../trezor-emu-core-T3T1-v2-main

wget https://data.trezor.io/dev/firmware/emu-nightly/trezor-emu-core-T3W1-universal
mv trezor-emu-core-T3W1-universal ../trezor-emu-core-T3W1-v2-main

elif [[ $SYSTEM_ARCH == aarch64* ]]; then

wget https://data.trezor.io/dev/firmware/emu-nightly/trezor-emu-arm-legacy-T1B1-universal
Expand All @@ -97,6 +100,9 @@ elif [[ $SYSTEM_ARCH == aarch64* ]]; then

wget https://data.trezor.io/dev/firmware/emu-nightly/trezor-emu-arm-core-T3T1-universal
mv trezor-emu-arm-core-T3T1-universal ../trezor-emu-core-T3T1-v2-main-arm

wget https://data.trezor.io/dev/firmware/emu-nightly/trezor-emu-arm-core-T3W1-universal
mv trezor-emu-arm-core-T3W1-universal ../trezor-emu-core-T3W1-v2-main-arm
fi

cd "$BIN_DIR"
Expand Down
5 changes: 5 additions & 0 deletions src/dashboard/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ const app = createApp({
versions: [],
selected: "",
},
T3W1: {
header: "T3W1",
versions: [],
selected: "",
},
},
wipeDevice: false,
screenshotMode: false,
Expand Down
2 changes: 1 addition & 1 deletion src/emulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def version_model() -> str:

emu_location = Path(binaries.get_firmware_location(model, version))

if model in ("T2T1", "T2B1", "T3T1"):
if model in ("T2T1", "T2B1", "T3T1", "T3W1"):
EMULATOR = CoreEmulator(
emu_location,
profile_dir=binaries.FIRMWARE_BIN_DIR,
Expand Down
Loading