diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index 32b3a4e7d..706972720 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -22,8 +22,9 @@ jobs: name: Build firmware runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - model: [T2T1, T2B1] + model: [T2T1, T2B1] # FIXME: add T3T1 after https://github.com/trezor/trezor-firmware/pull/3553 is fixed coins: [universal, btconly] type: ${{ fromJSON(github.event_name == 'schedule' && '["normal", "debuglink", "production"]' || '["normal", "debuglink"]') }} include: @@ -31,7 +32,7 @@ jobs: coins: universal type: normal env: - TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || 'R' }} + TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || matrix.model == 'T2B1' && 'R' || matrix.model == 'D001' && 'DISC1' || matrix.model }} BITCOIN_ONLY: ${{ matrix.coins == 'universal' && '0' || '1' }} PYOPT: ${{ matrix.type == 'debuglink' && '0' || '1' }} PRODUCTION: ${{ matrix.type == 'production' && '1' || '0' }} @@ -69,8 +70,9 @@ jobs: name: Build emu runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - model: [T2T1, T2B1] + model: [T2T1, T2B1, T3T1] coins: [universal, btconly] # type: [normal, debuglink] type: [debuglink] @@ -79,7 +81,7 @@ jobs: - type: normal asan: asan env: - TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || 'R' }} + TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || matrix.model == 'T2B1' && 'R' || matrix.model }} BITCOIN_ONLY: ${{ matrix.coins == 'universal' && '0' || '1' }} PYOPT: ${{ matrix.type == 'debuglink' && '0' || '1' }} ADDRESS_SANITIZER: ${{ matrix.asan == 'asan' && '1' || '0' }} @@ -92,7 +94,7 @@ jobs: submodules: recursive - uses: ./.github/actions/environment - run: nix-shell --run "poetry run make -C core build_bootloader_emu" - if: matrix.coins == 'universal' + if: matrix.coins == 'universal' && matrix.model != 'T3T1' # FIXME T3T1 bootloader emulator - run: nix-shell --run "poetry run make -C core build_unix_frozen" - uses: actions/upload-artifact@v4 with: @@ -106,11 +108,12 @@ jobs: name: Python unit tests runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - model: [T2T1, T2B1] + model: [T2T1, T2B1, T3T1] asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }} env: - TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || 'R' }} + TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || matrix.model == 'T2B1' && 'R' || matrix.model }} ADDRESS_SANITIZER: ${{ matrix.asan == 'asan' && '1' || '0' }} LSAN_OPTIONS: "suppressions=../../asan_suppressions.txt" steps: @@ -126,6 +129,7 @@ jobs: runs-on: ubuntu-latest needs: core_emu strategy: + fail-fast: false matrix: model: [T2T1, T2B1] asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }} @@ -136,7 +140,7 @@ jobs: exclude: - model: T2B1 env: - TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || 'R' }} + TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || matrix.model == 'T2B1' && 'R' || matrix.model }} ADDRESS_SANITIZER: ${{ matrix.asan == 'asan' && '1' || '0' }} RUSTC_BOOTSTRAP: ${{ matrix.asan == 'asan' && '1' || '0' }} RUSTFLAGS: ${{ matrix.asan == 'asan' && '-Z sanitizer=address' || '' }} @@ -155,6 +159,7 @@ jobs: runs-on: ubuntu-latest needs: core_emu strategy: + fail-fast: false matrix: model: [T2T1, T2B1] steps: @@ -180,7 +185,7 @@ jobs: strategy: fail-fast: false matrix: - model: [T2T1, T2B1] + model: [T2T1, T2B1, T3T1] coins: [universal, btconly] asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }} # T2B1 fails due to https://github.com/trezor/trezor-firmware/issues/3280 @@ -189,7 +194,7 @@ jobs: - model: T2B1 env: TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} - TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || 'R' }} + TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || matrix.model == 'T2B1' && 'R' || matrix.model }} TREZOR_PYTEST_SKIP_ALTCOINS: ${{ matrix.coins == 'btconly' && '1' || '0' }} ADDRESS_SANITIZER: ${{ matrix.asan == 'asan' && '1' || '0' }} PYTEST_TIMEOUT: ${{ matrix.asan == 'asan' && 600 || 400 }} @@ -234,8 +239,9 @@ jobs: runs-on: ubuntu-latest needs: core_emu strategy: + fail-fast: false matrix: - model: [T2T1, T2B1] + model: [T2T1, T2B1, T3T1] asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }} env: TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} @@ -280,8 +286,11 @@ jobs: runs-on: ubuntu-latest needs: core_emu strategy: + fail-fast: false matrix: - model: [T2T1] # FIXME: T2B1 https://github.com/trezor/trezor-firmware/issues/2724 + # FIXME: T2B1 https://github.com/trezor/trezor-firmware/issues/2724 + # FIXME: T3T1 https://github.com/trezor/trezor-firmware/issues/3595 + model: [T2T1] asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }} env: TREZOR_UPGRADE_TEST: core @@ -306,8 +315,9 @@ jobs: runs-on: ubuntu-latest needs: core_emu strategy: + fail-fast: false matrix: - model: [T2T1] # TODO T2B1 https://github.com/trezor/trezor-firmware/issues/2724 + model: [T2T1, T3T1] # TODO T2B1 https://github.com/trezor/trezor-firmware/issues/2724 and T3T1 asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }} env: TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} @@ -345,8 +355,9 @@ jobs: runs-on: ubuntu-latest needs: core_emu strategy: + fail-fast: false matrix: - model: [T2T1] # TODO T2B1 + model: [T2T1, T2B1, T3T1] steps: - uses: actions/checkout@v4 with: @@ -402,6 +413,7 @@ jobs: runs-on: ubuntu-latest needs: core_firmware strategy: + fail-fast: false matrix: model: [T2T1, T2B1] steps: @@ -424,6 +436,7 @@ jobs: runs-on: ubuntu-latest needs: core_firmware strategy: + fail-fast: false matrix: model: [T2T1, T2B1] steps: @@ -449,8 +462,9 @@ jobs: runs-on: ubuntu-latest needs: core_emu strategy: + fail-fast: false matrix: - model: [T2T1, T2B1] + model: [T2T1, T2B1, T3T1] asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }} env: TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} @@ -491,8 +505,9 @@ jobs: runs-on: ubuntu-latest needs: core_emu strategy: + fail-fast: false matrix: - model: [T2T1, T2B1] + model: [T2T1, T2B1, T3T1] asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }} env: TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} @@ -528,8 +543,9 @@ jobs: runs-on: ubuntu-latest needs: core_emu strategy: + fail-fast: false matrix: - model: [T2T1] # XXX T2B1 https://github.com/trezor/trezor-firmware/issues/2724 + model: [T2T1, T3T1] # XXX T2B1 https://github.com/trezor/trezor-firmware/issues/2724 asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }} env: TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} @@ -570,8 +586,9 @@ jobs: - core_u2f_test - core_fido2_test strategy: + fail-fast: false matrix: - model: [T2T1, T2B1] + model: [T2T1, T2B1, T3T1] # T2B1 fails due to https://github.com/trezor/trezor-firmware/issues/3280 # remove after single global layout is implemented (or bug above fixed): exclude: diff --git a/core/SConscript.bootloader_emu b/core/SConscript.bootloader_emu index 7339351ea..d912d3bb1 100644 --- a/core/SConscript.bootloader_emu +++ b/core/SConscript.bootloader_emu @@ -106,6 +106,10 @@ elif TREZOR_MODEL in ('R', ): SOURCE_MOD += [ 'embed/models/model_T2B1_layout.c', ] +elif TREZOR_MODEL in ('T3T1',): + SOURCE_MOD += [ + 'embed/models/model_T3T1_layout.c', + ] SOURCE_NANOPB = [ @@ -135,7 +139,7 @@ SOURCE_TREZORHAL = [ 'embed/trezorhal/unix/random_delays.c', ] -if TREZOR_MODEL in ('R', ): +if TREZOR_MODEL in ('R', 'T3T1'): SOURCE_TREZORHAL += [ 'embed/trezorhal/unix/secret.c', 'embed/trezorhal/unix/optiga_hal.c', diff --git a/core/SConscript.firmware b/core/SConscript.firmware index 999a5565f..724829d17 100644 --- a/core/SConscript.firmware +++ b/core/SConscript.firmware @@ -74,8 +74,8 @@ CPPDEFINES_MOD += [ ('USE_ETHEREUM', '1' if EVERYTHING else '0'), ('USE_MONERO', '1' if EVERYTHING else '0'), ('USE_CARDANO', '1' if EVERYTHING else '0'), - ('USE_NEM', '1' if (EVERYTHING and TREZOR_MODEL != "R") else '0'), - ('USE_EOS', '1' if (EVERYTHING and TREZOR_MODEL != "R") else '0'), + ('USE_NEM', '1' if (EVERYTHING and TREZOR_MODEL == "T") else '0'), + ('USE_EOS', '1' if (EVERYTHING and TREZOR_MODEL == "T") else '0'), ] SOURCE_MOD += [ 'embed/extmod/trezorobj.c', @@ -636,7 +636,7 @@ if FROZEN: SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/cardano/*/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Cardano*.py')) - if TREZOR_MODEL != "R": + if TREZOR_MODEL == "T": SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/eos/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/eos/*/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Eos*.py')) @@ -650,7 +650,7 @@ if FROZEN: SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/DebugMonero*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Monero*.py')) - if TREZOR_MODEL != "R": + if TREZOR_MODEL == "T": SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nem/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nem/*/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/NEM*.py')) @@ -673,7 +673,7 @@ if FROZEN: SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/webauthn/*.py')) - if TREZOR_MODEL != "R": + if TREZOR_MODEL == "T": SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/bitcoin/sign_tx/decred.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/bitcoin/sign_tx/bitcoinlike.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/bitcoin/sign_tx/zcash_v4.py')) diff --git a/core/SConscript.unix b/core/SConscript.unix index db1d8a0ad..2e85a1a70 100644 --- a/core/SConscript.unix +++ b/core/SConscript.unix @@ -8,6 +8,7 @@ BITCOIN_ONLY = ARGUMENTS.get('BITCOIN_ONLY', '0') EVERYTHING = BITCOIN_ONLY != '1' TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T') DMA2D = TREZOR_MODEL in ('T', 'T3T1') +OPTIGA = TREZOR_MODEL in ('R', 'T3T1') CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0)) if TREZOR_MODEL in ('DISC1', 'DISC2'): @@ -76,8 +77,8 @@ CPPDEFINES_MOD += [ ('USE_ETHEREUM', '1' if EVERYTHING else '0'), ('USE_MONERO', '1' if EVERYTHING else '0'), ('USE_CARDANO', '1' if EVERYTHING else '0'), - ('USE_NEM', '1' if (EVERYTHING and TREZOR_MODEL != "R") else '0'), - ('USE_EOS', '1' if (EVERYTHING and TREZOR_MODEL != "R") else '0'), + ('USE_NEM', '1' if (EVERYTHING and TREZOR_MODEL == "T") else '0'), + ('USE_EOS', '1' if (EVERYTHING and TREZOR_MODEL == "T") else '0'), ] SOURCE_MOD += [ 'embed/extmod/trezorobj.c', @@ -216,6 +217,10 @@ elif TREZOR_MODEL in ('R', ): SOURCE_MOD += [ 'embed/models/model_T2B1_layout.c', ] +elif TREZOR_MODEL in ('T3T1', ): + SOURCE_MOD += [ + 'embed/models/model_T3T1_layout.c', + ] @@ -398,7 +403,7 @@ if TREZOR_MODEL in ('T', 'R', 'T3T1'): 'embed/trezorhal/unix/sbu.c', ] -if TREZOR_MODEL == 'R': +if OPTIGA: SOURCE_UNIX += [ 'embed/trezorhal/unix/optiga.c', ] @@ -439,7 +444,7 @@ elif TREZOR_MODEL in ('1', 'R'): else: raise ValueError('Unknown Trezor model') -if TREZOR_MODEL in ('T',): +if TREZOR_MODEL in ('T', 'T3T1'): SDCARD = True SOURCE_UNIX += [ 'embed/trezorhal/unix/sdcard.c', @@ -447,6 +452,7 @@ if TREZOR_MODEL in ('T',): else: SDCARD = False + env.Tool('micropython') env.Replace( @@ -696,7 +702,7 @@ if FROZEN: SOURCE_PY_DIR + 'apps/management/sd_protect.py', ] if not SDCARD else [] + [ SOURCE_PY_DIR + 'apps/management/authenticate_device.py', - ] if TREZOR_MODEL not in ('R',) else []) + ] if not OPTIGA else []) ) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/management/*/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/misc/*.py')) @@ -717,7 +723,7 @@ if FROZEN: SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/cardano/*/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Cardano*.py')) - if TREZOR_MODEL != "R": + if TREZOR_MODEL == "T": SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/eos/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/eos/*/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Eos*.py')) @@ -731,7 +737,7 @@ if FROZEN: SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/DebugMonero*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Monero*.py')) - if TREZOR_MODEL != "R": + if TREZOR_MODEL == "T": SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nem/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nem/*/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/NEM*.py')) @@ -754,7 +760,7 @@ if FROZEN: SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/webauthn/*.py')) - if TREZOR_MODEL != "R": + if TREZOR_MODEL == "T": SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/bitcoin/sign_tx/decred.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/bitcoin/sign_tx/bitcoinlike.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/bitcoin/sign_tx/zcash_v4.py')) @@ -764,8 +770,8 @@ if FROZEN: source=SOURCE_PY, source_dir=SOURCE_PY_DIR, bitcoin_only=BITCOIN_ONLY, - backlight=TREZOR_MODEL in ('T',), - optiga=TREZOR_MODEL in ('R',), + backlight=TREZOR_MODEL in ('T', 'T3T1'), + optiga=OPTIGA, ui_layout=UI_LAYOUT, ) diff --git a/core/embed/trezorhal/boards/board-unix.h b/core/embed/trezorhal/boards/board-unix.h index bdc7acf73..c7270c741 100644 --- a/core/embed/trezorhal/boards/board-unix.h +++ b/core/embed/trezorhal/boards/board-unix.h @@ -14,6 +14,8 @@ #define USE_SD_CARD 1 #define USE_SBU 1 #define USE_RGB_COLORS 1 +#define USE_BACKLIGHT 1 +#define USE_OPTIGA 1 #endif #ifdef TREZOR_MODEL_1 @@ -28,10 +30,4 @@ #include "display-unix.h" -#ifdef TREZOR_MODEL_R -#define USE_BUTTON 1 -#elif TREZOR_MODEL_T -#define USE_TOUCH 1 -#endif - #endif //_BOARD_UNIX_H diff --git a/core/embed/trezorhal/unix/display-unix.c b/core/embed/trezorhal/unix/display-unix.c index 85fccca34..f0442cf4a 100644 --- a/core/embed/trezorhal/unix/display-unix.c +++ b/core/embed/trezorhal/unix/display-unix.c @@ -64,6 +64,13 @@ #define TOUCH_OFFSET_X 32 #define TOUCH_OFFSET_Y 84 +#elif defined TREZOR_MODEL_T3T1 + +#define WINDOW_WIDTH 400 +#define WINDOW_HEIGHT 600 +#define TOUCH_OFFSET_X 80 +#define TOUCH_OFFSET_Y 110 + #else #error Unknown Trezor model #endif @@ -284,7 +291,7 @@ void display_refresh(void) { int display_orientation(int degrees) { if (degrees != DISPLAY_ORIENTATION) { -#if defined TREZOR_MODEL_T +#if defined TREZOR_MODEL_T || defined TREZOR_MODEL_T3T1 if (degrees == 0 || degrees == 90 || degrees == 180 || degrees == 270) { #elif defined TREZOR_MODEL_1 || defined TREZOR_MODEL_R if (degrees == 0 || degrees == 180) { diff --git a/core/embed/trezorhal/unix/display-unix.h b/core/embed/trezorhal/unix/display-unix.h index d6cf2cc6b..a514af032 100644 --- a/core/embed/trezorhal/unix/display-unix.h +++ b/core/embed/trezorhal/unix/display-unix.h @@ -20,6 +20,14 @@ #define TREZOR_FONT_BPP 1 #endif +#ifdef TREZOR_MODEL_T3T1 +#define MAX_DISPLAY_RESX 240 +#define MAX_DISPLAY_RESY 240 +#define DISPLAY_RESX 240 +#define DISPLAY_RESY 240 +#define TREZOR_FONT_BPP 4 +#endif + #ifdef TREZOR_MODEL_1 #define MAX_DISPLAY_RESX 128 #define MAX_DISPLAY_RESY 64 diff --git a/core/embed/trezorhal/unix/flash.c b/core/embed/trezorhal/unix/flash.c index ee58ceb3d..afee94018 100644 --- a/core/embed/trezorhal/unix/flash.c +++ b/core/embed/trezorhal/unix/flash.c @@ -39,11 +39,14 @@ #define FLASH_SECTOR_COUNT 24 #elif defined TREZOR_MODEL_1 #define FLASH_SECTOR_COUNT 12 +#elif defined TREZOR_MODEL_T3T1 +#define FLASH_SECTOR_COUNT 256 #else #error Unknown MCU #endif -static const uint32_t FLASH_SECTOR_TABLE[FLASH_SECTOR_COUNT + 1] = { +static uint32_t FLASH_SECTOR_TABLE[FLASH_SECTOR_COUNT + 1] = { +#if defined TREZOR_MODEL_T || defined TREZOR_MODEL_R [0] = 0x08000000, // - 0x08003FFF | 16 KiB [1] = 0x08004000, // - 0x08007FFF | 16 KiB [2] = 0x08008000, // - 0x0800BFFF | 16 KiB @@ -56,7 +59,6 @@ static const uint32_t FLASH_SECTOR_TABLE[FLASH_SECTOR_COUNT + 1] = { [9] = 0x080A0000, // - 0x080BFFFF | 128 KiB [10] = 0x080C0000, // - 0x080DFFFF | 128 KiB [11] = 0x080E0000, // - 0x080FFFFF | 128 KiB -#if defined TREZOR_MODEL_T || defined TREZOR_MODEL_R [12] = 0x08100000, // - 0x08103FFF | 16 KiB [13] = 0x08104000, // - 0x08107FFF | 16 KiB [14] = 0x08108000, // - 0x0810BFFF | 16 KiB @@ -71,7 +73,22 @@ static const uint32_t FLASH_SECTOR_TABLE[FLASH_SECTOR_COUNT + 1] = { [23] = 0x081E0000, // - 0x081FFFFF | 128 KiB [24] = 0x08200000, // last element - not a valid sector #elif defined TREZOR_MODEL_1 + [0] = 0x08000000, // - 0x08003FFF | 16 KiB + [1] = 0x08004000, // - 0x08007FFF | 16 KiB + [2] = 0x08008000, // - 0x0800BFFF | 16 KiB + [3] = 0x0800C000, // - 0x0800FFFF | 16 KiB + [4] = 0x08010000, // - 0x0801FFFF | 64 KiB + [5] = 0x08020000, // - 0x0803FFFF | 128 KiB + [6] = 0x08040000, // - 0x0805FFFF | 128 KiB + [7] = 0x08060000, // - 0x0807FFFF | 128 KiB + [8] = 0x08080000, // - 0x0809FFFF | 128 KiB + [9] = 0x080A0000, // - 0x080BFFFF | 128 KiB + [10] = 0x080C0000, // - 0x080DFFFF | 128 KiB + [11] = 0x080E0000, // - 0x080FFFFF | 128 KiB [12] = 0x08100000, // last element - not a valid sector +#elif defined TREZOR_MODEL_T3T1 + [0] = 0x08000000, // - 0x08001FFF | 8 KiB + // rest is initialized in flash_init #else #error Unknown Trezor model #endif @@ -88,6 +105,13 @@ static void flash_exit(void) { void flash_init(void) { if (FLASH_BUFFER) return; +#if defined TREZOR_MODEL_T3T1 + for (size_t i = 0; i < FLASH_SECTOR_COUNT; i++) { + FLASH_SECTOR_TABLE[i + 1] = + FLASH_SECTOR_TABLE[i] + 0x2000; // 8KiB size sectors + } +#endif + FLASH_SIZE = FLASH_SECTOR_TABLE[FLASH_SECTOR_COUNT] - FLASH_SECTOR_TABLE[0]; // check whether the file exists and it has the correct size diff --git a/core/src/apps/debug/__init__.py b/core/src/apps/debug/__init__.py index f220e5ddf..476be0461 100644 --- a/core/src/apps/debug/__init__.py +++ b/core/src/apps/debug/__init__.py @@ -171,7 +171,11 @@ if __debug__: debug_events.last_event += 1 # TT click on specific coordinates, with possible hold - if x is not None and y is not None and utils.INTERNAL_MODEL in ("T2T1", "D001"): + if ( + x is not None + and y is not None + and utils.INTERNAL_MODEL in ("T2T1", "T3T1", "D001") + ): click_chan.publish((debug_events.last_event, x, y, msg.hold_ms)) # TR press specific button elif msg.physical_button is not None and utils.INTERNAL_MODEL in ("T2B1",): diff --git a/core/translations/cli.py b/core/translations/cli.py index 4e97f5a59..4061f2d23 100644 --- a/core/translations/cli.py +++ b/core/translations/cli.py @@ -15,7 +15,7 @@ from trezorlib._internal import translations HERE = Path(__file__).parent.resolve() LOG = logging.getLogger(__name__) -ALL_MODELS = {models.T2B1, models.T2T1} +ALL_MODELS = {models.T2B1, models.T2T1, models.T3T1} PRIVATE_KEYS_DEV = [byte * 32 for byte in (b"\xdd", b"\xde", b"\xdf")] diff --git a/core/translations/cs.json b/core/translations/cs.json index 95c7b1cb0..65d9ba6c8 100644 --- a/core/translations/cs.json +++ b/core/translations/cs.json @@ -13,6 +13,13 @@ "3_FONT_MONO": "font_robotomono_medium_20_cs.json", "4_FONT_BIG": null, "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_cs.json" + }, + "T3T1": { + "1_FONT_NORMAL": "font_tthoves_regular_21_cs.json", + "2_FONT_BOLD": "font_tthoves_bold_17_cs.json", + "3_FONT_MONO": "font_robotomono_medium_20_cs.json", + "4_FONT_BIG": null, + "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_cs.json" } }, "header": { diff --git a/core/translations/de.json b/core/translations/de.json index 21d5dd085..17fdc9f29 100644 --- a/core/translations/de.json +++ b/core/translations/de.json @@ -13,6 +13,13 @@ "3_FONT_MONO": "font_robotomono_medium_20_de.json", "4_FONT_BIG": null, "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_de.json" + }, + "T3T1": { + "1_FONT_NORMAL": "font_tthoves_regular_21_de.json", + "2_FONT_BOLD": "font_tthoves_bold_17_de.json", + "3_FONT_MONO": "font_robotomono_medium_20_de.json", + "4_FONT_BIG": null, + "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_de.json" } }, "header": { diff --git a/core/translations/es.json b/core/translations/es.json index 21ce8ce46..7380ee6f0 100644 --- a/core/translations/es.json +++ b/core/translations/es.json @@ -13,6 +13,13 @@ "3_FONT_MONO": "font_robotomono_medium_20_es.json", "4_FONT_BIG": null, "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_es.json" + }, + "T3T1": { + "1_FONT_NORMAL": "font_tthoves_regular_21_es.json", + "2_FONT_BOLD": "font_tthoves_bold_17_es.json", + "3_FONT_MONO": "font_robotomono_medium_20_es.json", + "4_FONT_BIG": null, + "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_es.json" } }, "header": { diff --git a/core/translations/fr.json b/core/translations/fr.json index 6b6251917..c6dbd7fc2 100644 --- a/core/translations/fr.json +++ b/core/translations/fr.json @@ -13,6 +13,13 @@ "3_FONT_MONO": "font_robotomono_medium_20_fr.json", "4_FONT_BIG": null, "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_fr.json" + }, + "T3T1": { + "1_FONT_NORMAL": "font_tthoves_regular_21_fr.json", + "2_FONT_BOLD": "font_tthoves_bold_17_fr.json", + "3_FONT_MONO": "font_robotomono_medium_20_fr.json", + "4_FONT_BIG": null, + "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_fr.json" } }, "header": { diff --git a/core/translations/signatures.json b/core/translations/signatures.json index 6a06ab080..88a0b9b5d 100644 --- a/core/translations/signatures.json +++ b/core/translations/signatures.json @@ -1,9 +1,9 @@ { "current": { - "merkle_root": "b9a0dc0b332ec7edf5260447965a2ebcc66b5315c8803eb8cd0439d1022bd188", + "merkle_root": "8eb1e04215ee1e9c083b6abef4eae47a2f6c9ad3d8e8b8e0542505b7e0078b58", "signature": null, - "datetime": "2024-02-26T13:15:23.679059", - "commit": "a487c0d55b27b8d3d566b50d0225db06899ea08d" + "datetime": "2024-03-08T20:33:12.745274", + "commit": "1005d857f8d4ee2ccee70fa8407052df7b7d1c13" }, "history": [] }