mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-04-15 23:05:45 +00:00
Merge branch 'trezor:main' into main
This commit is contained in:
commit
1a5b5344dc
.github
.gitlab-ci.ymlMakefilebuild-docker.shci
common
defs
protob
messages-benchmark.protomessages-bitcoin.protomessages-common.protomessages-crypto.protomessages-debug.protomessages-ethereum.protomessages-management.protomessages-thp.protomessages.protooptions.protopb2py
tests/fixtures/cardano
tools
core
.changelog.d
2299.changed3536.fixed3627.fixed3633.changed3692.fixed3813.fixed3863.added3947.fixed4019.fixed4041.added4047.added4101.added4161.fixed4165.fixed4167.fixed4176.fixed4271.added4294.fixed4295.fixed4302.added4302.added.14302.added.24302.added.34302.fixed4309.fixed4326.fixed4351.added4351.changed.14351.changed.24351.changed.34402.fixed
CHANGELOG.T2B1.mdCHANGELOG.T2T1.mdCHANGELOG.T3B1.mdCHANGELOG.T3T1.mdCHANGELOG.mdMakefileSConscript.boardloaderSConscript.bootloaderSConscript.bootloader_ciSConscript.bootloader_emuSConscript.firmwareSConscript.kernelSConscript.prodtestSConscript.reflashSConscript.unixSConstructembed
boardloader
bootloader
bootloader_ci
firmware
gfx
4
.github/actions/ui-report/action.yml
vendored
4
.github/actions/ui-report/action.yml
vendored
@ -38,12 +38,12 @@ runs:
|
||||
shell: sh
|
||||
- name: Upload report
|
||||
run: |
|
||||
aws s3 sync --no-progress ${{ github.run_id }} s3://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}
|
||||
aws s3 sync --only-show-errors ${{ github.run_id }} s3://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}
|
||||
echo "[UI test report](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/${{ inputs.model }}-${{ inputs.lang }}-${{ github.job }}/index.html)" >> $GITHUB_STEP_SUMMARY
|
||||
shell: sh
|
||||
- name: Upload test screen recording
|
||||
run: |
|
||||
aws s3 sync --no-progress ci/ui_test_records s3://data.trezor.io/dev/firmware/ui_tests
|
||||
aws s3 sync --only-show-errors ci/ui_test_records s3://data.trezor.io/dev/firmware/ui_tests
|
||||
# TODO: generate directory listing / autoindex
|
||||
shell: sh
|
||||
- uses: actions/upload-artifact@v4
|
||||
|
17
.github/pull_request_template.md
vendored
17
.github/pull_request_template.md
vendored
@ -1,12 +1,11 @@
|
||||
<!--
|
||||
If you are a core dev:
|
||||
For core developers:
|
||||
- Assign yourself to the PR.
|
||||
- Set the priority to match the original issue.
|
||||
- Add the PR to the current sprint.
|
||||
- If it's a draft PR, mark it as "In Progress."
|
||||
- If it's a final PR, mark it as "Needs Review."
|
||||
|
||||
Don't forget to set up the fields:
|
||||
- assign yourself
|
||||
- set priority to same as original issue
|
||||
- add PR to sprint
|
||||
- if Draft -> "in progress"
|
||||
- if final PR -> "needs review"
|
||||
|
||||
If you're an external contributor, you can ignore this text.
|
||||
For external contributors:
|
||||
- Please open an issue before submitting a PR so we can discuss whether we want to proceed with it.
|
||||
-->
|
||||
|
8
.github/workflows/cflite.yml
vendored
8
.github/workflows/cflite.yml
vendored
@ -1,10 +1,18 @@
|
||||
name: ClusterFuzzLite PR fuzzing
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
paths:
|
||||
- '**'
|
||||
|
||||
# cancel any previous runs on the same PR
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
PR:
|
||||
runs-on: ubuntu-latest
|
||||
|
5
.github/workflows/common.yml
vendored
5
.github/workflows/common.yml
vendored
@ -6,6 +6,11 @@ on:
|
||||
schedule:
|
||||
- cron: '14 23 * * *' # every day @ 23:14
|
||||
|
||||
# cancel any previous runs on the same PR
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
crypto_build:
|
||||
name: Crypto library
|
||||
|
2
.github/workflows/core-hw.yml
vendored
2
.github/workflows/core-hw.yml
vendored
@ -6,7 +6,7 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
# [Device tests](../tests/device-tests.md) that run against an actual physical Trezors.
|
||||
# The device needs to have special bootloader, found in `core/embed/bootloader_ci`, that
|
||||
# The device needs to have special bootloader, found in `core/embed/projects/bootloader_ci`, that
|
||||
# makes it possible to flash firmware without confirmation on the touchscreen.
|
||||
#
|
||||
# All hardware tests are run nightly on the `main` branch,
|
||||
|
63
.github/workflows/core.yml
vendored
63
.github/workflows/core.yml
vendored
@ -11,6 +11,11 @@ on:
|
||||
schedule:
|
||||
- cron: '15 23 * * *' # every day @ 23:15
|
||||
|
||||
# cancel any previous runs on the same PR
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
id-token: write # for fetching the OIDC token
|
||||
contents: read # for actions/checkout
|
||||
@ -21,7 +26,7 @@ env:
|
||||
|core UI changes|device test|click test|persistence test|
|
||||
|---------------|-----------|----------|----------------|
|
||||
|T2T1 Model T |<img src="https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T2T1-en-core_device_test/status.png" width="24" height="20px" /> [test](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T2T1-en-core_device_test/index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T2T1-en-core_device_test/differing_screens.html)) [main](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T2T1-en-core_device_test/master_index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T2T1-en-core_device_test/master_diff.html)) |<img src="https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T2T1-en-core_click_test/status.png" width="20px" height="20px" /> [test](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T2T1-en-core_click_test/index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T2T1-en-core_click_test/differing_screens.html)) [main](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T2T1-en-core_click_test/master_index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T2T1-en-core_click_test/master_diff.html)) |<img src="https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T2T1-en-core_persistence_test/status.png" width="20px" height="20px" /> [test](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T2T1-en-core_persistence_test/index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T2T1-en-core_persistence_test/differing_screens.html)) [main](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T2T1-en-core_persistence_test/master_index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T2T1-en-core_persistence_test/master_diff.html))||
|
||||
|T3B1 Safe 3 |<img src="https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_device_test/status.png" width="20px" height="20px" /> [test](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_device_test/index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_device_test/differing_screens.html)) [main](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_device_test/master_index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_device_test/master_diff.html)) |<img src="https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_click_test/status.png" width="20px" height="20px" /> [test](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_click_test/index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_click_test/differing_screens.html)) [main](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_click_test/master_index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_click_test/master_diff.html)) |[2724](https://github.com/trezor/trezor-firmware/issues/2724) ||
|
||||
|T3B1 Safe 3 |<img src="https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_device_test/status.png" width="20px" height="20px" /> [test](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_device_test/index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_device_test/differing_screens.html)) [main](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_device_test/master_index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_device_test/master_diff.html)) |<img src="https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_click_test/status.png" width="20px" height="20px" /> [test](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_click_test/index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_click_test/differing_screens.html)) [main](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_click_test/master_index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_click_test/master_diff.html)) |<img src="https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_persistence_test/status.png" width="20px" height="20px" /> [test](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_persistence_test/index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_persistence_test/differing_screens.html)) [main](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_persistence_test/master_index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3B1-en-core_persistence_test/master_diff.html))||
|
||||
|T3T1 Safe 5 |<img src="https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3T1-en-core_device_test/status.png" width="20px" height="20px" /> [test](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3T1-en-core_device_test/index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3T1-en-core_device_test/differing_screens.html)) [main](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3T1-en-core_device_test/master_index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3T1-en-core_device_test/master_diff.html)) |<img src="https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3T1-en-core_click_test/status.png" width="20px" height="20px" /> [test](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3T1-en-core_click_test/index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3T1-en-core_click_test/differing_screens.html)) [main](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3T1-en-core_click_test/master_index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3T1-en-core_click_test/master_diff.html)) |<img src="https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3T1-en-core_persistence_test/status.png" width="20px" height="20px" /> [test](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3T1-en-core_persistence_test/index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3T1-en-core_persistence_test/differing_screens.html)) [main](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3T1-en-core_persistence_test/master_index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T3T1-en-core_persistence_test/master_diff.html))||
|
||||
|All |<img src="https://data.trezor.io/dev/firmware/master_diff/${{ github.run_id }}/status.png" width="20px" height="20px" /> [main](https://data.trezor.io/dev/firmware/master_diff/${{ github.run_id }}/index.html)([screens](https://data.trezor.io/dev/firmware/master_diff/${{ github.run_id }}/master_diff.html)) ||
|
||||
|
||||
@ -53,6 +58,9 @@ jobs:
|
||||
- model: D001
|
||||
coins: universal
|
||||
type: normal
|
||||
exclude:
|
||||
- model: T3W1
|
||||
type: production
|
||||
env:
|
||||
TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || matrix.model == 'D001' && 'DISC1' || matrix.model }}
|
||||
BITCOIN_ONLY: ${{ matrix.coins == 'universal' && '0' || '1' }}
|
||||
@ -116,7 +124,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.asan == 'noasan'
|
||||
- run: nix-shell --run "poetry run make -C core build_unix_frozen"
|
||||
- run: cp core/build/unix/trezor-emu-core core/build/unix/trezor-emu-core-${{ matrix.model }}-${{ matrix.coins }}
|
||||
- uses: actions/upload-artifact@v4
|
||||
@ -283,8 +291,6 @@ jobs:
|
||||
status: ${{ job.status }}
|
||||
if: ${{ always() && env.ACTIONS_DO_UI_TEST == 'true' }}
|
||||
continue-on-error: true
|
||||
- uses: ./.github/actions/ui-comment
|
||||
if: ${{ failure() && env.ACTIONS_DO_UI_TEST == 'true' }}
|
||||
- uses: ./.github/actions/upload-coverage
|
||||
|
||||
# Click tests - UI.
|
||||
@ -380,7 +386,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
model: [T2T1, T3T1] # TODO T3B1 https://github.com/trezor/trezor-firmware/issues/2724
|
||||
model: [T2T1, T3B1, T3T1]
|
||||
asan: ${{ fromJSON(needs.param.outputs.asan) }}
|
||||
env:
|
||||
TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }}
|
||||
@ -697,24 +703,17 @@ jobs:
|
||||
fi
|
||||
- name: Upload diff from main branch
|
||||
run: |
|
||||
aws s3 sync --no-progress master_diff s3://data.trezor.io/dev/firmware/master_diff/${{ github.run_id }}
|
||||
aws s3 sync --only-show-errors master_diff s3://data.trezor.io/dev/firmware/master_diff/${{ github.run_id }}
|
||||
continue-on-error: true
|
||||
|
||||
core_ui_comment:
|
||||
name: Post comment with UI diff URLs
|
||||
if: github.event_name == 'pull_request'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- run: |
|
||||
git fetch origin main
|
||||
git diff --quiet origin/main...HEAD -- tests/ui_tests/fixtures.json || echo "FIXTURES_CHANGED=$?" >> $GITHUB_OUTPUT
|
||||
id: check-fixtures-changed
|
||||
- run: sleep 1m # try avoiding github api rate limit
|
||||
- uses: ./.github/actions/ui-comment
|
||||
# TODO: always run if comment already exists
|
||||
if: ${{ steps.check-fixtures-changed.outputs.FIXTURES_CHANGED == '1' }}
|
||||
|
||||
core_upload_emu:
|
||||
name: Upload emulator binaries
|
||||
@ -736,7 +735,39 @@ jobs:
|
||||
continue-on-error: true
|
||||
- run: |
|
||||
rm unix/trezor-emu-core
|
||||
aws s3 sync --no-progress unix s3://data.trezor.io/dev/firmware/emu-nightly
|
||||
aws s3 sync --only-show-errors unix s3://data.trezor.io/dev/firmware/emu-nightly
|
||||
|
||||
core_upload_emu_branch:
|
||||
name: Upload emulator binaries for the current branch
|
||||
# Not building it for nightly CI
|
||||
if: github.event_name != 'schedule'
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
# Do not include ARM, they are only built on nightly
|
||||
- core_emu
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: core-emu*debuglink-noasan
|
||||
merge-multiple: true
|
||||
- name: Configure aws credentials
|
||||
uses: aws-actions/configure-aws-credentials@v4
|
||||
with:
|
||||
role-to-assume: arn:aws:iam::538326561891:role/gh_actions_deploy_dev_firmware_data
|
||||
aws-region: eu-west-1
|
||||
continue-on-error: true
|
||||
- name: Determine branch name
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" == "pull_request" ]; then
|
||||
branch_name=${{ github.head_ref }}
|
||||
else
|
||||
branch_name=${{ github.ref_name }}
|
||||
fi
|
||||
echo "branch_name=$branch_name" >> $GITHUB_ENV
|
||||
- name: Upload artifacts to branch directory
|
||||
run: |
|
||||
rm unix/trezor-emu-core
|
||||
aws s3 sync --only-show-errors unix s3://data.trezor.io/dev/firmware/emu-branches/$branch_name
|
||||
|
||||
# Connect
|
||||
# TODO: core_connect_test
|
||||
|
29
.github/workflows/legacy.yml
vendored
29
.github/workflows/legacy.yml
vendored
@ -6,6 +6,11 @@ on:
|
||||
schedule:
|
||||
- cron: '35 22 * * *' # every day @ 22:35
|
||||
|
||||
# cancel any previous runs on the same PR
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
id-token: write # for fetching the OIDC token
|
||||
contents: read # for actions/checkout
|
||||
@ -134,8 +139,8 @@ jobs:
|
||||
status: ${{ job.status }}
|
||||
continue-on-error: true
|
||||
if: ${{ always() && matrix.coins == 'universal' }}
|
||||
- uses: ./.github/actions/ui-comment
|
||||
if: ${{ failure() && matrix.coins == 'universal' }}
|
||||
- run: echo "${{ env.PULL_COMMENT }}" >> $GITHUB_STEP_SUMMARY
|
||||
if: ${{ always() && matrix.coins == 'universal' }}
|
||||
|
||||
legacy_upgrade_test:
|
||||
name: Upgrade test
|
||||
@ -211,25 +216,9 @@ jobs:
|
||||
fi
|
||||
- name: Upload main branch diff
|
||||
run: |
|
||||
aws s3 sync --no-progress master_diff s3://data.trezor.io/dev/firmware/master_diff/${{ github.run_id }}
|
||||
aws s3 sync --only-show-errors master_diff s3://data.trezor.io/dev/firmware/master_diff/${{ github.run_id }}
|
||||
continue-on-error: true
|
||||
|
||||
legacy_ui_comment:
|
||||
name: Post comment with UI diff URLs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- run: |
|
||||
git fetch origin main
|
||||
git diff --quiet origin/main...HEAD -- tests/ui_tests/fixtures.json || echo "FIXTURES_CHANGED=$?" >> $GITHUB_OUTPUT
|
||||
id: check-fixtures-changed
|
||||
- uses: ./.github/actions/ui-comment
|
||||
# TODO: always run if comment already exists
|
||||
if: ${{ steps.check-fixtures-changed.outputs.FIXTURES_CHANGED == '1' }}
|
||||
|
||||
legacy_upload_emu:
|
||||
name: Upload emulator binaries
|
||||
if: github.event_name == 'schedule'
|
||||
@ -251,4 +240,4 @@ jobs:
|
||||
- run: |
|
||||
mkdir emulators
|
||||
cp trezor-emu-* emulators
|
||||
aws s3 sync --no-progress emulators s3://data.trezor.io/dev/firmware/emu-nightly
|
||||
aws s3 sync --only-show-errors emulators s3://data.trezor.io/dev/firmware/emu-nightly
|
||||
|
5
.github/workflows/prebuild.yml
vendored
5
.github/workflows/prebuild.yml
vendored
@ -6,6 +6,11 @@ on:
|
||||
schedule:
|
||||
- cron: '13 23 * * *' # every day @ 23:13
|
||||
|
||||
# cancel any previous runs on the same PR
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CARGOLOCK_COMMENT: Looks like you changed `Cargo.lock`. Please make sure to review the dependencies and update [internal version list](https://www.notion.so/satoshilabs/Rust-dependencies-a9cc6e8dab934def8eb27896c001e6e2).
|
||||
|
||||
|
@ -38,7 +38,7 @@ before_script:
|
||||
- . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh || true
|
||||
- $NIX_SHELL --run "poetry install --sync"
|
||||
- export LEGACY_VERSION=$($NIX_SHELL --run "./tools/version.sh legacy/firmware/version.h")
|
||||
- export CORE_VERSION=$($NIX_SHELL --run "./tools/version.sh core/embed/firmware/version.h")
|
||||
- export CORE_VERSION=$($NIX_SHELL --run "./tools/version.sh core/embed/projects/firmware/version.h")
|
||||
|
||||
include:
|
||||
- ci/environment.yml
|
||||
|
6
Makefile
6
Makefile
@ -53,9 +53,9 @@ pystyle: ## apply code style on application sources and tests
|
||||
|
||||
changelog_check: ## check changelog format
|
||||
./tools/generate-changelog.py --check core
|
||||
./tools/generate-changelog.py --check core/embed/boardloader
|
||||
./tools/generate-changelog.py --check core/embed/bootloader
|
||||
./tools/generate-changelog.py --check core/embed/bootloader_ci
|
||||
./tools/generate-changelog.py --check core/embed/projects/boardloader
|
||||
./tools/generate-changelog.py --check core/embed/projects/bootloader
|
||||
./tools/generate-changelog.py --check core/embed/projects/bootloader_ci
|
||||
./tools/generate-changelog.py --check legacy/bootloader
|
||||
./tools/generate-changelog.py --check legacy/firmware
|
||||
./tools/generate-changelog.py --check legacy/intermediate_fw
|
||||
|
@ -72,7 +72,7 @@ INIT=1
|
||||
MODELS=(R T T3T1)
|
||||
CORE_TARGETS=(boardloader bootloader firmware)
|
||||
|
||||
REPOSITORY="/local"
|
||||
REPOSITORY="file:///local"
|
||||
|
||||
while true; do
|
||||
case "$1" in
|
||||
@ -185,6 +185,11 @@ if [ $INIT -eq 1 ]; then
|
||||
echo ">>> DOCKER BUILD ALPINE_VERSION=$ALPINE_VERSION ALPINE_ARCH=$ALPINE_ARCH NIX_VERSION=$NIX_VERSION -t $CONTAINER_NAME"
|
||||
echo
|
||||
|
||||
# some Nix installations have problem with shell.nix -> ci/shell.nix symlink
|
||||
# docker can't handle ci/shell.nix -> shell.nix
|
||||
# let's copy the file and try to fix paths ...
|
||||
sed "s|./ci/|./|" < shell.nix > ci/shell.nix
|
||||
|
||||
$DOCKER build \
|
||||
--network=host \
|
||||
--build-arg ALPINE_VERSION="$ALPINE_VERSION" \
|
||||
@ -199,7 +204,7 @@ if [ $INIT -eq 1 ]; then
|
||||
|
||||
mkdir -p /reproducible-build
|
||||
cd /reproducible-build
|
||||
git clone "$REPOSITORY" trezor-firmware
|
||||
git clone --branch="$TAG" --depth=1 "$REPOSITORY" trezor-firmware
|
||||
cd trezor-firmware
|
||||
EOF
|
||||
|
||||
@ -219,8 +224,6 @@ fi # init
|
||||
# append common part to script
|
||||
cat <<EOF >> "$SCRIPT_NAME"
|
||||
$GIT_CLEAN_REPO
|
||||
git fetch origin "$COMMIT_HASH"
|
||||
git checkout "$COMMIT_HASH"
|
||||
git submodule update --init --recursive
|
||||
poetry install
|
||||
cd core/embed/rust
|
||||
@ -282,7 +285,7 @@ for TREZOR_MODEL in ${MODELS[@]}; do
|
||||
set -e -o pipefail
|
||||
cd /reproducible-build/trezor-firmware/core
|
||||
$GIT_CLEAN_REPO
|
||||
poetry run make clean vendor $MAKE_TARGETS
|
||||
poetry run make clean vendor $MAKE_TARGETS QUIET_MODE=1
|
||||
for item in bootloader firmware prodtest; do
|
||||
if [ -f build/\$item/\$item.bin ]; then
|
||||
poetry run ../python/tools/firmware-fingerprint.py \
|
||||
|
@ -5,10 +5,10 @@ set -u
|
||||
base_branch=main
|
||||
fail=0
|
||||
subdirs="core
|
||||
core/embed/boardloader
|
||||
core/embed/bootloader
|
||||
core/embed/bootloader_ci
|
||||
core/embed/prodtest
|
||||
core/embed/projects/boardloader
|
||||
core/embed/projects/bootloader
|
||||
core/embed/projects/bootloader_ci
|
||||
core/embed/projects/prodtest
|
||||
legacy/bootloader
|
||||
legacy/firmware
|
||||
legacy/intermediate_fw
|
||||
|
@ -12,7 +12,7 @@ release core fw regular deploy:
|
||||
needs:
|
||||
- core fw regular build
|
||||
script:
|
||||
- export VERSION=$(./tools/version.sh core/embed/firmware/version.h)
|
||||
- export VERSION=$(./tools/version.sh core/embed/projects/firmware/version.h)
|
||||
- export NAME="firmware-T2T1-$VERSION-$CI_COMMIT_SHORT_SHA.bin"
|
||||
- echo "Deploying to ${DEPLOY_DIRECTORY}/$NAME"
|
||||
- mkdir -p "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}"
|
||||
@ -34,7 +34,7 @@ release core fw btconly deploy:
|
||||
needs:
|
||||
- core fw btconly build
|
||||
script:
|
||||
- export VERSION=$(./tools/version.sh core/embed/firmware/version.h)
|
||||
- export VERSION=$(./tools/version.sh core/embed/projects/firmware/version.h)
|
||||
- export NAME="firmware-T2T1-btconly-$VERSION-$CI_COMMIT_SHORT_SHA.bin"
|
||||
- echo "Deploying to ${DEPLOY_DIRECTORY}/$NAME"
|
||||
- mkdir -p "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}"
|
||||
@ -56,7 +56,7 @@ release core fw regular debug deploy:
|
||||
needs:
|
||||
- core fw regular debug build
|
||||
script:
|
||||
- export VERSION=$(./tools/version.sh core/embed/firmware/version.h)
|
||||
- export VERSION=$(./tools/version.sh core/embed/projects/firmware/version.h)
|
||||
- export NAME="firmware-T2T1-debug-$VERSION-$CI_COMMIT_SHORT_SHA.bin"
|
||||
- echo "Deploying to ${DEPLOY_DIRECTORY}/$NAME"
|
||||
- mkdir -p "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}"
|
||||
@ -78,7 +78,7 @@ release core fw btconly debug deploy:
|
||||
needs:
|
||||
- core fw btconly debug build
|
||||
script:
|
||||
- export VERSION=$(./tools/version.sh core/embed/firmware/version.h)
|
||||
- export VERSION=$(./tools/version.sh core/embed/projects/firmware/version.h)
|
||||
- export NAME="firmware-T2T1-btconly-debug-$VERSION-$CI_COMMIT_SHORT_SHA.bin"
|
||||
- echo "Deploying to ${DEPLOY_DIRECTORY}/$NAME"
|
||||
- mkdir -p "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}"
|
||||
@ -193,7 +193,7 @@ release core unix debug deploy:
|
||||
- core unix frozen debug build
|
||||
- core unix frozen debug build arm
|
||||
script:
|
||||
- export VERSION=$(./tools/version.sh core/embed/firmware/version.h)
|
||||
- export VERSION=$(./tools/version.sh core/embed/projects/firmware/version.h)
|
||||
- DEST="$DEPLOY_PATH/trezor-emu-core-v$VERSION"
|
||||
- DEST_ARM="$DEPLOY_PATH/arm/trezor-emu-core-v$VERSION-arm"
|
||||
- echo "Deploying to $DEST and $DEST_ARM"
|
||||
|
44
common/defs/bitcoin/ecash.json
Normal file
44
common/defs/bitcoin/ecash.json
Normal file
@ -0,0 +1,44 @@
|
||||
{
|
||||
"coin_name": "Ecash",
|
||||
"coin_shortcut": "XEC",
|
||||
"coin_label": "eCash",
|
||||
"website": "https://e.cash",
|
||||
"github": "https://github.com/Bitcoin-ABC/bitcoin-abc",
|
||||
"maintainer": "Fabien <fabcien@gmail.com>",
|
||||
"curve_name": "secp256k1",
|
||||
"decimals": 2,
|
||||
"address_type": 0,
|
||||
"address_type_p2sh": 5,
|
||||
"maxfee_kb": 14000000,
|
||||
"minfee_kb": 1000,
|
||||
"signed_message_header": "eCash Signed Message:\n",
|
||||
"hash_genesis_block": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
|
||||
"xprv_magic": 76066276,
|
||||
"xpub_magic": 76067358,
|
||||
"xpub_magic_segwit_p2sh": null,
|
||||
"xpub_magic_segwit_native": null,
|
||||
"xpub_magic_multisig_segwit_p2sh": null,
|
||||
"xpub_magic_multisig_segwit_native": null,
|
||||
"bech32_prefix": null,
|
||||
"cashaddr_prefix": "ecash",
|
||||
"slip44": 899,
|
||||
"segwit": false,
|
||||
"taproot": false,
|
||||
"decred": false,
|
||||
"fork_id": 0,
|
||||
"force_bip143": true,
|
||||
"default_fee_b": {
|
||||
"Normal": 1
|
||||
},
|
||||
"dust_limit": 546,
|
||||
"blocktime_seconds": 600,
|
||||
"uri_prefix": "ecash",
|
||||
"min_address_length": 27,
|
||||
"max_address_length": 34,
|
||||
"negative_fee": false,
|
||||
"cooldown": 100,
|
||||
"overwintered": false,
|
||||
"extra_data": false,
|
||||
"timestamp": false,
|
||||
"confidential_assets": null
|
||||
}
|
BIN
common/defs/bitcoin/ecash.png
Normal file
BIN
common/defs/bitcoin/ecash.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 5.3 KiB |
@ -1 +1 @@
|
||||
2024-08-26T14:28:10+00:00
|
||||
2024-09-06T13:07:11+00:00
|
||||
|
@ -41,6 +41,7 @@
|
||||
"bitcoin:VIA": "1.6.2",
|
||||
"bitcoin:VIPS": "1.8.2",
|
||||
"bitcoin:VTC": "1.6.1",
|
||||
"bitcoin:XEC": "1.12.2",
|
||||
"bitcoin:XPM": "1.8.0",
|
||||
"bitcoin:XRC": "1.8.2",
|
||||
"bitcoin:XSN": "1.8.0",
|
||||
@ -147,6 +148,7 @@
|
||||
"bitcoin:UNO": "2.6.1",
|
||||
"bitcoin:VIA": "2.6.1",
|
||||
"bitcoin:VIPS": "2.6.1",
|
||||
"bitcoin:XEC": "2.8.6",
|
||||
"bitcoin:XPM": "2.6.1",
|
||||
"bitcoin:XRC": "2.6.1",
|
||||
"bitcoin:XSN": "2.6.1",
|
||||
@ -269,6 +271,7 @@
|
||||
"bitcoin:VIA": "2.0.7",
|
||||
"bitcoin:VIPS": "2.1.1",
|
||||
"bitcoin:VTC": "2.0.5",
|
||||
"bitcoin:XEC": "2.8.6",
|
||||
"bitcoin:XPM": "2.0.11",
|
||||
"bitcoin:XRC": "2.1.1",
|
||||
"bitcoin:XSN": "2.0.11",
|
||||
@ -375,6 +378,7 @@
|
||||
"bitcoin:UNO": "2.8.1",
|
||||
"bitcoin:VIA": "2.8.1",
|
||||
"bitcoin:VIPS": "2.8.1",
|
||||
"bitcoin:XEC": "2.8.6",
|
||||
"bitcoin:XPM": "2.8.1",
|
||||
"bitcoin:XRC": "2.8.1",
|
||||
"bitcoin:XSN": "2.8.1",
|
||||
@ -489,6 +493,7 @@
|
||||
"bitcoin:UNO": "2.6.1",
|
||||
"bitcoin:VIA": "2.6.1",
|
||||
"bitcoin:VIPS": "2.6.1",
|
||||
"bitcoin:XEC": "2.8.6",
|
||||
"bitcoin:XPM": "2.6.1",
|
||||
"bitcoin:XRC": "2.6.1",
|
||||
"bitcoin:XSN": "2.6.1",
|
||||
@ -603,6 +608,7 @@
|
||||
"bitcoin:UNO": "2.6.1",
|
||||
"bitcoin:VIA": "2.6.1",
|
||||
"bitcoin:VIPS": "2.6.1",
|
||||
"bitcoin:XEC": "2.8.6",
|
||||
"bitcoin:XPM": "2.6.1",
|
||||
"bitcoin:XRC": "2.6.1",
|
||||
"bitcoin:XSN": "2.6.1",
|
||||
|
@ -5,6 +5,10 @@ package hw.trezor.messages.bitcoin;
|
||||
option java_package = "com.satoshilabs.trezor.lib.protobuf";
|
||||
option java_outer_classname = "TrezorMessageBenchmark";
|
||||
|
||||
import "options.proto";
|
||||
|
||||
option (include_in_bitcoin_only) = true;
|
||||
|
||||
/**
|
||||
* Request: Ask device for a list of names of all supported benchmarks
|
||||
* @start
|
||||
|
@ -5,10 +5,10 @@ package hw.trezor.messages.bitcoin;
|
||||
option java_package = "com.satoshilabs.trezor.lib.protobuf";
|
||||
option java_outer_classname = "TrezorMessageBitcoin";
|
||||
|
||||
option (include_in_bitcoin_only) = true;
|
||||
|
||||
import "messages.proto";
|
||||
import "messages-common.proto";
|
||||
import "options.proto";
|
||||
|
||||
option (include_in_bitcoin_only) = true;
|
||||
|
||||
/**
|
||||
* Type of script which will be used for transaction input
|
||||
@ -53,16 +53,22 @@ enum AmountUnit {
|
||||
SATOSHI = 3; // sat
|
||||
}
|
||||
|
||||
enum MultisigPubkeysOrder {
|
||||
PRESERVED = 0; // order of pubkeys is preserved
|
||||
LEXICOGRAPHIC = 1; // pubkeys are sorted lexicographically (BIP-67)
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of redeem script used in input
|
||||
* @embed
|
||||
*/
|
||||
message MultisigRedeemScriptType {
|
||||
repeated HDNodePathType pubkeys = 1; // pubkeys from multisig address (sorted lexicographically)
|
||||
repeated HDNodePathType pubkeys = 1; // this field is deprecated and will be removed in the future, use nodes together with address_n instead
|
||||
repeated bytes signatures = 2; // existing signatures for partially signed input
|
||||
required uint32 m = 3; // "m" from n, how many valid signatures is necessary for spending
|
||||
repeated common.HDNodeType nodes = 4; // simplified way how to specify pubkeys if they share the same address_n path
|
||||
repeated uint32 address_n = 5; // use only field 1 or fields 4+5, if fields 4+5 are used, field 1 is ignored
|
||||
repeated common.HDNodeType nodes = 4;
|
||||
repeated uint32 address_n = 5; // path to derive pubkeys from nodes
|
||||
optional MultisigPubkeysOrder pubkeys_order = 6 [default=PRESERVED]; // order of pubkeys in script pubkey
|
||||
/**
|
||||
* Structure representing HDNode + Path
|
||||
*/
|
||||
@ -625,4 +631,3 @@ message AuthorizeCoinJoin {
|
||||
optional InputScriptType script_type = 7 [default=SPENDADDRESS]; // used to distinguish between various address formats (non-segwit, segwit, etc.)
|
||||
optional AmountUnit amount_unit = 8 [default=BITCOIN]; // show amounts in
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,9 @@ package hw.trezor.messages.common;
|
||||
option java_package = "com.satoshilabs.trezor.lib.protobuf";
|
||||
option java_outer_classname = "TrezorMessageCommon";
|
||||
|
||||
option (include_in_bitcoin_only) = true;
|
||||
import "options.proto";
|
||||
|
||||
import "messages.proto";
|
||||
option (include_in_bitcoin_only) = true;
|
||||
|
||||
/**
|
||||
* Response: Success of the previous request
|
||||
|
@ -5,9 +5,9 @@ package hw.trezor.messages.crypto;
|
||||
option java_package = "com.satoshilabs.trezor.lib.protobuf";
|
||||
option java_outer_classname = "TrezorMessageCrypto";
|
||||
|
||||
option (include_in_bitcoin_only) = true;
|
||||
import "options.proto";
|
||||
|
||||
import "messages.proto";
|
||||
option (include_in_bitcoin_only) = true;
|
||||
|
||||
/**
|
||||
* Request: Ask device to encrypt or decrypt value of given key
|
||||
|
@ -5,11 +5,11 @@ package hw.trezor.messages.debug;
|
||||
option java_package = "com.satoshilabs.trezor.lib.protobuf";
|
||||
option java_outer_classname = "TrezorMessageDebug";
|
||||
|
||||
option (include_in_bitcoin_only) = true;
|
||||
|
||||
import "messages.proto";
|
||||
import "messages-common.proto";
|
||||
import "messages-management.proto";
|
||||
import "options.proto";
|
||||
|
||||
option (include_in_bitcoin_only) = true;
|
||||
|
||||
/**
|
||||
* Request: "Press" the button on the device
|
||||
@ -51,7 +51,7 @@ message DebugLinkDecision {
|
||||
|
||||
optional uint32 x = 4; // touch X coordinate
|
||||
optional uint32 y = 5; // touch Y coordinate
|
||||
optional bool wait = 6; // wait for layout change
|
||||
optional bool wait = 6 [deprecated=true]; // wait for layout change
|
||||
optional uint32 hold_ms = 7; // touch hold duration
|
||||
optional DebugPhysicalButton physical_button = 8; // physical button press
|
||||
}
|
||||
@ -61,6 +61,7 @@ message DebugLinkDecision {
|
||||
* @end
|
||||
*/
|
||||
message DebugLinkLayout {
|
||||
option deprecated = true;
|
||||
repeated string tokens = 1;
|
||||
}
|
||||
|
||||
@ -89,9 +90,26 @@ message DebugLinkRecordScreen {
|
||||
* @next DebugLinkState
|
||||
*/
|
||||
message DebugLinkGetState {
|
||||
optional bool wait_word_list = 1; // Trezor T only - wait until mnemonic words are shown
|
||||
optional bool wait_word_pos = 2; // Trezor T only - wait until reset word position is requested
|
||||
optional bool wait_layout = 3; // wait until current layout changes
|
||||
/// Wait behavior of the call.
|
||||
enum DebugWaitType {
|
||||
/// Respond immediately. If no layout is currently displayed, the layout
|
||||
/// response will be empty.
|
||||
IMMEDIATE = 0;
|
||||
/// Wait for next layout. If a layout is displayed, waits for it to change.
|
||||
/// If no layout is displayed, waits for one to come up.
|
||||
NEXT_LAYOUT = 1;
|
||||
/// Return current layout. If no layout is currently displayed, waits for
|
||||
/// one to come up.
|
||||
CURRENT_LAYOUT = 2;
|
||||
}
|
||||
|
||||
// Trezor T < 2.6.0 only - wait until mnemonic words are shown
|
||||
optional bool wait_word_list = 1 [deprecated=true];
|
||||
// Trezor T < 2.6.0 only - wait until reset word position is requested
|
||||
optional bool wait_word_pos = 2 [deprecated=true];
|
||||
// trezor-core only - wait until current layout changes
|
||||
// changed in 2.6.4: multiple wait types instead of true/false.
|
||||
optional DebugWaitType wait_layout = 3 [default=IMMEDIATE];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -103,7 +121,7 @@ message DebugLinkState {
|
||||
optional string pin = 2; // current PIN, blank if PIN is not set/enabled
|
||||
optional string matrix = 3; // current PIN matrix
|
||||
optional bytes mnemonic_secret = 4; // current mnemonic secret
|
||||
optional common.HDNodeType node = 5; // current BIP-32 node
|
||||
optional common.HDNodeType node = 5; // current BIP-32 node
|
||||
optional bool passphrase_protection = 6; // is node/mnemonic encrypted using passphrase?
|
||||
optional string reset_word = 7; // word on device display during ResetDevice workflow
|
||||
optional bytes reset_entropy = 8; // current entropy during ResetDevice workflow
|
||||
@ -192,6 +210,7 @@ message DebugLinkEraseSdCard {
|
||||
* @next Success
|
||||
*/
|
||||
message DebugLinkWatchLayout {
|
||||
option deprecated = true;
|
||||
optional bool watch = 1; // if true, start watching layout.
|
||||
// if false, stop.
|
||||
}
|
||||
@ -203,6 +222,7 @@ message DebugLinkWatchLayout {
|
||||
* @next Success
|
||||
*/
|
||||
message DebugLinkResetDebugEvents {
|
||||
option deprecated = true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -8,7 +8,6 @@ option java_outer_classname = "TrezorMessageEthereum";
|
||||
import "messages-common.proto";
|
||||
import "messages-ethereum-definitions.proto";
|
||||
|
||||
|
||||
/**
|
||||
* Request: Ask device for public key corresponding to address_n path
|
||||
* @start
|
||||
|
@ -5,9 +5,9 @@ package hw.trezor.messages.management;
|
||||
option java_package = "com.satoshilabs.trezor.lib.protobuf";
|
||||
option java_outer_classname = "TrezorMessageManagement";
|
||||
|
||||
option (include_in_bitcoin_only) = true;
|
||||
import "options.proto";
|
||||
|
||||
import "messages.proto";
|
||||
option (include_in_bitcoin_only) = true;
|
||||
|
||||
/**
|
||||
* Type of the mnemonic backup given/received by the device during reset/recovery.
|
||||
@ -30,6 +30,15 @@ enum SafetyCheckLevel {
|
||||
PromptTemporarily = 2; // like PromptAlways but reverts to Strict after reboot
|
||||
}
|
||||
|
||||
/**
|
||||
* Allowed display rotation angles (in degrees from North)
|
||||
*/
|
||||
enum DisplayRotation {
|
||||
North = 0;
|
||||
East = 90;
|
||||
South = 180;
|
||||
West = 270;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format of the homescreen image
|
||||
@ -101,7 +110,7 @@ message Features {
|
||||
optional bool passphrase_always_on_device = 36; // device enforces passphrase entry on Trezor
|
||||
optional SafetyCheckLevel safety_checks = 37; // safety check level, set to Prompt to limit path namespace enforcement
|
||||
optional uint32 auto_lock_delay_ms = 38; // number of milliseconds after which the device locks itself
|
||||
optional uint32 display_rotation = 39; // in degrees from North
|
||||
optional DisplayRotation display_rotation = 39; // rotation of display (in degrees from North)
|
||||
optional bool experimental_features = 40; // are experimental message types enabled?
|
||||
optional bool busy = 41; // is the device busy, showing "Do not disconnect"?
|
||||
optional HomescreenFormat homescreen_format = 42; // format of the homescreen, 1 = TOIf, 2 = jpg, 3 = TOIG
|
||||
@ -200,7 +209,7 @@ message ApplySettings {
|
||||
optional bytes homescreen = 4;
|
||||
optional uint32 _passphrase_source = 5 [deprecated=true]; // ASK = 0; DEVICE = 1; HOST = 2;
|
||||
optional uint32 auto_lock_delay_ms = 6;
|
||||
optional uint32 display_rotation = 7; // in degrees from North
|
||||
optional DisplayRotation display_rotation = 7; // rotation of display (in degrees from North)
|
||||
optional bool passphrase_always_on_device = 8; // do not prompt for passphrase, enforce device entry
|
||||
optional SafetyCheckLevel safety_checks = 9; // Safety check level, set to Prompt to limit path namespace enforcement
|
||||
optional bool experimental_features = 10; // enable experimental message types
|
||||
|
@ -5,9 +5,9 @@ package hw.trezor.messages.thp;
|
||||
option java_package = "com.satoshilabs.trezor.lib.protobuf";
|
||||
option java_outer_classname = "TrezorMessageThp";
|
||||
|
||||
option (include_in_bitcoin_only) = true;
|
||||
import "options.proto";
|
||||
|
||||
import "messages.proto";
|
||||
option (include_in_bitcoin_only) = true;
|
||||
|
||||
/**
|
||||
* Only for internal use.
|
||||
|
@ -9,68 +9,10 @@ package hw.trezor.messages;
|
||||
option java_package = "com.satoshilabs.trezor.lib.protobuf";
|
||||
option java_outer_classname = "TrezorMessage";
|
||||
|
||||
import "options.proto";
|
||||
|
||||
option (include_in_bitcoin_only) = true;
|
||||
|
||||
import "google/protobuf/descriptor.proto";
|
||||
|
||||
/************************* WARNING ***********************
|
||||
Due to the way extensions are accessed in pb2py, there needs to be a globally unique
|
||||
name-ID mapping for extensions. That means that two different extensions, e.g. for
|
||||
EnumValueOptions and FieldOptions, MUST NOT have the same ID.
|
||||
|
||||
Using the same ID indicates the same purpose (protobuf does not allow multiple
|
||||
extensions with the same name), such as EnumValueOptions.bitcoin_only and
|
||||
FileOptions.include_in_bitcoin_only. pb2py can then find the extension under
|
||||
either name.
|
||||
|
||||
The convention to achieve this is as follows:
|
||||
- extensions specific to a type have the same prefix:
|
||||
* 50xxx for EnumValueOptions
|
||||
* 51xxx for EnumOptions
|
||||
* 52xxx for MessageOptions
|
||||
* 53xxx for FieldOptions
|
||||
- extensions that might be used across types have the same "global" prefix 60xxx
|
||||
*/
|
||||
/**
|
||||
* Options for specifying message direction and type of wire (normal/debug)
|
||||
*/
|
||||
extend google.protobuf.EnumValueOptions {
|
||||
optional bool wire_in = 50002; // message can be transmitted via wire from PC to Trezor
|
||||
optional bool wire_out = 50003; // message can be transmitted via wire from Trezor to PC
|
||||
optional bool wire_debug_in = 50004; // message can be transmitted via debug wire from PC to Trezor
|
||||
optional bool wire_debug_out = 50005; // message can be transmitted via debug wire from Trezor to PC
|
||||
optional bool wire_tiny = 50006; // message is handled by Trezor when the USB stack is in tiny mode
|
||||
optional bool wire_bootloader = 50007; // message is only handled by Trezor Bootloader
|
||||
optional bool wire_no_fsm = 50008; // message is not handled by Trezor unless the USB stack is in tiny mode
|
||||
|
||||
optional bool bitcoin_only = 60000; // enum value is available on BITCOIN_ONLY build
|
||||
// (messages not marked bitcoin_only will be EXCLUDED)
|
||||
}
|
||||
|
||||
/** Options for tagging enum types */
|
||||
extend google.protobuf.EnumOptions {
|
||||
optional bool has_bitcoin_only_values = 51001; // indicate that some values should be excluded on BITCOIN_ONLY builds
|
||||
}
|
||||
|
||||
/** Options for tagging message types */
|
||||
extend google.protobuf.MessageOptions {
|
||||
optional bool experimental_message = 52001; // indicate that a message is intended for development and beta testing only and its definition may change at any time
|
||||
optional uint32 wire_type = 52002; // override wire type specified in the MessageType enum
|
||||
optional bool internal_only = 52003; // indicate that a message is intended for internal use only and should not be transmitted via the wire
|
||||
}
|
||||
|
||||
/** Options for tagging field types */
|
||||
extend google.protobuf.FieldOptions {
|
||||
optional bool experimental_field = 53001; // indicate that a field is intended for development and beta testing only
|
||||
}
|
||||
|
||||
/** Options for tagging files with protobuf definitions */
|
||||
extend google.protobuf.FileOptions {
|
||||
optional bool include_in_bitcoin_only = 60000; // definitions are available on BITCOIN_ONLY build
|
||||
// intentionally identical to `bitcoin_only` from enum
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Mapping between Trezor wire identifier (uint) and a protobuf message
|
||||
*/
|
||||
@ -377,6 +319,9 @@ enum MessageType {
|
||||
MessageType_SolanaSignTx = 904 [(wire_in) = true];
|
||||
MessageType_SolanaTxSignature = 905 [(wire_out) = true];
|
||||
|
||||
// THP
|
||||
reserved 1000 to 1099; // See messages-thp.proto
|
||||
|
||||
// Benchmark
|
||||
MessageType_BenchmarkListNames = 9100 [(bitcoin_only) = true];
|
||||
MessageType_BenchmarkNames = 9101 [(bitcoin_only) = true];
|
||||
|
66
common/protob/options.proto
Normal file
66
common/protob/options.proto
Normal file
@ -0,0 +1,66 @@
|
||||
syntax = "proto2";
|
||||
package hw.trezor.messages;
|
||||
|
||||
// Sugar for easier handling in Java
|
||||
option java_package = "com.satoshilabs.trezor.lib.protobuf";
|
||||
option java_outer_classname = "TrezorOptions";
|
||||
|
||||
import "google/protobuf/descriptor.proto";
|
||||
|
||||
/************************* WARNING ***********************
|
||||
Due to the way extensions are accessed in pb2py, there needs to be a globally unique
|
||||
name-ID mapping for extensions. That means that two different extensions, e.g. for
|
||||
EnumValueOptions and FieldOptions, MUST NOT have the same ID.
|
||||
|
||||
Using the same ID indicates the same purpose (protobuf does not allow multiple
|
||||
extensions with the same name), such as EnumValueOptions.bitcoin_only and
|
||||
FileOptions.include_in_bitcoin_only. pb2py can then find the extension under
|
||||
either name.
|
||||
|
||||
The convention to achieve this is as follows:
|
||||
- extensions specific to a type have the same prefix:
|
||||
* 50xxx for EnumValueOptions
|
||||
* 51xxx for EnumOptions
|
||||
* 52xxx for MessageOptions
|
||||
* 53xxx for FieldOptions
|
||||
- extensions that might be used across types have the same "global" prefix 60xxx
|
||||
*/
|
||||
|
||||
/**
|
||||
* Options for specifying message direction and type of wire (normal/debug)
|
||||
*/
|
||||
extend google.protobuf.EnumValueOptions {
|
||||
optional bool wire_in = 50002; // message can be transmitted via wire from PC to Trezor
|
||||
optional bool wire_out = 50003; // message can be transmitted via wire from Trezor to PC
|
||||
optional bool wire_debug_in = 50004; // message can be transmitted via debug wire from PC to Trezor
|
||||
optional bool wire_debug_out = 50005; // message can be transmitted via debug wire from Trezor to PC
|
||||
optional bool wire_tiny = 50006; // message is handled by Trezor when the USB stack is in tiny mode
|
||||
optional bool wire_bootloader = 50007; // message is only handled by Trezor Bootloader
|
||||
optional bool wire_no_fsm = 50008; // message is not handled by Trezor unless the USB stack is in tiny mode
|
||||
|
||||
optional bool bitcoin_only = 60000; // enum value is available on BITCOIN_ONLY build
|
||||
// (messages not marked bitcoin_only will be EXCLUDED)
|
||||
}
|
||||
|
||||
/** Options for tagging enum types */
|
||||
extend google.protobuf.EnumOptions {
|
||||
optional bool has_bitcoin_only_values = 51001; // indicate that some values should be excluded on BITCOIN_ONLY builds
|
||||
}
|
||||
|
||||
/** Options for tagging message types */
|
||||
extend google.protobuf.MessageOptions {
|
||||
optional bool experimental_message = 52001; // indicate that a message is intended for development and beta testing only and its definition may change at any time
|
||||
optional uint32 wire_type = 52002; // override wire type specified in the MessageType enum
|
||||
optional bool internal_only = 52003; // indicate that a message is intended for internal use only and should not be transmitted via the wire
|
||||
}
|
||||
|
||||
/** Options for tagging field types */
|
||||
extend google.protobuf.FieldOptions {
|
||||
optional bool experimental_field = 53001; // indicate that a field is intended for development and beta testing only
|
||||
}
|
||||
|
||||
/** Options for tagging files with protobuf definitions */
|
||||
extend google.protobuf.FileOptions {
|
||||
optional bool include_in_bitcoin_only = 60000; // definitions are available on BITCOIN_ONLY build
|
||||
// intentionally identical to `bitcoin_only` from enum
|
||||
}
|
@ -714,7 +714,8 @@ def main(
|
||||
if verbose:
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
descriptor_proto = protoc(proto)
|
||||
# The proto tuple is sorted to give consistent results in different environments
|
||||
descriptor_proto = protoc(sorted(proto))
|
||||
descriptor = Descriptor(
|
||||
descriptor_proto,
|
||||
include_deprecated=include_deprecated,
|
||||
|
@ -4,54 +4,6 @@
|
||||
"passphrase": ""
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "Mainnet transaction without change",
|
||||
"parameters": {
|
||||
"protocol_magic": 764824073,
|
||||
"network_id": 1,
|
||||
"fee": 42,
|
||||
"ttl": 10,
|
||||
"validity_interval_start": null,
|
||||
"certificates": [],
|
||||
"withdrawals": [],
|
||||
"auxiliary_data": null,
|
||||
"inputs": [
|
||||
{
|
||||
"path": "m/44'/1815'/0'/0/1",
|
||||
"prev_hash": "1af8fa0b754ff99253d983894e63a2b09cbb56c833ba18c3384210163f63dcfc",
|
||||
"prev_index": 0
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"address": "Ae2tdPwUPEZCanmBz5g2GEwFqKTKpNJcGYPKfDxoNeKZ8bRHr8366kseiK2",
|
||||
"amount": "3003112"
|
||||
}
|
||||
],
|
||||
"mint": [],
|
||||
"script_data_hash": null,
|
||||
"collateral_inputs": [],
|
||||
"required_signers": [],
|
||||
"collateral_return": null,
|
||||
"total_collateral": null,
|
||||
"reference_inputs": [],
|
||||
"signing_mode": "ORDINARY_TRANSACTION",
|
||||
"additional_witness_requests": [],
|
||||
"include_network_id": false,
|
||||
"tag_cbor_sets": false
|
||||
},
|
||||
"result": {
|
||||
"tx_hash": "73e09bdebf98a9e0f17f86a2d11e0f14f4f8dae77cdf26ff1678e821f20c8db6",
|
||||
"witnesses": [
|
||||
{
|
||||
"type": 0,
|
||||
"pub_key": "89053545a6c254b0d9b1464e48d2b5fcf91d4e25c128afb1fcfc61d0843338ea",
|
||||
"signature": "da07ac5246e3f20ebd1276476a4ae34a019dd4b264ffc22eea3c28cb0f1a6bb1c7764adeecf56bcb0bc6196fd1dbe080f3a7ef5b49f56980fe5b2881a4fdfa00",
|
||||
"chain_code": "26308151516f3b0e02bb1638142747863c520273ce9bd3e5cd91e1d46fe2a635"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "transaction with stake deregistration and withdrawal",
|
||||
"parameters": {
|
||||
@ -116,55 +68,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Ordinary transaction with output datum hash",
|
||||
"parameters": {
|
||||
"protocol_magic": 764824073,
|
||||
"network_id": 1,
|
||||
"fee": 42,
|
||||
"ttl": 10,
|
||||
"validity_interval_start": null,
|
||||
"certificates": [],
|
||||
"withdrawals": [],
|
||||
"auxiliary_data": null,
|
||||
"inputs": [
|
||||
{
|
||||
"path": "m/1852'/1815'/0'/0/0",
|
||||
"prev_hash": "3b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b7",
|
||||
"prev_index": 0
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"address": "addr1w9rhu54nz94k9l5v6d9rzfs47h7dv7xffcwkekuxcx3evnqpvuxu0",
|
||||
"amount": "1",
|
||||
"datum_hash": "3b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b7"
|
||||
}
|
||||
],
|
||||
"mint": [],
|
||||
"script_data_hash": null,
|
||||
"collateral_inputs": [],
|
||||
"required_signers": [],
|
||||
"collateral_return": null,
|
||||
"total_collateral": null,
|
||||
"reference_inputs": [],
|
||||
"signing_mode": "ORDINARY_TRANSACTION",
|
||||
"additional_witness_requests": [],
|
||||
"include_network_id": false,
|
||||
"tag_cbor_sets": false
|
||||
},
|
||||
"result": {
|
||||
"tx_hash": "8ea2765f1e46d84f02d8b25a5f0cf445aaeaadcab913e17e59388a4f898ca812",
|
||||
"witnesses": [
|
||||
{
|
||||
"type": 1,
|
||||
"pub_key": "5d010cf16fdeff40955633d6c565f3844a288a24967cf6b76acbeb271b4f13c1",
|
||||
"signature": "ccc4e3c2adbf63561881212c8dffd42a02850460256da9b393aaed2cbd131fbb2798a92a2adf59c31d22e1e33c3dad011d91e09aa2d5b15ba64fa995bf241900",
|
||||
"chain_code": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Ordinary transaction with a required signer",
|
||||
"parameters": {
|
||||
@ -223,59 +126,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Ordinary transaction with long inline datum, long reference script and change address",
|
||||
"parameters": {
|
||||
"protocol_magic": 764824073,
|
||||
"network_id": 1,
|
||||
"fee": 42,
|
||||
"ttl": 10,
|
||||
"validity_interval_start": null,
|
||||
"certificates": [],
|
||||
"withdrawals": [],
|
||||
"auxiliary_data": null,
|
||||
"inputs": [
|
||||
{
|
||||
"path": "m/1852'/1815'/0'/0/0",
|
||||
"prev_hash": "3b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b7",
|
||||
"prev_index": 0
|
||||
}
|
||||
],
|
||||
"outputs": [
|
||||
{
|
||||
"addressType": 0,
|
||||
"path": "m/1852'/1815'/0'/0/0",
|
||||
"stakingPath": "m/1852'/1815'/0'/2/0",
|
||||
"amount": "1",
|
||||
"format": 1,
|
||||
"inline_datum": "3b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b73b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b73b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b73b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b73b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b73b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b73b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b73b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b7",
|
||||
"reference_script": "3b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b73b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b73b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b73b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b73b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b73b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b73b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b73b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b7b3"
|
||||
}
|
||||
],
|
||||
"mint": [],
|
||||
"script_data_hash": null,
|
||||
"collateral_inputs": [],
|
||||
"required_signers": [],
|
||||
"collateral_return": null,
|
||||
"total_collateral": null,
|
||||
"reference_inputs": [],
|
||||
"signing_mode": "ORDINARY_TRANSACTION",
|
||||
"additional_witness_requests": [],
|
||||
"include_network_id": false,
|
||||
"tag_cbor_sets": false
|
||||
},
|
||||
"result": {
|
||||
"tx_hash": "ea6d50d786a7c252451704379a05bb21d3f9ad47d043d90fcc88cad5b78ca3bc",
|
||||
"witnesses": [
|
||||
{
|
||||
"type": 1,
|
||||
"pub_key": "5d010cf16fdeff40955633d6c565f3844a288a24967cf6b76acbeb271b4f13c1",
|
||||
"signature": "5b2e8f6874e4e842a31624582c7c4f7b13fb2602d4b28456ce712f3ccea3804c9fcdad728bc66a17f10fb8b1cad9cc3f77b0ecf2d70818a085c31ac230347b02",
|
||||
"chain_code": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Multisig transaction with a required signer",
|
||||
"parameters": {
|
||||
|
@ -232,7 +232,10 @@ def check_key(
|
||||
BTC_CHECKS = [
|
||||
check_key("coin_name", str, regex=r"^[A-Z]"),
|
||||
check_key("coin_shortcut", str, regex=r"^t?[A-Z]{3,}$"),
|
||||
check_key("coin_label", str, regex=r"^x?[A-Z]"),
|
||||
# coin_label expects an uppercase first letter. This doesn't
|
||||
# work for eCash and xRhodium, so an exception is added for the lowercase
|
||||
# 'e' and 'x' only.
|
||||
check_key("coin_label", str, regex=r"^[ex]?[A-Z]"),
|
||||
check_key("website", str, regex=r"^https://.*[^/]$"),
|
||||
check_key("github", str, regex=r"^https://git(hu|la)b.com/.*[^/]$"),
|
||||
check_key("maintainer", str),
|
||||
|
@ -21,9 +21,7 @@ from coin_info import Coin, CoinBuckets, Coins, CoinsInfo, FidoApps, SupportInfo
|
||||
DEFINITIONS_TIMESTAMP_PATH = (
|
||||
coin_info.DEFS_DIR / "ethereum" / "released-definitions-timestamp.txt"
|
||||
)
|
||||
DEFINITIONS_LATEST_URL = (
|
||||
"https://raw.githubusercontent.com/trezor/definitions/main/definitions-latest.json"
|
||||
)
|
||||
DEFINITIONS_LATEST_URL = "https://raw.githubusercontent.com/trezor/definitions/signed/definitions-latest.json"
|
||||
|
||||
HERE = Path(__file__).parent.resolve()
|
||||
ROOT = HERE.parent.parent
|
||||
|
1
core/.changelog.d/2299.changed
Normal file
1
core/.changelog.d/2299.changed
Normal file
@ -0,0 +1 @@
|
||||
Improve UI synchronization, ordering, and responsiveness (Global Layout project).
|
@ -1 +0,0 @@
|
||||
[T3T1] Show account info in ETH send/stake flow.
|
@ -1 +0,0 @@
|
||||
Fix ETH account # detection.
|
1
core/.changelog.d/3633.changed
Normal file
1
core/.changelog.d/3633.changed
Normal file
@ -0,0 +1 @@
|
||||
Improved device responsiveness by removing unnecessary screen refreshes.
|
1
core/.changelog.d/3692.fixed
Normal file
1
core/.changelog.d/3692.fixed
Normal file
@ -0,0 +1 @@
|
||||
Fix auto-mover hitting wall scenario
|
1
core/.changelog.d/3813.fixed
Normal file
1
core/.changelog.d/3813.fixed
Normal file
@ -0,0 +1 @@
|
||||
Fix translation of the 'Enable labeling' screen.
|
1
core/.changelog.d/3863.added
Normal file
1
core/.changelog.d/3863.added
Normal file
@ -0,0 +1 @@
|
||||
Show last typed PIN number for short period of time
|
@ -1 +0,0 @@
|
||||
[T3T1] Fix XPUB confirmed success screen title
|
@ -1 +0,0 @@
|
||||
[T3T1] Display menu items on two lines when one line is not enough.
|
1
core/.changelog.d/4041.added
Normal file
1
core/.changelog.d/4041.added
Normal file
@ -0,0 +1 @@
|
||||
Enum for valid device rotations
|
@ -1 +0,0 @@
|
||||
Initial support for Italian and Portugese translations.
|
@ -1 +0,0 @@
|
||||
Added benchmark application.
|
@ -1 +0,0 @@
|
||||
[T2T1] Fix spending decred stake outputs.
|
@ -1 +0,0 @@
|
||||
[T3T1] Fixed missing footer page hints in info about remaining shares in super-shamir recovery.
|
@ -1 +0,0 @@
|
||||
[T3T1] Fix swipe in ETH stake flow menu and address confirmation.
|
1
core/.changelog.d/4176.fixed
Normal file
1
core/.changelog.d/4176.fixed
Normal file
@ -0,0 +1 @@
|
||||
[T3T1] Add swipe back in fido confirm flow menu.
|
1
core/.changelog.d/4271.added
Normal file
1
core/.changelog.d/4271.added
Normal file
@ -0,0 +1 @@
|
||||
Add P2WSH support for Unchained BIP32 paths.
|
1
core/.changelog.d/4294.fixed
Normal file
1
core/.changelog.d/4294.fixed
Normal file
@ -0,0 +1 @@
|
||||
[T3T1] Make swipe back action in tutorial flow menu consistent with menu cancel action.
|
1
core/.changelog.d/4295.fixed
Normal file
1
core/.changelog.d/4295.fixed
Normal file
@ -0,0 +1 @@
|
||||
[T3T1] Fix color and icon for 'Success' string in set_brightness flow.
|
1
core/.changelog.d/4302.added
Normal file
1
core/.changelog.d/4302.added
Normal file
@ -0,0 +1 @@
|
||||
[T3T1] Add page counter to paginated blobs.
|
1
core/.changelog.d/4302.added.1
Normal file
1
core/.changelog.d/4302.added.1
Normal file
@ -0,0 +1 @@
|
||||
[T3T1] Add cancel button to individual pages of a blob.
|
1
core/.changelog.d/4302.added.2
Normal file
1
core/.changelog.d/4302.added.2
Normal file
@ -0,0 +1 @@
|
||||
[T3T1] Add margin to the first page of a blob.
|
1
core/.changelog.d/4302.added.3
Normal file
1
core/.changelog.d/4302.added.3
Normal file
@ -0,0 +1 @@
|
||||
[T3B1] Add "continue" button after scrolling through the whole blob.
|
1
core/.changelog.d/4302.fixed
Normal file
1
core/.changelog.d/4302.fixed
Normal file
@ -0,0 +1 @@
|
||||
[T3B1] Fix data size mismatch when confirming a blob.
|
1
core/.changelog.d/4309.fixed
Normal file
1
core/.changelog.d/4309.fixed
Normal file
@ -0,0 +1 @@
|
||||
[T3T1] Fixed incorrect navigation in handy menu while signing BTC message
|
1
core/.changelog.d/4326.fixed
Normal file
1
core/.changelog.d/4326.fixed
Normal file
@ -0,0 +1 @@
|
||||
[T3T1] Fixed information screen when signing BTC fee bump transaction
|
1
core/.changelog.d/4351.added
Normal file
1
core/.changelog.d/4351.added
Normal file
@ -0,0 +1 @@
|
||||
Added support for lexicographic sorting of pubkeys in multisig.
|
1
core/.changelog.d/4351.changed.1
Normal file
1
core/.changelog.d/4351.changed.1
Normal file
@ -0,0 +1 @@
|
||||
Forbid multisig to singlesig change outputs.
|
1
core/.changelog.d/4351.changed.2
Normal file
1
core/.changelog.d/4351.changed.2
Normal file
@ -0,0 +1 @@
|
||||
Removed deprecated Unchained Capital's multisig path.
|
1
core/.changelog.d/4351.changed.3
Normal file
1
core/.changelog.d/4351.changed.3
Normal file
@ -0,0 +1 @@
|
||||
Forbid per-node paths in multisig change outputs and multisig receive addresses.
|
1
core/.changelog.d/4402.fixed
Normal file
1
core/.changelog.d/4402.fixed
Normal file
@ -0,0 +1 @@
|
||||
[T3T1] Fix unexpected info button when confirming passphrase coming from host
|
@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
## [2.8.5] (20th November 2024)
|
||||
|
||||
### Added
|
||||
- Initial support for Italian and Portugese translations. [#4047]
|
||||
- Added benchmark application. [#4101]
|
||||
|
||||
### Changed
|
||||
- Simplified UI of Cardano transactions initiated by Trezor Suite. [#4284]
|
||||
|
||||
### Fixed
|
||||
- Fix ETH account number detection. [#3627]
|
||||
- New EVM call contract flow UI. [#4251]
|
||||
|
||||
## [2.8.4] (internal release)
|
||||
|
||||
## [2.8.3] (unreleased)
|
||||
|
||||
### Added
|
||||
@ -930,7 +945,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
[#3496]: https://github.com/trezor/trezor-firmware/pull/3496
|
||||
[#3517]: https://github.com/trezor/trezor-firmware/pull/3517
|
||||
[#3520]: https://github.com/trezor/trezor-firmware/pull/3520
|
||||
[#3536]: https://github.com/trezor/trezor-firmware/pull/3536
|
||||
[#3539]: https://github.com/trezor/trezor-firmware/pull/3539
|
||||
[#3627]: https://github.com/trezor/trezor-firmware/pull/3627
|
||||
[#3636]: https://github.com/trezor/trezor-firmware/pull/3636
|
||||
[#3640]: https://github.com/trezor/trezor-firmware/pull/3640
|
||||
[#3728]: https://github.com/trezor/trezor-firmware/pull/3728
|
||||
@ -949,6 +966,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
[#3922]: https://github.com/trezor/trezor-firmware/pull/3922
|
||||
[#3925]: https://github.com/trezor/trezor-firmware/pull/3925
|
||||
[#3940]: https://github.com/trezor/trezor-firmware/pull/3940
|
||||
[#3947]: https://github.com/trezor/trezor-firmware/pull/3947
|
||||
[#3965]: https://github.com/trezor/trezor-firmware/pull/3965
|
||||
[#3969]: https://github.com/trezor/trezor-firmware/pull/3969
|
||||
[#3972]: https://github.com/trezor/trezor-firmware/pull/3972
|
||||
@ -958,13 +976,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
[#3992]: https://github.com/trezor/trezor-firmware/pull/3992
|
||||
[#4000]: https://github.com/trezor/trezor-firmware/pull/4000
|
||||
[#4006]: https://github.com/trezor/trezor-firmware/pull/4006
|
||||
[#4019]: https://github.com/trezor/trezor-firmware/pull/4019
|
||||
[#4023]: https://github.com/trezor/trezor-firmware/pull/4023
|
||||
[#4030]: https://github.com/trezor/trezor-firmware/pull/4030
|
||||
[#4047]: https://github.com/trezor/trezor-firmware/pull/4047
|
||||
[#4054]: https://github.com/trezor/trezor-firmware/pull/4054
|
||||
[#4060]: https://github.com/trezor/trezor-firmware/pull/4060
|
||||
[#4063]: https://github.com/trezor/trezor-firmware/pull/4063
|
||||
[#4093]: https://github.com/trezor/trezor-firmware/pull/4093
|
||||
[#4099]: https://github.com/trezor/trezor-firmware/pull/4099
|
||||
[#4101]: https://github.com/trezor/trezor-firmware/pull/4101
|
||||
[#4119]: https://github.com/trezor/trezor-firmware/pull/4119
|
||||
[#4142]: https://github.com/trezor/trezor-firmware/pull/4142
|
||||
[#4151]: https://github.com/trezor/trezor-firmware/pull/4151
|
||||
[#4161]: https://github.com/trezor/trezor-firmware/pull/4161
|
||||
[#4165]: https://github.com/trezor/trezor-firmware/pull/4165
|
||||
[#4167]: https://github.com/trezor/trezor-firmware/pull/4167
|
||||
[#4251]: https://github.com/trezor/trezor-firmware/pull/4251
|
||||
[#4261]: https://github.com/trezor/trezor-firmware/pull/4261
|
||||
[#4284]: https://github.com/trezor/trezor-firmware/pull/4284
|
||||
|
@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
## [2.8.5] (20th November 2024)
|
||||
|
||||
### Added
|
||||
- Initial support for Italian and Portugese translations. [#4047]
|
||||
- Added benchmark application. [#4101]
|
||||
|
||||
### Changed
|
||||
- Simplified UI of Cardano transactions initiated by Trezor Suite. [#4284]
|
||||
|
||||
### Fixed
|
||||
- Fix ETH account number detection. [#3627]
|
||||
- Fix spending decred stake outputs. [#4161]
|
||||
- New EVM call contract flow UI. [#4251]
|
||||
|
||||
## [2.8.4] (internal release)
|
||||
|
||||
## [2.8.3] (unreleased)
|
||||
|
||||
### Added
|
||||
@ -923,7 +939,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
[#3496]: https://github.com/trezor/trezor-firmware/pull/3496
|
||||
[#3517]: https://github.com/trezor/trezor-firmware/pull/3517
|
||||
[#3520]: https://github.com/trezor/trezor-firmware/pull/3520
|
||||
[#3536]: https://github.com/trezor/trezor-firmware/pull/3536
|
||||
[#3539]: https://github.com/trezor/trezor-firmware/pull/3539
|
||||
[#3627]: https://github.com/trezor/trezor-firmware/pull/3627
|
||||
[#3636]: https://github.com/trezor/trezor-firmware/pull/3636
|
||||
[#3640]: https://github.com/trezor/trezor-firmware/pull/3640
|
||||
[#3728]: https://github.com/trezor/trezor-firmware/pull/3728
|
||||
@ -942,6 +960,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
[#3922]: https://github.com/trezor/trezor-firmware/pull/3922
|
||||
[#3925]: https://github.com/trezor/trezor-firmware/pull/3925
|
||||
[#3940]: https://github.com/trezor/trezor-firmware/pull/3940
|
||||
[#3947]: https://github.com/trezor/trezor-firmware/pull/3947
|
||||
[#3965]: https://github.com/trezor/trezor-firmware/pull/3965
|
||||
[#3969]: https://github.com/trezor/trezor-firmware/pull/3969
|
||||
[#3972]: https://github.com/trezor/trezor-firmware/pull/3972
|
||||
@ -951,13 +970,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
[#3992]: https://github.com/trezor/trezor-firmware/pull/3992
|
||||
[#4000]: https://github.com/trezor/trezor-firmware/pull/4000
|
||||
[#4006]: https://github.com/trezor/trezor-firmware/pull/4006
|
||||
[#4019]: https://github.com/trezor/trezor-firmware/pull/4019
|
||||
[#4023]: https://github.com/trezor/trezor-firmware/pull/4023
|
||||
[#4030]: https://github.com/trezor/trezor-firmware/pull/4030
|
||||
[#4047]: https://github.com/trezor/trezor-firmware/pull/4047
|
||||
[#4054]: https://github.com/trezor/trezor-firmware/pull/4054
|
||||
[#4060]: https://github.com/trezor/trezor-firmware/pull/4060
|
||||
[#4063]: https://github.com/trezor/trezor-firmware/pull/4063
|
||||
[#4093]: https://github.com/trezor/trezor-firmware/pull/4093
|
||||
[#4099]: https://github.com/trezor/trezor-firmware/pull/4099
|
||||
[#4101]: https://github.com/trezor/trezor-firmware/pull/4101
|
||||
[#4119]: https://github.com/trezor/trezor-firmware/pull/4119
|
||||
[#4142]: https://github.com/trezor/trezor-firmware/pull/4142
|
||||
[#4151]: https://github.com/trezor/trezor-firmware/pull/4151
|
||||
[#4161]: https://github.com/trezor/trezor-firmware/pull/4161
|
||||
[#4165]: https://github.com/trezor/trezor-firmware/pull/4165
|
||||
[#4167]: https://github.com/trezor/trezor-firmware/pull/4167
|
||||
[#4251]: https://github.com/trezor/trezor-firmware/pull/4251
|
||||
[#4261]: https://github.com/trezor/trezor-firmware/pull/4261
|
||||
[#4284]: https://github.com/trezor/trezor-firmware/pull/4284
|
||||
|
@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
## [2.8.5] (20th November 2024)
|
||||
|
||||
### Added
|
||||
- Initial support for Italian and Portugese translations. [#4047]
|
||||
- Added benchmark application. [#4101]
|
||||
|
||||
### Changed
|
||||
- Simplified UI of Cardano transactions initiated by Trezor Suite. [#4284]
|
||||
|
||||
### Fixed
|
||||
- Fix ETH account number detection. [#3627]
|
||||
- New EVM call contract flow UI. [#4251]
|
||||
|
||||
## [2.8.4] (internal release)
|
||||
|
||||
## [2.8.3] (18th September 2024)
|
||||
|
||||
### Added
|
||||
@ -931,7 +946,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
[#3496]: https://github.com/trezor/trezor-firmware/pull/3496
|
||||
[#3517]: https://github.com/trezor/trezor-firmware/pull/3517
|
||||
[#3520]: https://github.com/trezor/trezor-firmware/pull/3520
|
||||
[#3536]: https://github.com/trezor/trezor-firmware/pull/3536
|
||||
[#3539]: https://github.com/trezor/trezor-firmware/pull/3539
|
||||
[#3627]: https://github.com/trezor/trezor-firmware/pull/3627
|
||||
[#3636]: https://github.com/trezor/trezor-firmware/pull/3636
|
||||
[#3640]: https://github.com/trezor/trezor-firmware/pull/3640
|
||||
[#3728]: https://github.com/trezor/trezor-firmware/pull/3728
|
||||
@ -950,6 +967,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
[#3922]: https://github.com/trezor/trezor-firmware/pull/3922
|
||||
[#3925]: https://github.com/trezor/trezor-firmware/pull/3925
|
||||
[#3940]: https://github.com/trezor/trezor-firmware/pull/3940
|
||||
[#3947]: https://github.com/trezor/trezor-firmware/pull/3947
|
||||
[#3965]: https://github.com/trezor/trezor-firmware/pull/3965
|
||||
[#3969]: https://github.com/trezor/trezor-firmware/pull/3969
|
||||
[#3972]: https://github.com/trezor/trezor-firmware/pull/3972
|
||||
@ -959,13 +977,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
[#3992]: https://github.com/trezor/trezor-firmware/pull/3992
|
||||
[#4000]: https://github.com/trezor/trezor-firmware/pull/4000
|
||||
[#4006]: https://github.com/trezor/trezor-firmware/pull/4006
|
||||
[#4019]: https://github.com/trezor/trezor-firmware/pull/4019
|
||||
[#4023]: https://github.com/trezor/trezor-firmware/pull/4023
|
||||
[#4030]: https://github.com/trezor/trezor-firmware/pull/4030
|
||||
[#4047]: https://github.com/trezor/trezor-firmware/pull/4047
|
||||
[#4054]: https://github.com/trezor/trezor-firmware/pull/4054
|
||||
[#4060]: https://github.com/trezor/trezor-firmware/pull/4060
|
||||
[#4063]: https://github.com/trezor/trezor-firmware/pull/4063
|
||||
[#4093]: https://github.com/trezor/trezor-firmware/pull/4093
|
||||
[#4099]: https://github.com/trezor/trezor-firmware/pull/4099
|
||||
[#4101]: https://github.com/trezor/trezor-firmware/pull/4101
|
||||
[#4119]: https://github.com/trezor/trezor-firmware/pull/4119
|
||||
[#4142]: https://github.com/trezor/trezor-firmware/pull/4142
|
||||
[#4151]: https://github.com/trezor/trezor-firmware/pull/4151
|
||||
[#4161]: https://github.com/trezor/trezor-firmware/pull/4161
|
||||
[#4165]: https://github.com/trezor/trezor-firmware/pull/4165
|
||||
[#4167]: https://github.com/trezor/trezor-firmware/pull/4167
|
||||
[#4251]: https://github.com/trezor/trezor-firmware/pull/4251
|
||||
[#4261]: https://github.com/trezor/trezor-firmware/pull/4261
|
||||
[#4284]: https://github.com/trezor/trezor-firmware/pull/4284
|
||||
|
@ -4,6 +4,28 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
## [2.8.5] (20th November 2024)
|
||||
|
||||
### Added
|
||||
- Initial support for Italian and Portugese translations. [#4047]
|
||||
- Added benchmark application. [#4101]
|
||||
|
||||
### Changed
|
||||
- Simplified UI of Cardano transactions initiated by Trezor Suite. [#4284]
|
||||
- Included bootloader 2.1.9.
|
||||
|
||||
### Fixed
|
||||
- Show account info in ETH send/stake flow. [#3536]
|
||||
- Fix ETH account number detection. [#3627]
|
||||
- Fix XPUB confirmed success screen title. [#3947]
|
||||
- Display menu items on two lines when one line is not enough. [#4019]
|
||||
- Fixed missing footer page hints in info about remaining shares in super-shamir recovery. [#4165]
|
||||
- Fix swipe in ETH stake flow menu and address confirmation. [#4167]
|
||||
- New EVM call contract flow UI. [#4251]
|
||||
- Add instruction to Swipe up after changing brightness. [#4261]
|
||||
|
||||
## [2.8.4] (internal release)
|
||||
|
||||
## [2.8.3] (18th September 2024)
|
||||
|
||||
### Added
|
||||
@ -951,7 +973,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
[#3496]: https://github.com/trezor/trezor-firmware/pull/3496
|
||||
[#3517]: https://github.com/trezor/trezor-firmware/pull/3517
|
||||
[#3520]: https://github.com/trezor/trezor-firmware/pull/3520
|
||||
[#3536]: https://github.com/trezor/trezor-firmware/pull/3536
|
||||
[#3539]: https://github.com/trezor/trezor-firmware/pull/3539
|
||||
[#3627]: https://github.com/trezor/trezor-firmware/pull/3627
|
||||
[#3636]: https://github.com/trezor/trezor-firmware/pull/3636
|
||||
[#3640]: https://github.com/trezor/trezor-firmware/pull/3640
|
||||
[#3728]: https://github.com/trezor/trezor-firmware/pull/3728
|
||||
@ -970,6 +994,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
[#3922]: https://github.com/trezor/trezor-firmware/pull/3922
|
||||
[#3925]: https://github.com/trezor/trezor-firmware/pull/3925
|
||||
[#3940]: https://github.com/trezor/trezor-firmware/pull/3940
|
||||
[#3947]: https://github.com/trezor/trezor-firmware/pull/3947
|
||||
[#3965]: https://github.com/trezor/trezor-firmware/pull/3965
|
||||
[#3969]: https://github.com/trezor/trezor-firmware/pull/3969
|
||||
[#3972]: https://github.com/trezor/trezor-firmware/pull/3972
|
||||
@ -979,13 +1004,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
[#3992]: https://github.com/trezor/trezor-firmware/pull/3992
|
||||
[#4000]: https://github.com/trezor/trezor-firmware/pull/4000
|
||||
[#4006]: https://github.com/trezor/trezor-firmware/pull/4006
|
||||
[#4019]: https://github.com/trezor/trezor-firmware/pull/4019
|
||||
[#4023]: https://github.com/trezor/trezor-firmware/pull/4023
|
||||
[#4030]: https://github.com/trezor/trezor-firmware/pull/4030
|
||||
[#4047]: https://github.com/trezor/trezor-firmware/pull/4047
|
||||
[#4054]: https://github.com/trezor/trezor-firmware/pull/4054
|
||||
[#4060]: https://github.com/trezor/trezor-firmware/pull/4060
|
||||
[#4063]: https://github.com/trezor/trezor-firmware/pull/4063
|
||||
[#4093]: https://github.com/trezor/trezor-firmware/pull/4093
|
||||
[#4099]: https://github.com/trezor/trezor-firmware/pull/4099
|
||||
[#4101]: https://github.com/trezor/trezor-firmware/pull/4101
|
||||
[#4119]: https://github.com/trezor/trezor-firmware/pull/4119
|
||||
[#4142]: https://github.com/trezor/trezor-firmware/pull/4142
|
||||
[#4151]: https://github.com/trezor/trezor-firmware/pull/4151
|
||||
[#4161]: https://github.com/trezor/trezor-firmware/pull/4161
|
||||
[#4165]: https://github.com/trezor/trezor-firmware/pull/4165
|
||||
[#4167]: https://github.com/trezor/trezor-firmware/pull/4167
|
||||
[#4251]: https://github.com/trezor/trezor-firmware/pull/4251
|
||||
[#4261]: https://github.com/trezor/trezor-firmware/pull/4261
|
||||
[#4284]: https://github.com/trezor/trezor-firmware/pull/4284
|
||||
|
@ -4,6 +4,29 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
## [2.8.5] (20th November 2024)
|
||||
|
||||
### Added
|
||||
- Initial support for Italian and Portugese translations. [#4047]
|
||||
- Added benchmark application. [#4101]
|
||||
|
||||
### Changed
|
||||
- Simplified UI of Cardano transactions initiated by Trezor Suite. [#4284]
|
||||
- [T3T1] Included bootloader 2.1.9.
|
||||
|
||||
### Fixed
|
||||
- [T3T1] Show account info in ETH send/stake flow. [#3536]
|
||||
- Fix ETH account number detection. [#3627]
|
||||
- [T3T1] Fix XPUB confirmed success screen title. [#3947]
|
||||
- [T3T1] Display menu items on two lines when one line is not enough. [#4019]
|
||||
- [T2T1] Fix spending decred stake outputs. [#4161]
|
||||
- [T3T1] Fixed missing footer page hints in info about remaining shares in super-shamir recovery. [#4165]
|
||||
- [T3T1] Fix swipe in ETH stake flow menu and address confirmation. [#4167]
|
||||
- New EVM call contract flow UI. [#4251]
|
||||
- [T3T1] Add instruction to Swipe up after changing brightness. [#4261]
|
||||
|
||||
## [2.8.4] (internal release)
|
||||
|
||||
## [2.8.3] (18th September 2024)
|
||||
|
||||
### Added
|
||||
@ -969,7 +992,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
[#3496]: https://github.com/trezor/trezor-firmware/pull/3496
|
||||
[#3517]: https://github.com/trezor/trezor-firmware/pull/3517
|
||||
[#3520]: https://github.com/trezor/trezor-firmware/pull/3520
|
||||
[#3536]: https://github.com/trezor/trezor-firmware/pull/3536
|
||||
[#3539]: https://github.com/trezor/trezor-firmware/pull/3539
|
||||
[#3627]: https://github.com/trezor/trezor-firmware/pull/3627
|
||||
[#3636]: https://github.com/trezor/trezor-firmware/pull/3636
|
||||
[#3640]: https://github.com/trezor/trezor-firmware/pull/3640
|
||||
[#3728]: https://github.com/trezor/trezor-firmware/pull/3728
|
||||
@ -988,6 +1013,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
[#3922]: https://github.com/trezor/trezor-firmware/pull/3922
|
||||
[#3925]: https://github.com/trezor/trezor-firmware/pull/3925
|
||||
[#3940]: https://github.com/trezor/trezor-firmware/pull/3940
|
||||
[#3947]: https://github.com/trezor/trezor-firmware/pull/3947
|
||||
[#3965]: https://github.com/trezor/trezor-firmware/pull/3965
|
||||
[#3969]: https://github.com/trezor/trezor-firmware/pull/3969
|
||||
[#3972]: https://github.com/trezor/trezor-firmware/pull/3972
|
||||
@ -997,13 +1023,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
[#3992]: https://github.com/trezor/trezor-firmware/pull/3992
|
||||
[#4000]: https://github.com/trezor/trezor-firmware/pull/4000
|
||||
[#4006]: https://github.com/trezor/trezor-firmware/pull/4006
|
||||
[#4019]: https://github.com/trezor/trezor-firmware/pull/4019
|
||||
[#4023]: https://github.com/trezor/trezor-firmware/pull/4023
|
||||
[#4030]: https://github.com/trezor/trezor-firmware/pull/4030
|
||||
[#4047]: https://github.com/trezor/trezor-firmware/pull/4047
|
||||
[#4054]: https://github.com/trezor/trezor-firmware/pull/4054
|
||||
[#4060]: https://github.com/trezor/trezor-firmware/pull/4060
|
||||
[#4063]: https://github.com/trezor/trezor-firmware/pull/4063
|
||||
[#4093]: https://github.com/trezor/trezor-firmware/pull/4093
|
||||
[#4099]: https://github.com/trezor/trezor-firmware/pull/4099
|
||||
[#4101]: https://github.com/trezor/trezor-firmware/pull/4101
|
||||
[#4119]: https://github.com/trezor/trezor-firmware/pull/4119
|
||||
[#4142]: https://github.com/trezor/trezor-firmware/pull/4142
|
||||
[#4151]: https://github.com/trezor/trezor-firmware/pull/4151
|
||||
[#4161]: https://github.com/trezor/trezor-firmware/pull/4161
|
||||
[#4165]: https://github.com/trezor/trezor-firmware/pull/4165
|
||||
[#4167]: https://github.com/trezor/trezor-firmware/pull/4167
|
||||
[#4251]: https://github.com/trezor/trezor-firmware/pull/4251
|
||||
[#4261]: https://github.com/trezor/trezor-firmware/pull/4261
|
||||
[#4284]: https://github.com/trezor/trezor-firmware/pull/4284
|
||||
|
120
core/Makefile
120
core/Makefile
@ -9,7 +9,6 @@ JOBS = $(shell sysctl -n hw.perflevel0.physicalcpu 2>/dev/null ||\
|
||||
nproc 2>/dev/null ||\
|
||||
echo 4)
|
||||
MAKE = make -j $(JOBS)
|
||||
SCONS = scons -Q -j $(JOBS)
|
||||
|
||||
BUILD_DIR = build
|
||||
BOARDLOADER_BUILD_DIR = $(BUILD_DIR)/boardloader
|
||||
@ -32,15 +31,19 @@ PYOPT ?= 1
|
||||
BITCOIN_ONLY ?= 0
|
||||
BOOTLOADER_QA ?= 0
|
||||
BOOTLOADER_DEVEL ?= 0
|
||||
DISABLE_OPTIGA ?= 0
|
||||
TREZOR_MODEL ?= T
|
||||
TREZOR_MEMPERF ?= 0
|
||||
ADDRESS_SANITIZER ?= 0
|
||||
CMAKELISTS ?= 0
|
||||
PYTEST_TIMEOUT ?= 500
|
||||
TEST_LANG ?= "en"
|
||||
NEW_RENDERING ?= 1
|
||||
THP ?= 0
|
||||
BENCHMARK ?= 0
|
||||
TREZOR_EMULATOR_DEBUGGABLE ?= 0
|
||||
QUIET_MODE ?= 0
|
||||
TREZOR_DISABLE_ANIMATION ?= $(if $(filter 0,$(PYOPT)),1,0)
|
||||
STORAGE_INSECURE_TESTING_MODE ?= 0
|
||||
|
||||
# OpenOCD interface default. Alternative: ftdi/olimex-arm-usb-tiny-h
|
||||
OPENOCD_INTERFACE ?= stlink
|
||||
@ -64,8 +67,8 @@ MCU = STM32U5
|
||||
OPENOCD_TARGET = target/stm32u5x.cfg
|
||||
MODEL_FEATURE = model_tr
|
||||
else ifeq ($(TREZOR_MODEL),$(filter $(TREZOR_MODEL),T3W1))
|
||||
MCU = STM32F4
|
||||
OPENOCD_TARGET = target/stm32f4x.cfg
|
||||
MCU = STM32U5
|
||||
OPENOCD_TARGET = target/stm32u5x.cfg
|
||||
MODEL_FEATURE = model_tt
|
||||
else ifeq ($(TREZOR_MODEL),$(filter $(TREZOR_MODEL),DISC1))
|
||||
MCU = STM32F4
|
||||
@ -128,6 +131,34 @@ TREZOR_FIDO2_UDP_PORT = 21326
|
||||
RUST_TARGET=$(shell rustc -vV | sed -n 's/host: //p')
|
||||
|
||||
MULTICORE ?= "auto"
|
||||
RANDOM=$(shell python -c 'import random; print(random.randint(0, 1000000))')
|
||||
|
||||
SCONS_VARS = \
|
||||
BENCHMARK="$(BENCHMARK)" \
|
||||
BITCOIN_ONLY="$(BITCOIN_ONLY)" \
|
||||
BOOTLOADER_DEVEL="$(BOOTLOADER_DEVEL)" \
|
||||
BOOTLOADER_QA="$(BOOTLOADER_QA)" \
|
||||
CFLAGS="$(CFLAGS)" \
|
||||
CMAKELISTS="$(CMAKELISTS)" \
|
||||
DISABLE_OPTIGA="$(DISABLE_OPTIGA)" \
|
||||
NEW_RENDERING="$(NEW_RENDERING)" \
|
||||
PRODUCTION="$(PRODUCTION)" \
|
||||
PYOPT="$(PYOPT)" \
|
||||
QUIET_MODE="$(QUIET_MODE)" \
|
||||
STORAGE_INSECURE_TESTING_MODE="$(STORAGE_INSECURE_TESTING_MODE)" \
|
||||
THP="$(THP)" \
|
||||
TREZOR_DISABLE_ANIMATION="$(TREZOR_DISABLE_ANIMATION)" \
|
||||
TREZOR_EMULATOR_ASAN="$(ADDRESS_SANITIZER)" \
|
||||
TREZOR_EMULATOR_DEBUGGABLE=$(TREZOR_EMULATOR_DEBUGGABLE) \
|
||||
TREZOR_MEMPERF="$(TREZOR_MEMPERF)" \
|
||||
TREZOR_MODEL="$(TREZOR_MODEL)"
|
||||
|
||||
SCONS_OPTS = -Q -j $(JOBS)
|
||||
ifeq ($(QUIET_MODE),1)
|
||||
SCONS_OPTS += --quiet
|
||||
endif
|
||||
|
||||
SCONS = scons $(SCONS_OPTS) $(SCONS_VARS)
|
||||
|
||||
## help commands:
|
||||
|
||||
@ -163,7 +194,7 @@ test_emu: ## run selected device tests from python-trezor
|
||||
|
||||
test_emu_multicore: ## run device tests using multiple cores
|
||||
$(PYTEST) -n $(MULTICORE) $(TESTPATH)/device_tests $(TESTOPTS) --timeout $(PYTEST_TIMEOUT) \
|
||||
--control-emulators --model=core --random-order-seed=$(shell echo $$RANDOM) \
|
||||
--control-emulators --model=core --random-order-seed=$(RANDOM) \
|
||||
--lang=$(TEST_LANG)
|
||||
|
||||
test_emu_monero: ## run selected monero device tests from monero-agent
|
||||
@ -199,7 +230,7 @@ test_emu_ui: ## run ui integration tests
|
||||
test_emu_ui_multicore: ## run ui integration tests using multiple cores
|
||||
$(PYTEST) -n $(MULTICORE) $(TESTPATH)/device_tests $(TESTOPTS) --timeout $(PYTEST_TIMEOUT) \
|
||||
--ui=test --ui-check-missing --record-text-layout --do-master-diff \
|
||||
--control-emulators --model=core --random-order-seed=$(shell echo $$RANDOM) \
|
||||
--control-emulators --model=core --random-order-seed=$(RANDOM) \
|
||||
--lang=$(TEST_LANG)
|
||||
|
||||
test_emu_ui_record: ## record and hash screens for ui integration tests
|
||||
@ -239,6 +270,8 @@ translations: ## update translations
|
||||
python ./translations/cli.py gen
|
||||
|
||||
translations_check: ## check that translations are up to date
|
||||
python ./translations/order.py --check
|
||||
python ./translations/cli.py gen --check
|
||||
# spits out error if the stored merkle root is not up to date
|
||||
python ./translations/cli.py merkle-root > /dev/null
|
||||
|
||||
@ -249,69 +282,43 @@ build: build_boardloader build_bootloader build_firmware build_prodtest build_un
|
||||
build_embed: build_boardloader build_bootloader build_firmware # build boardloader, bootloader, firmware
|
||||
|
||||
build_boardloader: ## build boardloader
|
||||
$(SCONS) CFLAGS="$(CFLAGS)" PRODUCTION="$(PRODUCTION)" TREZOR_MODEL="$(TREZOR_MODEL)" \
|
||||
CMAKELISTS="$(CMAKELISTS)" NEW_RENDERING="$(NEW_RENDERING)" $(BOARDLOADER_BUILD_DIR)/boardloader.bin
|
||||
$(SCONS) $(BOARDLOADER_BUILD_DIR)/boardloader.bin
|
||||
|
||||
build_bootloader: ## build bootloader
|
||||
$(SCONS) CFLAGS="$(CFLAGS)" PRODUCTION="$(PRODUCTION)" TREZOR_MODEL="$(TREZOR_MODEL)" \
|
||||
CMAKELISTS="$(CMAKELISTS)" BOOTLOADER_QA="$(BOOTLOADER_QA)" BOOTLOADER_DEVEL="$(BOOTLOADER_DEVEL)" \
|
||||
NEW_RENDERING="$(NEW_RENDERING)" $(BOOTLOADER_BUILD_DIR)/bootloader.bin
|
||||
$(SCONS) $(BOOTLOADER_BUILD_DIR)/bootloader.bin
|
||||
|
||||
build_bootloader_ci: ## build CI device testing bootloader
|
||||
$(SCONS) CFLAGS="$(CFLAGS)" PRODUCTION="$(PRODUCTION)" TREZOR_MODEL="$(TREZOR_MODEL)" \
|
||||
CMAKELISTS="$(CMAKELISTS)" $(BOOTLOADER_CI_BUILD_DIR)/bootloader.bin
|
||||
$(SCONS) $(BOOTLOADER_CI_BUILD_DIR)/bootloader.bin
|
||||
|
||||
build_bootloader_emu: ## build the unix bootloader emulator
|
||||
$(SCONS) CFLAGS="$(CFLAGS)" PRODUCTION="$(PRODUCTION)" TREZOR_MODEL="$(TREZOR_MODEL)" \
|
||||
CMAKELISTS="$(CMAKELISTS)" NEW_RENDERING="$(NEW_RENDERING)" $(BOOTLOADER_EMU_BUILD_DIR)/bootloader.elf
|
||||
$(SCONS) $(BOOTLOADER_EMU_BUILD_DIR)/bootloader.elf
|
||||
|
||||
build_bootloader_emu_debug: ## build the unix bootloader emulator
|
||||
$(SCONS) CFLAGS="$(CFLAGS)" PRODUCTION="$(PRODUCTION)" TREZOR_MODEL="$(TREZOR_MODEL)" \
|
||||
CMAKELISTS="$(CMAKELISTS)" NEW_RENDERING="$(NEW_RENDERING)" TREZOR_EMULATOR_DEBUGGABLE=1 \
|
||||
$(BOOTLOADER_EMU_BUILD_DIR)/bootloader.elf
|
||||
$(SCONS) TREZOR_EMULATOR_DEBUGGABLE=1 $(BOOTLOADER_EMU_BUILD_DIR)/bootloader.elf
|
||||
|
||||
build_prodtest: ## build production test firmware
|
||||
$(SCONS) CFLAGS="$(CFLAGS)" PRODUCTION="$(PRODUCTION)" TREZOR_MODEL="$(TREZOR_MODEL)" \
|
||||
CMAKELISTS="$(CMAKELISTS)" BOOTLOADER_DEVEL="$(BOOTLOADER_DEVEL)" $(PRODTEST_BUILD_DIR)/prodtest.bin
|
||||
$(SCONS) $(PRODTEST_BUILD_DIR)/prodtest.bin
|
||||
|
||||
build_reflash: ## build reflash firmware + reflash image
|
||||
$(SCONS) CFLAGS="$(CFLAGS)" PRODUCTION="$(PRODUCTION)" TREZOR_MODEL="$(TREZOR_MODEL)" \
|
||||
CMAKELISTS="$(CMAKELISTS)" NEW_RENDERING="$(NEW_RENDERING)" $(REFLASH_BUILD_DIR)/reflash.bin
|
||||
$(SCONS) $(REFLASH_BUILD_DIR)/reflash.bin
|
||||
dd if=build/boardloader/boardloader.bin of=$(REFLASH_BUILD_DIR)/sdimage.bin bs=1 seek=0
|
||||
dd if=build/bootloader/bootloader.bin of=$(REFLASH_BUILD_DIR)/sdimage.bin bs=1 seek=49152
|
||||
|
||||
build_kernel: ## build kernel image
|
||||
$(SCONS) CFLAGS="$(CFLAGS)" PRODUCTION="$(PRODUCTION)" \
|
||||
TREZOR_MODEL="$(TREZOR_MODEL)" CMAKELISTS="$(CMAKELISTS)" \
|
||||
BOOTLOADER_QA="$(BOOTLOADER_QA)" BOOTLOADER_DEVEL="$(BOOTLOADER_DEVEL)" \
|
||||
$(KERNEL_BUILD_DIR)/kernel.bin
|
||||
$(SCONS) PYOPT=1 $(KERNEL_BUILD_DIR)/kernel.bin
|
||||
|
||||
build_firmware: templates build_cross build_kernel ## build firmware with frozen modules
|
||||
$(SCONS) CFLAGS="$(CFLAGS)" PRODUCTION="$(PRODUCTION)" \
|
||||
TREZOR_MODEL="$(TREZOR_MODEL)" CMAKELISTS="$(CMAKELISTS)" \
|
||||
PYOPT="$(PYOPT)" BITCOIN_ONLY="$(BITCOIN_ONLY)" \
|
||||
BOOTLOADER_QA="$(BOOTLOADER_QA)" BOOTLOADER_DEVEL="$(BOOTLOADER_DEVEL)" \
|
||||
DISABLE_OPTIGA="$(DISABLE_OPTIGA)" THP="$(THP)" NEW_RENDERING="$(NEW_RENDERING)" \
|
||||
BENCHMARK="$(BENCHMARK)" $(FIRMWARE_BUILD_DIR)/firmware.bin
|
||||
$(SCONS) $(FIRMWARE_BUILD_DIR)/firmware.bin
|
||||
|
||||
build_unix: templates ## build unix port
|
||||
$(SCONS) CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/trezor-emu-core $(UNIX_PORT_OPTS) \
|
||||
TREZOR_MODEL="$(TREZOR_MODEL)" CMAKELISTS="$(CMAKELISTS)" THP="$(THP)" \
|
||||
PYOPT="0" BITCOIN_ONLY="$(BITCOIN_ONLY)" TREZOR_EMULATOR_ASAN="$(ADDRESS_SANITIZER)" \
|
||||
NEW_RENDERING="$(NEW_RENDERING)" BENCHMARK="$(BENCHMARK)"
|
||||
$(SCONS) PYOPT=0 $(UNIX_BUILD_DIR)/trezor-emu-core $(UNIX_PORT_OPTS)
|
||||
|
||||
build_unix_frozen: templates build_cross ## build unix port with frozen modules
|
||||
$(SCONS) CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/trezor-emu-core $(UNIX_PORT_OPTS) \
|
||||
TREZOR_MODEL="$(TREZOR_MODEL)" CMAKELISTS="$(CMAKELISTS)" \
|
||||
PYOPT="$(PYOPT)" BITCOIN_ONLY="$(BITCOIN_ONLY)" TREZOR_EMULATOR_ASAN="$(ADDRESS_SANITIZER)" \
|
||||
TREZOR_MEMPERF="$(TREZOR_MEMPERF)" TREZOR_EMULATOR_FROZEN=1 NEW_RENDERING="$(NEW_RENDERING)" \
|
||||
BENCHMARK="$(BENCHMARK)"
|
||||
$(SCONS) $(UNIX_BUILD_DIR)/trezor-emu-core $(UNIX_PORT_OPTS) TREZOR_EMULATOR_FROZEN=1
|
||||
|
||||
build_unix_debug: templates ## build unix port
|
||||
$(SCONS) --max-drift=1 CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/trezor-emu-core $(UNIX_PORT_OPTS) \
|
||||
TREZOR_MODEL="$(TREZOR_MODEL)" CMAKELISTS="$(CMAKELISTS)" \
|
||||
BITCOIN_ONLY="$(BITCOIN_ONLY)" TREZOR_EMULATOR_ASAN=1 TREZOR_EMULATOR_DEBUGGABLE=1 \
|
||||
NEW_RENDERING="$(NEW_RENDERING)" BENCHMARK="$(BENCHMARK)"
|
||||
$(SCONS) --max-drift=1 $(UNIX_BUILD_DIR)/trezor-emu-core $(UNIX_PORT_OPTS) \
|
||||
TREZOR_EMULATOR_ASAN=1 TREZOR_EMULATOR_DEBUGGABLE=1
|
||||
|
||||
build_cross: ## build mpy-cross port
|
||||
$(MAKE) -C vendor/micropython/mpy-cross $(CROSS_PORT_OPTS)
|
||||
@ -399,10 +406,10 @@ flash_erase_storage: ## erase storage sectors from flash
|
||||
$(OPENOCD) -c "init; reset halt; flash erase_sector 0 $(STORAGE_1_SECTOR_START) $(STORAGE_1_SECTOR_END); flash erase_sector 0 $(STORAGE_2_SECTOR_START) $(STORAGE_2_SECTOR_END); exit"
|
||||
|
||||
flash_bootloader_jlink: $(BOOTLOADER_BUILD_DIR)/bootloader.bin ## flash bootloader using JLink
|
||||
JLinkExe -nogui 1 -commanderscript embed/bootloader/bootloader_flash.jlink
|
||||
JLinkExe -nogui 1 -commanderscript embed/projects/bootloader/bootloader_flash.jlink
|
||||
|
||||
flash_bootloader_ci_jlink: $(BOOTLOADER_CI_BUILD_DIR)/bootloader.bin ## flash CI bootloader using JLink
|
||||
JLinkExe -nogui 1 -commanderscript embed/bootloader_ci/bootloader_flash.jlink
|
||||
JLinkExe -nogui 1 -commanderscript embed/projects/bootloader_ci/bootloader_flash.jlink
|
||||
|
||||
flash_firmware_jlink: $(FIRMWARE_BUILD_DIR)/firmware.bin ## flash firmware using JLink. file names must end in .bin for JLink
|
||||
cp -f $<.p1 $<.p1.bin
|
||||
@ -410,7 +417,7 @@ flash_firmware_jlink: $(FIRMWARE_BUILD_DIR)/firmware.bin ## flash firmware using
|
||||
## pad 2nd part so that FW integrity works after flash
|
||||
## read&compare in flashing will avoid erasing unmodified sectors
|
||||
truncate -s $(FIRMWARE_P2_MAXSIZE) $<.p2.bin
|
||||
JLinkExe -nogui 1 -commanderscript embed/firmware/firmware_flash.jlink
|
||||
JLinkExe -nogui 1 -commanderscript embed/projects/firmware/firmware_flash.jlink
|
||||
|
||||
## openocd debug commands:
|
||||
|
||||
@ -444,12 +451,19 @@ bloaty: ## run bloaty size profiler
|
||||
bloaty -d symbols -n 0 -s file $(FIRMWARE_BUILD_DIR)/firmware.elf | less
|
||||
bloaty -d compileunits -n 0 -s file $(FIRMWARE_BUILD_DIR)/firmware.elf | less
|
||||
|
||||
ifeq ($(MCU),$(filter $(MCU),STM32F4))
|
||||
sizecheck: ## check sizes of binary files
|
||||
test $(BOARDLOADER_MAXSIZE) -ge $(shell wc -c < $(BOARDLOADER_BUILD_DIR)/boardloader.bin)
|
||||
test $(BOOTLOADER_MAXSIZE) -ge $(shell wc -c < $(BOOTLOADER_BUILD_DIR)/bootloader.bin)
|
||||
test $(FIRMWARE_P1_MAXSIZE) -ge $(shell wc -c < $(FIRMWARE_BUILD_DIR)/firmware.bin.p1)
|
||||
test $(FIRMWARE_P2_MAXSIZE) -ge $(shell wc -c < $(FIRMWARE_BUILD_DIR)/firmware.bin.p2)
|
||||
test $(FIRMWARE_MAXSIZE) -ge $(shell wc -c < $(FIRMWARE_BUILD_DIR)/firmware.bin)
|
||||
test "$(BOARDLOADER_MAXSIZE)" -ge "$(shell wc -c < $(BOARDLOADER_BUILD_DIR)/boardloader.bin)"
|
||||
test "$(BOOTLOADER_MAXSIZE)" -ge "$(shell wc -c < $(BOOTLOADER_BUILD_DIR)/bootloader.bin)"
|
||||
test "$(FIRMWARE_P1_MAXSIZE)" -ge "$(shell wc -c < $(FIRMWARE_BUILD_DIR)/firmware.bin.p1)"
|
||||
test "$(FIRMWARE_P2_MAXSIZE)" -ge "$(shell wc -c < $(FIRMWARE_BUILD_DIR)/firmware.bin.p2)"
|
||||
test "$(FIRMWARE_MAXSIZE)" -ge "$(shell wc -c < $(FIRMWARE_BUILD_DIR)/firmware.bin)"
|
||||
else ifeq ($(MCU),$(filter $(MCU),STM32U5))
|
||||
sizecheck: ## check sizes of binary files
|
||||
test "$(BOARDLOADER_MAXSIZE)" -ge "$(shell wc -c < $(BOARDLOADER_BUILD_DIR)/boardloader.bin)"
|
||||
test "$(BOOTLOADER_MAXSIZE)" -ge "$(shell wc -c < $(BOOTLOADER_BUILD_DIR)/bootloader.bin)"
|
||||
test "$(FIRMWARE_MAXSIZE)" -ge "$(shell wc -c < $(FIRMWARE_BUILD_DIR)/firmware.bin)"
|
||||
endif
|
||||
|
||||
combine: ## combine boardloader + bootloader + prodtest into one combined image
|
||||
combine_firmware \
|
||||
|
@ -6,14 +6,10 @@ import tools, models
|
||||
TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T')
|
||||
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
|
||||
HW_REVISION = ARGUMENTS.get('HW_REVISION', None)
|
||||
NEW_RENDERING = ARGUMENTS.get('NEW_RENDERING', '1') == '1'
|
||||
MODEL_IDENTIFIER = models.get_model_identifier(TREZOR_MODEL)
|
||||
|
||||
FEATURES_WANTED = ["sd_card"]
|
||||
|
||||
if NEW_RENDERING:
|
||||
FEATURES_WANTED.append("new_rendering")
|
||||
|
||||
CCFLAGS_MOD = ''
|
||||
CPPPATH_MOD = []
|
||||
CPPDEFINES_MOD = ["BOARDLOADER"]
|
||||
@ -56,46 +52,38 @@ CPPPATH_MOD += [
|
||||
'vendor/micropython/lib/uzlib',
|
||||
]
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/colors.c',
|
||||
'embed/lib/display_utils.c',
|
||||
'embed/lib/error_handling.c',
|
||||
'embed/lib/flash_utils.c',
|
||||
'embed/lib/fonts/font_bitmap.c',
|
||||
'embed/lib/fonts/fonts.c',
|
||||
'embed/lib/gfx_color.c',
|
||||
'embed/lib/gfx_bitblt_rgb565.c',
|
||||
'embed/lib/gfx_bitblt_rgba8888.c',
|
||||
'embed/lib/gfx_bitblt_mono8.c',
|
||||
'embed/lib/image.c',
|
||||
'embed/lib/mini_printf.c',
|
||||
'embed/lib/rsod.c',
|
||||
'embed/lib/terminal.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_rgb565.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_rgba8888.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_mono8.c',
|
||||
'embed/gfx/fonts/font_bitmap.c',
|
||||
'embed/gfx/fonts/fonts.c',
|
||||
'embed/gfx/gfx_color.c',
|
||||
'embed/gfx/gfx_draw.c',
|
||||
'embed/gfx/terminal.c',
|
||||
'embed/io/display/display_utils.c',
|
||||
'embed/util/flash/flash_utils.c',
|
||||
'embed/util/image/image.c',
|
||||
'embed/util/rsod/rsod.c',
|
||||
'embed/rtl/error_handling.c',
|
||||
'embed/rtl/mini_printf.c',
|
||||
]
|
||||
if NEW_RENDERING:
|
||||
CPPDEFINES_MOD += ['NEW_RENDERING']
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/gfx_draw.c',
|
||||
]
|
||||
else:
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/display_draw.c',
|
||||
]
|
||||
|
||||
|
||||
|
||||
env = Environment(ENV=os.environ,
|
||||
CFLAGS='%s -DPRODUCTION=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0')),
|
||||
CONSTRAINTS=["limited_util_s"],
|
||||
CPPDEFINES_IMPLICIT=[]
|
||||
)
|
||||
CFLAGS='%s -DPRODUCTION=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0')),
|
||||
CONSTRAINTS=["limited_util_s"],
|
||||
CPPDEFINES_IMPLICIT=[],
|
||||
CPPDEFPREFIX="-D'",
|
||||
CPPDEFSUFFIX="'",
|
||||
)
|
||||
|
||||
FEATURES_AVAILABLE = models.configure_board(TREZOR_MODEL, HW_REVISION, FEATURES_WANTED, env, CPPDEFINES_HAL, SOURCE_HAL, PATH_HAL)
|
||||
|
||||
FILE_SUFFIX= env.get('ENV')['SUFFIX']
|
||||
|
||||
SOURCE_BOARDLOADER = [
|
||||
f"embed/trezorhal/{FILE_SUFFIX}/startup_stage_0.s",
|
||||
'embed/boardloader/main.c',
|
||||
f"embed/sys/startup/{FILE_SUFFIX}/startup_stage_0.s",
|
||||
'embed/projects/boardloader/main.c',
|
||||
]
|
||||
|
||||
|
||||
@ -128,11 +116,18 @@ env.Replace(
|
||||
CCFLAGS_QSTR='-DNO_QSTR -DN_X64 -DN_X86 -DN_THUMB',
|
||||
LINKFLAGS="-T build/boardloader/memory.ld -Wl,--gc-sections -Wl,-Map=build/boardloader/boardloader.map -Wl,--warn-common -Wl,--print-memory-usage",
|
||||
CPPPATH=[
|
||||
'embed/boardloader',
|
||||
'embed/lib',
|
||||
'embed/projects/boardloader',
|
||||
'embed/rtl/inc',
|
||||
'embed/models',
|
||||
'embed/trezorhal',
|
||||
'embed/extmod/modtrezorui',
|
||||
'embed/upymod/modtrezorui',
|
||||
'embed/gfx/inc',
|
||||
'embed/io/button/inc',
|
||||
'embed/io/haptic/inc',
|
||||
'embed/io/touch/inc',
|
||||
'embed/io/usb/inc',
|
||||
'embed/sys/bsp/inc',
|
||||
'embed/util/image/inc',
|
||||
'embed/util/rsod/inc',
|
||||
'vendor/micropython/lib/cmsis/inc',
|
||||
] + CPPPATH_MOD + PATH_HAL,
|
||||
CPPDEFINES=[
|
||||
@ -180,7 +175,7 @@ program_elf = env.Command(
|
||||
env.Depends(program_elf, linkerscript_gen)
|
||||
|
||||
BINARY_NAME = f"build/boardloader/boardloader-{models.get_model_identifier(TREZOR_MODEL)}"
|
||||
BINARY_NAME += "-" + tools.get_version('embed/boardloader/version.h')
|
||||
BINARY_NAME += "-" + tools.get_version('embed/projects/boardloader/version.h')
|
||||
BINARY_NAME += "-" + tools.get_git_revision_short_hash()
|
||||
BINARY_NAME += "-dirty" if tools.get_git_modified() else ""
|
||||
BINARY_NAME += ".bin"
|
||||
|
@ -1,6 +1,7 @@
|
||||
# pylint: disable=E0602
|
||||
|
||||
import os
|
||||
import shlex
|
||||
import tools, models, ui
|
||||
|
||||
TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T')
|
||||
@ -8,14 +9,10 @@ CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
|
||||
BOOTLOADER_QA = ARGUMENTS.get('BOOTLOADER_QA', '0') == '1'
|
||||
PRODUCTION = 0 if BOOTLOADER_QA else ARGUMENTS.get('PRODUCTION', '0') == '1'
|
||||
HW_REVISION = ARGUMENTS.get('HW_REVISION', None)
|
||||
NEW_RENDERING = ARGUMENTS.get('NEW_RENDERING', '1') == '1' or TREZOR_MODEL in ('T3T1',)
|
||||
MODEL_IDENTIFIER = models.get_model_identifier(TREZOR_MODEL)
|
||||
|
||||
FEATURES_WANTED = ["input", "rgb_led", "consumption_mask", "usb", "optiga", "dma2d"]
|
||||
|
||||
if NEW_RENDERING:
|
||||
FEATURES_WANTED.append("new_rendering")
|
||||
|
||||
CCFLAGS_MOD = ''
|
||||
CPPPATH_MOD = []
|
||||
CPPDEFINES_MOD = []
|
||||
@ -65,39 +62,27 @@ CPPPATH_MOD += [
|
||||
]
|
||||
|
||||
SOURCE_MOD += [
|
||||
'embed/extmod/modtrezorcrypto/rand.c',
|
||||
'embed/lib/buffers.c',
|
||||
'embed/lib/colors.c',
|
||||
'embed/lib/display_utils.c',
|
||||
'embed/lib/error_handling.c',
|
||||
'embed/lib/flash_utils.c',
|
||||
'embed/lib/fonts/font_bitmap.c',
|
||||
'embed/lib/fonts/fonts.c',
|
||||
'embed/lib/gfx_color.c',
|
||||
'embed/lib/gfx_bitblt_mono8.c',
|
||||
'embed/lib/gfx_bitblt_rgb565.c',
|
||||
'embed/lib/gfx_bitblt_rgba8888.c',
|
||||
'embed/lib/image.c',
|
||||
'embed/lib/mini_printf.c',
|
||||
'embed/lib/rsod.c',
|
||||
'embed/lib/terminal.c',
|
||||
'embed/lib/unit_variant.c',
|
||||
'embed/upymod/modtrezorcrypto/rand.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_mono8.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_rgb565.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_rgba8888.c',
|
||||
'embed/gfx/fonts/font_bitmap.c',
|
||||
'embed/gfx/fonts/fonts.c',
|
||||
'embed/gfx/gfx_color.c',
|
||||
'embed/gfx/gfx_draw.c',
|
||||
'embed/gfx/terminal.c',
|
||||
'embed/io/display/display_utils.c',
|
||||
'embed/util/flash/flash_utils.c',
|
||||
'embed/util/image/image.c',
|
||||
'embed/util/rsod/rsod.c',
|
||||
'embed/rtl/error_handling.c',
|
||||
'embed/rtl/mini_printf.c',
|
||||
'vendor/micropython/lib/uzlib/adler32.c',
|
||||
'vendor/micropython/lib/uzlib/crc32.c',
|
||||
'vendor/micropython/lib/uzlib/tinflate.c',
|
||||
]
|
||||
|
||||
if NEW_RENDERING:
|
||||
CPPDEFINES_MOD += ['NEW_RENDERING']
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/gfx_draw.c',
|
||||
]
|
||||
else:
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/display_draw.c',
|
||||
]
|
||||
|
||||
|
||||
SOURCE_NANOPB = [
|
||||
'vendor/nanopb/pb_common.c',
|
||||
'vendor/nanopb/pb_decode.c',
|
||||
@ -109,7 +94,9 @@ ui.init_ui(TREZOR_MODEL, "bootloader", CPPDEFINES_MOD, SOURCE_MOD, RUST_UI_FEATU
|
||||
env = Environment(
|
||||
ENV=os.environ,
|
||||
CFLAGS=f"{ARGUMENTS.get('CFLAGS', '')} -DPRODUCTION={int(PRODUCTION)} -DBOOTLOADER_QA={int(BOOTLOADER_QA)}",
|
||||
CPPDEFINES_IMPLICIT=[]
|
||||
CPPDEFINES_IMPLICIT=[],
|
||||
CPPDEFPREFIX="-D'",
|
||||
CPPDEFSUFFIX="'",
|
||||
)
|
||||
|
||||
FEATURES_AVAILABLE = models.configure_board(TREZOR_MODEL, HW_REVISION, FEATURES_WANTED, env, CPPDEFINES_HAL, SOURCE_HAL, PATH_HAL)
|
||||
@ -117,13 +104,13 @@ FEATURES_AVAILABLE = models.configure_board(TREZOR_MODEL, HW_REVISION, FEATURES_
|
||||
FILE_SUFFIX= env.get('ENV')['SUFFIX']
|
||||
|
||||
SOURCE_BOOTLOADER = [
|
||||
f'embed/trezorhal/{FILE_SUFFIX}/startup_stage_1.s',
|
||||
'embed/bootloader/header.S',
|
||||
'embed/bootloader/bootui.c',
|
||||
'embed/bootloader/main.c',
|
||||
'embed/bootloader/messages.c',
|
||||
'embed/bootloader/protob/messages.pb.c',
|
||||
'embed/bootloader/version_check.c',
|
||||
f'embed/sys/startup/{FILE_SUFFIX}/startup_stage_1.s',
|
||||
'embed/projects/bootloader/header.S',
|
||||
'embed/projects/bootloader/bootui.c',
|
||||
'embed/projects/bootloader/main.c',
|
||||
'embed/projects/bootloader/messages.c',
|
||||
'embed/projects/bootloader/protob/messages.pb.c',
|
||||
'embed/projects/bootloader/version_check.c',
|
||||
]
|
||||
|
||||
|
||||
@ -145,13 +132,17 @@ env.Replace(
|
||||
|
||||
ALLPATHS = [
|
||||
'embed/rust',
|
||||
'embed/bootloader',
|
||||
'embed/bootloader/nanopb',
|
||||
'embed/bootloader/protob',
|
||||
'embed/lib',
|
||||
'embed/projects/bootloader',
|
||||
'embed/projects/bootloader/nanopb',
|
||||
'embed/projects/bootloader/protob',
|
||||
'embed/rtl/inc',
|
||||
'embed/models',
|
||||
'embed/trezorhal',
|
||||
'embed/extmod/modtrezorui',
|
||||
'embed/sys/bsp/inc',
|
||||
'embed/gfx/inc',
|
||||
'embed/util/translations/inc',
|
||||
'embed/util/image/inc',
|
||||
'embed/util/rsod/inc',
|
||||
'embed/upymod/modtrezorui',
|
||||
'vendor/nanopb',
|
||||
] + CPPPATH_MOD + PATH_HAL
|
||||
|
||||
@ -217,9 +208,6 @@ def cargo_build():
|
||||
features.append("bootloader")
|
||||
features.extend(FEATURES_AVAILABLE)
|
||||
|
||||
if NEW_RENDERING:
|
||||
features.append('new_rendering')
|
||||
|
||||
cargo_opts = [
|
||||
f'--target={env.get("ENV")["RUST_TARGET"]}',
|
||||
f'--target-dir=../../build/bootloader/rust',
|
||||
@ -232,7 +220,7 @@ def cargo_build():
|
||||
bindgen_macros = tools.get_bindgen_defines(env.get("CPPDEFINES"), ALLPATHS)
|
||||
build_dir = str(Dir('.').abspath)
|
||||
|
||||
return f'export BINDGEN_MACROS=\'{bindgen_macros}\'; export BUILD_DIR=\'{build_dir}\'; cd embed/rust; cargo build {profile} ' + ' '.join(cargo_opts)
|
||||
return f'export BINDGEN_MACROS={shlex.quote(bindgen_macros)}; export BUILD_DIR=\'{build_dir}\'; cd embed/rust; cargo build {profile} ' + ' '.join(cargo_opts)
|
||||
|
||||
rust = env.Command(
|
||||
target=RUST_LIBPATH,
|
||||
@ -273,7 +261,7 @@ env.Depends(program_elf, rust)
|
||||
SUFFIX = '_qa' if BOOTLOADER_QA else ''
|
||||
|
||||
BINARY_NAME = f"build/bootloader/bootloader-{models.get_model_identifier(TREZOR_MODEL)}{SUFFIX}"
|
||||
BINARY_NAME += "-" + tools.get_version('embed/bootloader/version.h')
|
||||
BINARY_NAME += "-" + tools.get_version('embed/projects/bootloader/version.h')
|
||||
BINARY_NAME += "-" + tools.get_git_revision_short_hash()
|
||||
BINARY_NAME += "-dirty" if tools.get_git_modified() else ""
|
||||
BINARY_NAME += ".bin"
|
||||
|
@ -6,14 +6,10 @@ import tools, models, ui
|
||||
TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T')
|
||||
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
|
||||
HW_REVISION = ARGUMENTS.get('HW_REVISION', None)
|
||||
NEW_RENDERING = ARGUMENTS.get('NEW_RENDERING', '1') == '1' or TREZOR_MODEL in ('T3T1',)
|
||||
MODEL_IDENTIFIER = models.get_model_identifier(TREZOR_MODEL)
|
||||
|
||||
FEATURES_WANTED = ["input", "rgb_led", "consumption_mask", "usb", "optiga"]
|
||||
|
||||
if NEW_RENDERING:
|
||||
FEATURES_WANTED.append("new_rendering")
|
||||
|
||||
CCFLAGS_MOD = ''
|
||||
CPPPATH_MOD = []
|
||||
CPPDEFINES_MOD = []
|
||||
@ -60,38 +56,27 @@ CPPPATH_MOD += [
|
||||
'vendor/micropython/lib/uzlib',
|
||||
]
|
||||
SOURCE_MOD += [
|
||||
'embed/extmod/modtrezorcrypto/rand.c',
|
||||
'embed/lib/colors.c',
|
||||
'embed/lib/display_utils.c',
|
||||
'embed/lib/error_handling.c',
|
||||
'embed/lib/flash_utils.c',
|
||||
'embed/lib/fonts/font_bitmap.c',
|
||||
'embed/lib/fonts/fonts.c',
|
||||
'embed/lib/gfx_color.c',
|
||||
'embed/lib/gfx_bitblt_mono8.c',
|
||||
'embed/lib/gfx_bitblt_rgb565.c',
|
||||
'embed/lib/gfx_bitblt_rgba8888.c',
|
||||
'embed/lib/image.c',
|
||||
'embed/lib/mini_printf.c',
|
||||
'embed/lib/rsod.c',
|
||||
'embed/lib/terminal.c',
|
||||
'embed/upymod/modtrezorcrypto/rand.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_mono8.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_rgb565.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_rgba8888.c',
|
||||
'embed/gfx/fonts/font_bitmap.c',
|
||||
'embed/gfx/fonts/fonts.c',
|
||||
'embed/gfx/gfx_color.c',
|
||||
'embed/gfx/gfx_draw.c',
|
||||
'embed/gfx/terminal.c',
|
||||
'embed/io/display/display_utils.c',
|
||||
'embed/util/flash/flash_utils.c',
|
||||
'embed/util/image/image.c',
|
||||
'embed/util/rsod/rsod.c',
|
||||
'embed/rtl/error_handling.c',
|
||||
'embed/rtl/mini_printf.c',
|
||||
'vendor/micropython/lib/uzlib/adler32.c',
|
||||
'vendor/micropython/lib/uzlib/crc32.c',
|
||||
'vendor/micropython/lib/uzlib/tinflate.c',
|
||||
]
|
||||
|
||||
|
||||
if NEW_RENDERING:
|
||||
CPPDEFINES_MOD += ['NEW_RENDERING']
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/gfx_draw.c',
|
||||
]
|
||||
else:
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/display_draw.c',
|
||||
]
|
||||
|
||||
|
||||
SOURCE_NANOPB = [
|
||||
'vendor/nanopb/pb_common.c',
|
||||
'vendor/nanopb/pb_decode.c',
|
||||
@ -101,22 +86,25 @@ SOURCE_NANOPB = [
|
||||
ui.init_ui(TREZOR_MODEL, "bootloader", CPPDEFINES_MOD, SOURCE_MOD, RUST_UI_FEATURES)
|
||||
|
||||
env = Environment(
|
||||
ENV=os.environ, CFLAGS='%s -DPRODUCTION=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0')),
|
||||
CPPDEFINES_IMPLICIT=[]
|
||||
)
|
||||
ENV=os.environ,
|
||||
CFLAGS='%s -DPRODUCTION=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0')),
|
||||
CPPDEFINES_IMPLICIT=[],
|
||||
CPPDEFPREFIX="-D'",
|
||||
CPPDEFSUFFIX="'",
|
||||
)
|
||||
|
||||
FEATURES_AVAILABLE = models.configure_board(TREZOR_MODEL, HW_REVISION, FEATURES_WANTED, env, CPPDEFINES_HAL, SOURCE_HAL, PATH_HAL)
|
||||
|
||||
FILE_SUFFIX= env.get('ENV')['SUFFIX']
|
||||
|
||||
SOURCE_BOOTLOADER = [
|
||||
f'embed/trezorhal/{FILE_SUFFIX}/startup_stage_1.s',
|
||||
'embed/bootloader_ci/header.S',
|
||||
'embed/bootloader_ci/bootui.c',
|
||||
'embed/bootloader_ci/main.c',
|
||||
'embed/bootloader_ci/messages.c',
|
||||
'embed/bootloader_ci/protob/messages.pb.c',
|
||||
'embed/bootloader_ci/version_check.c',
|
||||
f'embed/sys/startup/{FILE_SUFFIX}/startup_stage_1.s',
|
||||
'embed/projects/bootloader_ci/header.S',
|
||||
'embed/projects/bootloader_ci/bootui.c',
|
||||
'embed/projects/bootloader_ci/main.c',
|
||||
'embed/projects/bootloader_ci/messages.c',
|
||||
'embed/projects/bootloader_ci/protob/messages.pb.c',
|
||||
'embed/projects/bootloader_ci/version_check.c',
|
||||
]
|
||||
|
||||
env.Replace(
|
||||
@ -148,13 +136,16 @@ env.Replace(
|
||||
CCFLAGS_QSTR='-DNO_QSTR -DN_X64 -DN_X86 -DN_THUMB',
|
||||
LINKFLAGS=f'-T build/bootloader_ci/memory.ld -Wl,--gc-sections -Wl,-Map=build/bootloader_ci/bootloader.map -Wl,--warn-common',
|
||||
CPPPATH=[
|
||||
'embed/bootloader_ci',
|
||||
'embed/bootloader_ci/nanopb',
|
||||
'embed/bootloader_ci/protob',
|
||||
'embed/lib',
|
||||
'embed/projects/bootloader_ci',
|
||||
'embed/projects/bootloader_ci/nanopb',
|
||||
'embed/projects/bootloader_ci/protob',
|
||||
'embed/rtl/inc',
|
||||
'embed/models',
|
||||
'embed/trezorhal',
|
||||
'embed/extmod/modtrezorui',
|
||||
'embed/gfx/inc',
|
||||
'embed/sys/bsp/inc',
|
||||
'embed/util/image/inc',
|
||||
'embed/util/rsod/inc',
|
||||
'embed/upymod/modtrezorui',
|
||||
'vendor/nanopb',
|
||||
] + CPPPATH_MOD + PATH_HAL,
|
||||
CPPDEFINES=[
|
||||
@ -211,7 +202,7 @@ program_elf = env.Command(
|
||||
env.Depends(program_elf, linkerscript_gen)
|
||||
|
||||
BINARY_NAME = f"build/bootloader_ci/bootloader_ci-{models.get_model_identifier(TREZOR_MODEL)}"
|
||||
BINARY_NAME += "-" + tools.get_version('embed/bootloader_ci/version.h')
|
||||
BINARY_NAME += "-" + tools.get_version('embed/projects/bootloader_ci/version.h')
|
||||
BINARY_NAME += "-" + tools.get_git_revision_short_hash()
|
||||
BINARY_NAME += "-dirty" if tools.get_git_modified() else ""
|
||||
BINARY_NAME += ".bin"
|
||||
|
@ -1,12 +1,12 @@
|
||||
# pylint: disable=E0602
|
||||
|
||||
import os
|
||||
import shlex
|
||||
import tools, models, ui
|
||||
|
||||
TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T')
|
||||
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
|
||||
HW_REVISION = 'emulator'
|
||||
NEW_RENDERING = ARGUMENTS.get('NEW_RENDERING', '1') == '1' or TREZOR_MODEL in ('T3T1',)
|
||||
|
||||
if not models.has_emulator(TREZOR_MODEL):
|
||||
# skip bootloader build
|
||||
@ -20,10 +20,7 @@ if not models.has_emulator(TREZOR_MODEL):
|
||||
)
|
||||
Return()
|
||||
|
||||
FEATURES_WANTED = ["input", "rgb_led", "dma2d", "optiga_hal"]
|
||||
|
||||
if NEW_RENDERING:
|
||||
FEATURES_WANTED.append("new_rendering")
|
||||
FEATURES_WANTED = ["input", "rgb_led", "dma2d", "optiga"]
|
||||
|
||||
CCFLAGS_MOD = ''
|
||||
CPPPATH_MOD = []
|
||||
@ -71,38 +68,28 @@ CPPPATH_MOD += [
|
||||
]
|
||||
|
||||
SOURCE_MOD += [
|
||||
'embed/extmod/modtrezorcrypto/rand.c',
|
||||
'embed/lib/colors.c',
|
||||
'embed/lib/display_utils.c',
|
||||
'embed/lib/error_handling.c',
|
||||
'embed/lib/flash_utils.c',
|
||||
'embed/lib/fonts/font_bitmap.c',
|
||||
'embed/lib/fonts/fonts.c',
|
||||
'embed/lib/gfx_color.c',
|
||||
'embed/lib/gfx_bitblt_mono8.c',
|
||||
'embed/lib/gfx_bitblt_rgb565.c',
|
||||
'embed/lib/gfx_bitblt_rgba8888.c',
|
||||
'embed/lib/image.c',
|
||||
'embed/lib/mini_printf.c',
|
||||
'embed/lib/rsod.c',
|
||||
'embed/lib/terminal.c',
|
||||
'embed/lib/unit_variant.c',
|
||||
'embed/upymod/modtrezorcrypto/rand.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_mono8.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_rgb565.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_rgba8888.c',
|
||||
'embed/gfx/fonts/font_bitmap.c',
|
||||
'embed/gfx/fonts/fonts.c',
|
||||
'embed/gfx/gfx_color.c',
|
||||
'embed/gfx/gfx_draw.c',
|
||||
'embed/gfx/terminal.c',
|
||||
'embed/io/display/display_utils.c',
|
||||
'embed/util/flash/flash_utils.c',
|
||||
'embed/util/image/image.c',
|
||||
'embed/util/rsod/rsod.c',
|
||||
'embed/rtl/error_handling.c',
|
||||
'embed/rtl/mini_printf.c',
|
||||
'vendor/micropython/lib/uzlib/adler32.c',
|
||||
'vendor/micropython/lib/uzlib/crc32.c',
|
||||
'vendor/micropython/lib/uzlib/tinflate.c',
|
||||
'vendor/trezor-storage/flash_area.c',
|
||||
]
|
||||
|
||||
if NEW_RENDERING:
|
||||
CPPDEFINES_MOD += ['NEW_RENDERING']
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/gfx_draw.c',
|
||||
]
|
||||
else:
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/display_draw.c',
|
||||
]
|
||||
|
||||
SOURCE_NANOPB = [
|
||||
'vendor/nanopb/pb_common.c',
|
||||
'vendor/nanopb/pb_decode.c',
|
||||
@ -110,47 +97,43 @@ SOURCE_NANOPB = [
|
||||
]
|
||||
|
||||
SOURCE_BOOTLOADER = [
|
||||
'embed/bootloader/bootui.c',
|
||||
'embed/bootloader/main.c',
|
||||
'embed/bootloader/messages.c',
|
||||
'embed/bootloader/emulator.c',
|
||||
'embed/bootloader/version_check.c',
|
||||
'embed/bootloader/protob/messages.pb.c',
|
||||
'embed/projects/bootloader/bootui.c',
|
||||
'embed/projects/bootloader/main.c',
|
||||
'embed/projects/bootloader/messages.c',
|
||||
'embed/projects/bootloader/emulator.c',
|
||||
'embed/projects/bootloader/version_check.c',
|
||||
'embed/projects/bootloader/protob/messages.pb.c',
|
||||
]
|
||||
|
||||
SOURCE_TREZORHAL = [
|
||||
'embed/trezorhal/unix/bootutils.c',
|
||||
'embed/trezorhal/unix/common.c',
|
||||
'embed/trezorhal/unix/flash.c',
|
||||
'embed/trezorhal/unix/flash_otp.c',
|
||||
'embed/trezorhal/unix/mpu.c',
|
||||
'embed/trezorhal/unix/monoctr.c',
|
||||
'embed/trezorhal/unix/random_delays.c',
|
||||
'embed/trezorhal/unix/rng.c',
|
||||
'embed/trezorhal/unix/secret.c',
|
||||
'embed/trezorhal/unix/system.c',
|
||||
'embed/trezorhal/unix/systick.c',
|
||||
'embed/trezorhal/unix/systimer.c',
|
||||
'embed/trezorhal/unix/usb.c',
|
||||
'embed/io/display/unix/display_driver.c',
|
||||
'embed/io/usb/unix/usb.c',
|
||||
'embed/sec/monoctr/unix/monoctr.c',
|
||||
'embed/sec/random_delays/unix/random_delays.c',
|
||||
'embed/sec/rng/unix/rng.c',
|
||||
'embed/sec/secret/unix/secret.c',
|
||||
'embed/sys/mpu/unix/mpu.c',
|
||||
'embed/sys/startup/unix/bootutils.c',
|
||||
'embed/sys/task/unix/system.c',
|
||||
'embed/sys/time/unix/systick.c',
|
||||
'embed/sys/time/unix/systimer.c',
|
||||
'embed/util/flash/unix/flash.c',
|
||||
'embed/util/flash/unix/flash_otp.c',
|
||||
'embed/util/unit_properties/unix/unit_properties.c',
|
||||
]
|
||||
|
||||
if NEW_RENDERING:
|
||||
SOURCE_TREZORHAL += [
|
||||
'embed/trezorhal/unix/display_driver.c',
|
||||
'embed/trezorhal/xdisplay_legacy.c',
|
||||
]
|
||||
else:
|
||||
SOURCE_TREZORHAL += [
|
||||
'embed/trezorhal/unix/display-unix.c',
|
||||
]
|
||||
|
||||
SOURCE_UNIX = [
|
||||
'embed/unix/profile.c',
|
||||
'embed/projects/unix/profile.c',
|
||||
]
|
||||
|
||||
ui.init_ui(TREZOR_MODEL, "bootloader", CPPDEFINES_MOD, SOURCE_MOD, RUST_UI_FEATURES)
|
||||
|
||||
env = Environment(ENV=os.environ, CFLAGS='%s -DCONFIDENTIAL= -DPRODUCTION=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0')))
|
||||
env = Environment(
|
||||
ENV=os.environ,
|
||||
CFLAGS=ARGUMENTS.get('CFLAGS', '') + f" -DCONFIDENTIAL= -DPRODUCTION={ARGUMENTS.get('PRODUCTION', '0')}",
|
||||
CPPDEFPREFIX="-D'",
|
||||
CPPDEFSUFFIX="'",
|
||||
)
|
||||
|
||||
FEATURES_AVAILABLE = models.configure_board(TREZOR_MODEL, HW_REVISION, FEATURES_WANTED, env, CPPDEFINES_HAL, SOURCE_UNIX, PATH_HAL)
|
||||
|
||||
@ -160,6 +143,7 @@ env.Replace(
|
||||
AR='ar',
|
||||
CC='gcc',
|
||||
LINK='ld',
|
||||
|
||||
SIZE='size',
|
||||
STRIP='strip',
|
||||
OBJCOPY='objcopy',
|
||||
@ -170,15 +154,32 @@ MODEL_IDENTIFIER = models.get_model_identifier(TREZOR_MODEL)
|
||||
MODEL_AS_NUMBER = str(models.get_hw_model_as_number(MODEL_IDENTIFIER))
|
||||
|
||||
ALLPATHS = ['embed/rust',
|
||||
'embed/bootloader',
|
||||
'embed/bootloader/nanopb',
|
||||
'embed/bootloader/protob',
|
||||
'embed/lib',
|
||||
'embed/projects/bootloader',
|
||||
'embed/projects/bootloader/nanopb',
|
||||
'embed/projects/bootloader/protob',
|
||||
'embed/rtl/inc',
|
||||
'embed/models',
|
||||
'embed/trezorhal',
|
||||
'embed/trezorhal/unix',
|
||||
'embed/unix',
|
||||
'embed/extmod/modtrezorui',
|
||||
'embed/projects/unix',
|
||||
'embed/upymod/modtrezorui',
|
||||
'embed/gfx/inc',
|
||||
'embed/io/display/inc',
|
||||
'embed/io/usb/inc',
|
||||
'embed/sec/entropy/inc',
|
||||
'embed/sec/monoctr/inc',
|
||||
'embed/sec/random_delays/inc',
|
||||
'embed/sec/rng/inc',
|
||||
'embed/sec/secret/inc',
|
||||
'embed/sys/bsp/inc',
|
||||
'embed/sys/irq/inc',
|
||||
'embed/sys/mpu/inc',
|
||||
'embed/sys/startup/inc',
|
||||
'embed/sys/task/inc',
|
||||
'embed/sys/time/inc',
|
||||
'embed/util/flash/inc',
|
||||
'embed/util/image/inc',
|
||||
'embed/util/rsod/inc',
|
||||
'embed/util/translations/inc',
|
||||
'embed/util/unit_properties/inc',
|
||||
'vendor/nanopb',
|
||||
] + CPPPATH_MOD + PATH_HAL
|
||||
|
||||
@ -188,7 +189,7 @@ env.Replace(
|
||||
'-g3 '
|
||||
'-nostdlib '
|
||||
'-std=gnu11 -Wall -Werror -Wpointer-arith -Wno-missing-braces -fno-common '
|
||||
'-fsingle-precision-constant -fdata-sections -ffunction-sections '
|
||||
'-fdata-sections -ffunction-sections '
|
||||
'-ffreestanding '
|
||||
'-fstack-protector-all '
|
||||
+ CCFLAGS_MOD,
|
||||
@ -239,9 +240,6 @@ RUST_LIBPATH = f'{RUST_LIBDIR}/lib{RUST_LIB}.a'
|
||||
def cargo_build():
|
||||
features = []
|
||||
|
||||
if NEW_RENDERING:
|
||||
features.append('new_rendering')
|
||||
|
||||
features.extend(RUST_UI_FEATURES)
|
||||
features.append("ui")
|
||||
features.append("bootloader")
|
||||
@ -260,7 +258,7 @@ def cargo_build():
|
||||
bindgen_macros = tools.get_bindgen_defines(env.get("CPPDEFINES"), ALLPATHS)
|
||||
build_dir = str(Dir('.').abspath)
|
||||
|
||||
return f'export BINDGEN_MACROS=\'{bindgen_macros}\'; export BUILD_DIR=\'{build_dir}\'; cd embed/rust; cargo build --profile {RUST_PROFILE} ' + ' '.join(cargo_opts)
|
||||
return f'export BINDGEN_MACROS={shlex.quote(bindgen_macros)}; export BUILD_DIR=\'{build_dir}\'; cd embed/rust; cargo build --profile {RUST_PROFILE} ' + ' '.join(cargo_opts)
|
||||
|
||||
rust = env.Command(
|
||||
target=RUST_LIBPATH,
|
||||
@ -270,6 +268,7 @@ rust = env.Command(
|
||||
env.Append(LINKFLAGS=f'-L{RUST_LIBDIR}')
|
||||
env.Append(LINKFLAGS=f'-l{RUST_LIB}')
|
||||
env.Append(LINKFLAGS='-lm')
|
||||
env.Append(LINKFLAGS='-Wl,' + ('-dead_strip' if env['PLATFORM'] == 'darwin' else '--gc-sections'))
|
||||
|
||||
#
|
||||
# Program objects
|
||||
|
@ -2,6 +2,7 @@
|
||||
# fmt: off
|
||||
|
||||
import os
|
||||
import shlex
|
||||
import tools, models, ui
|
||||
|
||||
BITCOIN_ONLY = ARGUMENTS.get('BITCOIN_ONLY', '0')
|
||||
@ -15,9 +16,16 @@ PYOPT = ARGUMENTS.get('PYOPT', '1')
|
||||
DISABLE_OPTIGA = ARGUMENTS.get('DISABLE_OPTIGA', '0') == '1'
|
||||
HW_REVISION = ARGUMENTS.get('HW_REVISION', None)
|
||||
THP = ARGUMENTS.get('THP', '0') == '1' # Trezor-Host Protocol
|
||||
NEW_RENDERING = ARGUMENTS.get('NEW_RENDERING', '1') == '1'
|
||||
MODEL_IDENTIFIER = models.get_model_identifier(TREZOR_MODEL)
|
||||
BENCHMARK = ARGUMENTS.get('BENCHMARK', '0') == '1'
|
||||
DISABLE_ANIMATION = ARGUMENTS.get('TREZOR_DISABLE_ANIMATION', '0') == '1'
|
||||
|
||||
STORAGE_INSECURE_TESTING_MODE = ARGUMENTS.get('STORAGE_INSECURE_TESTING_MODE', '0') == '1'
|
||||
if STORAGE_INSECURE_TESTING_MODE and PRODUCTION:
|
||||
raise RuntimeError("STORAGE_INSECURE_TESTING_MODE cannot be used in production")
|
||||
if STORAGE_INSECURE_TESTING_MODE:
|
||||
DISABLE_OPTIGA = True
|
||||
PYOPT = "0"
|
||||
|
||||
if BENCHMARK and PYOPT != '0':
|
||||
print("BENCHMARK=1 works only with PYOPT=0.")
|
||||
@ -26,14 +34,14 @@ if BENCHMARK and PYOPT != '0':
|
||||
FEATURE_FLAGS = {
|
||||
"RDI": True,
|
||||
"SECP256K1_ZKP": True, # required for trezor.crypto.curve.bip340 (BIP340/Taproot)
|
||||
"AES_GCM": BENCHMARK,
|
||||
"AES_GCM": BENCHMARK or THP,
|
||||
}
|
||||
|
||||
FEATURES_WANTED = ["input", "sbu", "sd_card", "rgb_led", "dma2d", "consumption_mask", "usb" ,"optiga", "haptic"]
|
||||
if DISABLE_OPTIGA and PYOPT == '0':
|
||||
FEATURES_WANTED = ["input", "sd_card", "rgb_led", "dma2d", "consumption_mask", "usb" ,"optiga", "haptic"]
|
||||
if DISABLE_OPTIGA:
|
||||
if PYOPT != '0':
|
||||
raise RuntimeError("DISABLE_OPTIGA requires PYOPT=0")
|
||||
FEATURES_WANTED.remove("optiga")
|
||||
if NEW_RENDERING:
|
||||
FEATURES_WANTED.append("new_rendering")
|
||||
|
||||
CCFLAGS_MOD = ''
|
||||
CPPPATH_MOD = []
|
||||
@ -49,11 +57,11 @@ FROZEN = True
|
||||
|
||||
# modtrezorconfig
|
||||
CPPPATH_MOD += [
|
||||
'embed/extmod/modtrezorconfig',
|
||||
'embed/upymod/modtrezorconfig',
|
||||
'vendor/trezor-storage',
|
||||
]
|
||||
SOURCE_MOD += [
|
||||
'embed/extmod/modtrezorconfig/modtrezorconfig.c',
|
||||
'embed/upymod/modtrezorconfig/modtrezorconfig.c',
|
||||
]
|
||||
|
||||
# modtrezorcrypto
|
||||
@ -71,12 +79,13 @@ CPPDEFINES_MOD += [
|
||||
('USE_CARDANO', '1' if EVERYTHING else '0'),
|
||||
('USE_NEM', '1' if (EVERYTHING and TREZOR_MODEL == "T") else '0'),
|
||||
('USE_EOS', '1' if (EVERYTHING and TREZOR_MODEL == "T") else '0'),
|
||||
('DISABLE_ANIMATION', '1' if DISABLE_ANIMATION else '0'),
|
||||
]
|
||||
SOURCE_MOD += [
|
||||
'embed/extmod/trezorobj.c',
|
||||
'embed/extmod/modtrezorcrypto/crc.c',
|
||||
'embed/extmod/modtrezorcrypto/modtrezorcrypto.c',
|
||||
'embed/extmod/modtrezorcrypto/rand.c',
|
||||
'embed/upymod/trezorobj.c',
|
||||
'embed/upymod/modtrezorcrypto/crc.c',
|
||||
'embed/upymod/modtrezorcrypto/modtrezorcrypto.c',
|
||||
'embed/upymod/modtrezorcrypto/rand.c',
|
||||
]
|
||||
SOURCE_MOD_CRYPTO += [
|
||||
'vendor/trezor-crypto/address.c',
|
||||
@ -188,7 +197,7 @@ if FEATURE_FLAGS["AES_GCM"]:
|
||||
|
||||
# modtrezorio
|
||||
SOURCE_MOD += [
|
||||
'embed/extmod/modtrezorio/modtrezorio.c',
|
||||
'embed/upymod/modtrezorio/modtrezorio.c',
|
||||
]
|
||||
|
||||
# modtrezorui
|
||||
@ -196,39 +205,27 @@ CPPPATH_MOD += [
|
||||
'vendor/micropython/lib/uzlib',
|
||||
]
|
||||
SOURCE_MOD += [
|
||||
'embed/extmod/modtrezorui/modtrezorui.c',
|
||||
'embed/lib/buffers.c',
|
||||
'embed/lib/colors.c',
|
||||
'embed/lib/display_utils.c',
|
||||
'embed/lib/error_handling.c',
|
||||
'embed/lib/fonts/font_bitmap.c',
|
||||
'embed/lib/fonts/fonts.c',
|
||||
'embed/lib/gfx_color.c',
|
||||
'embed/lib/gfx_bitblt_rgb565.c',
|
||||
'embed/lib/gfx_bitblt_rgba8888.c',
|
||||
'embed/lib/gfx_bitblt_mono8.c',
|
||||
'embed/lib/image.c',
|
||||
'embed/lib/mini_printf.c',
|
||||
'embed/lib/rsod.c',
|
||||
'embed/lib/terminal.c',
|
||||
'embed/lib/translations.c',
|
||||
'embed/lib/unit_variant.c',
|
||||
'embed/upymod/modtrezorui/modtrezorui.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_rgb565.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_rgba8888.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_mono8.c',
|
||||
'embed/gfx/fonts/font_bitmap.c',
|
||||
'embed/gfx/fonts/fonts.c',
|
||||
'embed/gfx/gfx_color.c',
|
||||
'embed/gfx/gfx_draw.c',
|
||||
'embed/gfx/terminal.c',
|
||||
'embed/io/display/display_utils.c',
|
||||
'embed/util/image/image.c',
|
||||
'embed/util/translations/translations.c',
|
||||
'embed/util/rsod/rsod.c',
|
||||
'embed/rtl/error_handling.c',
|
||||
'embed/rtl/mini_printf.c',
|
||||
'vendor/micropython/lib/uzlib/adler32.c',
|
||||
'vendor/micropython/lib/uzlib/crc32.c',
|
||||
'vendor/micropython/lib/uzlib/tinflate.c',
|
||||
]
|
||||
|
||||
if NEW_RENDERING:
|
||||
CPPDEFINES_MOD += ['NEW_RENDERING']
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/gfx_draw.c',
|
||||
]
|
||||
else:
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/display_draw.c',
|
||||
]
|
||||
|
||||
|
||||
CPPDEFINES_MOD += [
|
||||
'TRANSLATIONS',
|
||||
'FANCY_FATAL_ERROR',
|
||||
@ -236,17 +233,17 @@ CPPDEFINES_MOD += [
|
||||
|
||||
# modtrezorutils
|
||||
SOURCE_MOD += [
|
||||
'embed/extmod/modtrezorutils/modtrezorutils.c',
|
||||
'embed/upymod/modtrezorutils/modtrezorutils.c',
|
||||
]
|
||||
|
||||
# rust mods
|
||||
SOURCE_MOD += [
|
||||
'embed/extmod/rustmods.c',
|
||||
'embed/upymod/rustmods.c',
|
||||
]
|
||||
|
||||
# modutime
|
||||
SOURCE_MOD += [
|
||||
'embed/extmod/modutime.c',
|
||||
'embed/upymod/modutime.c',
|
||||
]
|
||||
|
||||
SOURCE_MICROPYTHON = [
|
||||
@ -381,6 +378,9 @@ if THP:
|
||||
'vendor/trezor-crypto/elligator2.c',
|
||||
]
|
||||
|
||||
if STORAGE_INSECURE_TESTING_MODE:
|
||||
CPPDEFINES_MOD += ['STORAGE_INSECURE_TESTING_MODE']
|
||||
|
||||
ui.init_ui(TREZOR_MODEL, "firmware", CPPDEFINES_MOD, SOURCE_MOD, RUST_UI_FEATURES)
|
||||
|
||||
SOURCE_QSTR = SOURCE_MOD + SOURCE_MICROPYTHON + SOURCE_MICROPYTHON_SPEED
|
||||
@ -388,7 +388,9 @@ SOURCE_QSTR = SOURCE_MOD + SOURCE_MICROPYTHON + SOURCE_MICROPYTHON_SPEED
|
||||
env = Environment(
|
||||
ENV=os.environ,
|
||||
CFLAGS=f"{ARGUMENTS.get('CFLAGS', '')} -DPRODUCTION={int(PRODUCTION)} -DPYOPT={PYOPT} -DBOOTLOADER_QA={int(BOOTLOADER_QA)} -DBITCOIN_ONLY={BITCOIN_ONLY}",
|
||||
CPPDEFINES_IMPLICIT=[]
|
||||
CPPDEFINES_IMPLICIT=[],
|
||||
CPPDEFPREFIX="-D'",
|
||||
CPPDEFSUFFIX="'",
|
||||
)
|
||||
|
||||
FEATURES_AVAILABLE = models.configure_board(TREZOR_MODEL, HW_REVISION, FEATURES_WANTED, env, CPPDEFINES_HAL, SOURCE_HAL, PATH_HAL)
|
||||
@ -396,11 +398,11 @@ FEATURES_AVAILABLE = models.configure_board(TREZOR_MODEL, HW_REVISION, FEATURES_
|
||||
FILE_SUFFIX= env.get('ENV')['SUFFIX']
|
||||
|
||||
SOURCE_FIRMWARE = [
|
||||
'embed/firmware/header.S',
|
||||
'embed/firmware/main.c',
|
||||
'embed/firmware/mphalport.c',
|
||||
'embed/firmware/nlrthumb.c',
|
||||
f'embed/trezorhal/{FILE_SUFFIX}/startup_stage_4.s',
|
||||
'embed/projects/firmware/header.S',
|
||||
'embed/projects/firmware/main.c',
|
||||
'embed/projects/firmware/mphalport.c',
|
||||
'embed/projects/firmware/nlrthumb.c',
|
||||
f'embed/sys/startup/{FILE_SUFFIX}/startup_stage_4.s',
|
||||
]
|
||||
|
||||
if 'sd_card' in FEATURES_AVAILABLE:
|
||||
@ -429,11 +431,15 @@ env.Replace(
|
||||
ALLPATHS = [
|
||||
'.',
|
||||
'embed/rust',
|
||||
'embed/firmware',
|
||||
'embed/lib',
|
||||
'embed/projects/firmware',
|
||||
'embed/rtl/inc',
|
||||
'embed/models',
|
||||
'embed/trezorhal',
|
||||
'embed/extmod/modtrezorui',
|
||||
'embed/gfx/inc',
|
||||
'embed/sys/bsp/inc',
|
||||
'embed/util/image/inc',
|
||||
'embed/util/rsod/inc',
|
||||
'embed/util/translations/inc',
|
||||
'embed/upymod/modtrezorui',
|
||||
'vendor/micropython',
|
||||
] + CPPPATH_MOD + PATH_HAL
|
||||
|
||||
@ -573,6 +579,7 @@ if FROZEN:
|
||||
))
|
||||
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/wire/*.py'))
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/wire/codec/*.py'))
|
||||
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'storage/*.py',
|
||||
exclude=[
|
||||
@ -622,6 +629,12 @@ if FROZEN:
|
||||
])
|
||||
)
|
||||
|
||||
if BENCHMARK:
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/benchmark/*.py'))
|
||||
|
||||
if THP:
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/thp/*.py'))
|
||||
|
||||
if EVERYTHING:
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/binance/*.py'))
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Binance*.py'))
|
||||
@ -663,9 +676,6 @@ if FROZEN:
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/tezos/*.py'))
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Tezos*.py'))
|
||||
|
||||
if THP:
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/thp/*.py'))
|
||||
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/zcash/*.py'))
|
||||
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/webauthn/*.py'))
|
||||
@ -676,15 +686,14 @@ if FROZEN:
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/bitcoin/sign_tx/zcash_v4.py'))
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Zcash*.py'))
|
||||
|
||||
if BENCHMARK:
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/benchmark/*.py'))
|
||||
|
||||
source_mpy = env.FrozenModule(
|
||||
source=SOURCE_PY,
|
||||
source_dir=SOURCE_PY_DIR,
|
||||
bitcoin_only=BITCOIN_ONLY,
|
||||
backlight='backlight' in FEATURES_AVAILABLE,
|
||||
optiga='optiga' in FEATURES_AVAILABLE,
|
||||
use_button='button' in FEATURES_AVAILABLE,
|
||||
use_touch='touch' in FEATURES_AVAILABLE,
|
||||
ui_layout=ui.get_ui_layout(TREZOR_MODEL),
|
||||
thp=THP,
|
||||
)
|
||||
@ -759,10 +768,6 @@ def cargo_build():
|
||||
features.append('ui')
|
||||
features.append('translations')
|
||||
|
||||
|
||||
if NEW_RENDERING:
|
||||
features.append('new_rendering')
|
||||
|
||||
if PYOPT == '0':
|
||||
features.append('debug')
|
||||
features.append('ui_debug')
|
||||
@ -783,7 +788,7 @@ def cargo_build():
|
||||
bindgen_macros = tools.get_bindgen_defines(env.get("CPPDEFINES"), ALLPATHS)
|
||||
build_dir = str(Dir('.').abspath)
|
||||
|
||||
return f'export BINDGEN_MACROS=\'{bindgen_macros}\'; export BUILD_DIR=\'{build_dir}\'; cd embed/rust; cargo build {profile} ' + ' '.join(cargo_opts)
|
||||
return f'export BINDGEN_MACROS={shlex.quote(bindgen_macros)}; export BUILD_DIR=\'{build_dir}\'; cd embed/rust; cargo build {profile} ' + ' '.join(cargo_opts)
|
||||
|
||||
rust = env.Command(
|
||||
target=RUST_LIBPATH,
|
||||
@ -820,7 +825,7 @@ tools.embed_raw_binary(
|
||||
obj_program,
|
||||
env,
|
||||
'vendorheader',
|
||||
'embed/firmware/vendorheader.o',
|
||||
'embed/projects/firmware/vendorheader.o',
|
||||
VENDORHEADER,
|
||||
)
|
||||
|
||||
@ -858,7 +863,7 @@ env.Depends(program_elf, rust)
|
||||
BINARY_NAME = f"build/firmware/firmware-{MODEL_IDENTIFIER}"
|
||||
if not EVERYTHING:
|
||||
BINARY_NAME += "-btconly"
|
||||
BINARY_NAME += "-" + tools.get_version('embed/firmware/version.h')
|
||||
BINARY_NAME += "-" + tools.get_version('embed/projects/firmware/version.h')
|
||||
BINARY_NAME += "-" + tools.get_git_revision_short_hash()
|
||||
BINARY_NAME += "-dirty" if tools.get_git_modified() else ""
|
||||
BINARY_NAME += ".bin"
|
||||
@ -873,7 +878,7 @@ if 'STM32F427xx' in CPPDEFINES_HAL or 'STM32F429xx' in CPPDEFINES_HAL:
|
||||
'$DD if=$TARGET of=${TARGET}.p1 skip=0 bs=128k count=6',
|
||||
'$CP $TARGET ' + BINARY_NAME,
|
||||
]
|
||||
elif 'STM32U5A9xx' in CPPDEFINES_HAL or 'STM32U585xx' in CPPDEFINES_HAL:
|
||||
elif 'STM32U5G9xx' in CPPDEFINES_HAL or 'STM32U585xx' in CPPDEFINES_HAL:
|
||||
action_bin=[
|
||||
'$OBJCOPY -O binary -j .vendorheader -j .header -j .flash -j .data -j .confidential $SOURCE ${TARGET}',
|
||||
'$HEADERTOOL -h $TARGET ' + ('-D' if not PRODUCTION else ''),
|
||||
@ -882,6 +887,14 @@ elif 'STM32U5A9xx' in CPPDEFINES_HAL or 'STM32U585xx' in CPPDEFINES_HAL:
|
||||
else:
|
||||
raise Exception("Unknown MCU")
|
||||
|
||||
if STORAGE_INSECURE_TESTING_MODE:
|
||||
INSECURE_TESTING_MODE_STR = """
|
||||
#########################################################
|
||||
# STORAGE_INSECURE_TESTING_MODE enabled, DO NOT USE #
|
||||
#########################################################
|
||||
"""
|
||||
action_bin.append(INSECURE_TESTING_MODE_STR)
|
||||
|
||||
program_bin = env.Command(
|
||||
target='firmware.bin',
|
||||
source=program_elf,
|
||||
|
@ -15,8 +15,13 @@ PYOPT = ARGUMENTS.get('PYOPT', '1')
|
||||
DISABLE_OPTIGA = ARGUMENTS.get('DISABLE_OPTIGA', '0') == '1'
|
||||
HW_REVISION = ARGUMENTS.get('HW_REVISION', None)
|
||||
THP = ARGUMENTS.get('THP', '0') == '1' # Trezor-Host Protocol
|
||||
NEW_RENDERING = ARGUMENTS.get('NEW_RENDERING', '1') == '1' or TREZOR_MODEL in ('T3T1',)
|
||||
|
||||
STORAGE_INSECURE_TESTING_MODE = ARGUMENTS.get('STORAGE_INSECURE_TESTING_MODE', '0') == '1'
|
||||
if STORAGE_INSECURE_TESTING_MODE and PRODUCTION:
|
||||
raise RuntimeError("STORAGE_INSECURE_TESTING_MODE cannot be used in production")
|
||||
if STORAGE_INSECURE_TESTING_MODE:
|
||||
DISABLE_OPTIGA = True
|
||||
PYOPT = "0"
|
||||
|
||||
FEATURE_FLAGS = {
|
||||
"RDI": True,
|
||||
@ -25,11 +30,12 @@ FEATURE_FLAGS = {
|
||||
"AES_GCM": False,
|
||||
}
|
||||
|
||||
FEATURES_WANTED = ["input", "sbu", "sd_card", "rgb_led", "dma2d", "consumption_mask", "usb" ,"optiga", "haptic"]
|
||||
if DISABLE_OPTIGA and PYOPT == '0':
|
||||
FEATURES_WANTED = ["input", "sd_card", "rgb_led", "dma2d", "consumption_mask", "usb" ,"optiga", "haptic"]
|
||||
if DISABLE_OPTIGA:
|
||||
# TODO use PYOPT instead of PRODUCTION, same as in firmware, blocked on #4253
|
||||
if PRODUCTION:
|
||||
raise RuntimeError("DISABLE_OPTIGA requires non-production build")
|
||||
FEATURES_WANTED.remove("optiga")
|
||||
if NEW_RENDERING:
|
||||
FEATURES_WANTED.append("new_rendering")
|
||||
|
||||
CCFLAGS_MOD = ''
|
||||
CPPPATH_MOD = []
|
||||
@ -44,12 +50,12 @@ FROZEN = True
|
||||
|
||||
# modtrezorconfig
|
||||
CPPPATH_MOD += [
|
||||
'embed/extmod/modtrezorconfig',
|
||||
'embed/upymod/modtrezorconfig',
|
||||
'vendor/trezor-storage',
|
||||
'vendor/micropython/lib/uzlib',
|
||||
]
|
||||
SOURCE_MOD += [
|
||||
# 'embed/extmod/modtrezorconfig/modtrezorconfig.c',
|
||||
# 'embed/upymod/modtrezorconfig/modtrezorconfig.c',
|
||||
'vendor/trezor-storage/norcow.c',
|
||||
'vendor/trezor-storage/storage.c',
|
||||
'vendor/trezor-storage/storage_utils.c',
|
||||
@ -183,40 +189,26 @@ if FEATURE_FLAGS["AES_GCM"]:
|
||||
]
|
||||
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/bl_check.c',
|
||||
# 'embed/lib/buffers.c',
|
||||
# 'embed/lib/colors.c',
|
||||
# 'embed/lib/display_utils.c',
|
||||
'embed/lib/error_handling.c',
|
||||
'embed/lib/fonts/font_bitmap.c',
|
||||
# 'embed/lib/fonts/fonts.c',
|
||||
'embed/lib/gfx_color.c',
|
||||
'embed/lib/gfx_bitblt_rgb565.c',
|
||||
'embed/lib/gfx_bitblt_rgba8888.c',
|
||||
'embed/lib/gfx_bitblt_mono8.c',
|
||||
'embed/lib/image.c',
|
||||
'embed/lib/mini_printf.c',
|
||||
'embed/lib/rsod.c',
|
||||
'embed/lib/terminal.c',
|
||||
'embed/lib/translations.c',
|
||||
'embed/lib/unit_variant.c',
|
||||
'embed/extmod/modtrezorcrypto/rand.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_rgb565.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_rgba8888.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_mono8.c',
|
||||
'embed/gfx/fonts/font_bitmap.c',
|
||||
'embed/gfx/gfx_color.c',
|
||||
'embed/gfx/gfx_draw.c',
|
||||
'embed/gfx/terminal.c',
|
||||
'embed/util/bl_check/bl_check.c',
|
||||
'embed/util/translations/translations.c',
|
||||
'embed/util/image/image.c',
|
||||
'embed/util/rsod/rsod.c',
|
||||
'embed/rtl/error_handling.c',
|
||||
'embed/rtl/mini_printf.c',
|
||||
'embed/upymod/modtrezorcrypto/rand.c',
|
||||
'vendor/micropython/lib/uzlib/adler32.c',
|
||||
'vendor/micropython/lib/uzlib/crc32.c',
|
||||
'vendor/micropython/lib/uzlib/tinflate.c',
|
||||
]
|
||||
|
||||
if NEW_RENDERING:
|
||||
CPPDEFINES_MOD += ['NEW_RENDERING']
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/gfx_draw.c',
|
||||
]
|
||||
else:
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/display_draw.c',
|
||||
]
|
||||
|
||||
|
||||
CPPDEFINES_MOD += [
|
||||
'TRANSLATIONS',
|
||||
'RSOD_IN_COREAPP',
|
||||
@ -226,17 +218,18 @@ if FEATURE_FLAGS["RDI"]:
|
||||
CPPDEFINES_MOD += ['RDI']
|
||||
|
||||
if FEATURE_FLAGS["SYSTEM_VIEW"]:
|
||||
SOURCE_FIRMWARE += [
|
||||
'embed/segger/SEGGER/SEGGER_SYSVIEW_Config_NoOS.c',
|
||||
'embed/segger/SEGGER/SEGGER_SYSVIEW.c',
|
||||
'embed/segger/SEGGER/SEGGER_RTT.c',
|
||||
'embed/segger/SEGGER/SEGGER_RTT_ASM_ARMv7M.S',
|
||||
'embed/segger/SEGGER/Syscalls/SEGGER_RTT_Syscalls_GCC.c',
|
||||
'embed/firmware/systemview.c',
|
||||
SOURCE_MOD += [
|
||||
'embed/sys/systemview/stm32/config/SEGGER_SYSVIEW_Config_NoOS.c',
|
||||
'embed/sys/systemview/stm32/segger/SEGGER_SYSVIEW.c',
|
||||
'embed/sys/systemview/stm32/segger/SEGGER_RTT.c',
|
||||
'embed/sys/systemview/stm32/segger/SEGGER_RTT_ASM_ARMv7M.S',
|
||||
'embed/sys/systemview/stm32/segger/Syscalls/SEGGER_RTT_Syscalls_GCC.c',
|
||||
'embed/sys/systemview/systemview.c',
|
||||
]
|
||||
CPPPATH_MOD += [
|
||||
'embed/segger/SEGGER/',
|
||||
'embed/segger/Config/',
|
||||
'embed/sys/systemview/inc',
|
||||
'embed/sys/systemview/stm32/config',
|
||||
'embed/sys/systemview/stm32/segger',
|
||||
]
|
||||
CPPDEFINES_MOD += ['SYSTEM_VIEW']
|
||||
CCFLAGS_MOD += '-DSYSTEM_VIEW '
|
||||
@ -252,20 +245,24 @@ if THP:
|
||||
'vendor/trezor-crypto/elligator2.c',
|
||||
]
|
||||
|
||||
if STORAGE_INSECURE_TESTING_MODE:
|
||||
CPPDEFINES_MOD += ['STORAGE_INSECURE_TESTING_MODE']
|
||||
|
||||
env = Environment(
|
||||
ENV=os.environ,
|
||||
CFLAGS=f"{ARGUMENTS.get('CFLAGS', '')} -DPRODUCTION={int(PRODUCTION)} -DPYOPT={PYOPT} -DBOOTLOADER_QA={int(BOOTLOADER_QA)} -DBITCOIN_ONLY={BITCOIN_ONLY}",
|
||||
CPPDEFINES_IMPLICIT=[]
|
||||
)
|
||||
CPPDEFINES_IMPLICIT=[],
|
||||
CPPDEFPREFIX="-D'",
|
||||
CPPDEFSUFFIX="'",
|
||||
)
|
||||
|
||||
FEATURES_AVAILABLE = models.configure_board(TREZOR_MODEL, HW_REVISION, FEATURES_WANTED, env, CPPDEFINES_HAL, SOURCE_HAL, PATH_HAL)
|
||||
|
||||
FILE_SUFFIX= env.get('ENV')['SUFFIX']
|
||||
|
||||
SOURCE_FIRMWARE = [
|
||||
'embed/kernel/main.c',
|
||||
f'embed/trezorhal/{FILE_SUFFIX}/startup_stage_2.s',
|
||||
'embed/projects/kernel/main.c',
|
||||
f'embed/sys/startup/{FILE_SUFFIX}/startup_stage_2.s',
|
||||
]
|
||||
|
||||
if 'sd_card' in FEATURES_AVAILABLE:
|
||||
@ -291,10 +288,15 @@ env.Replace(
|
||||
|
||||
ALLPATHS = [
|
||||
'.',
|
||||
'embed/firmware',
|
||||
'embed/lib',
|
||||
'embed/projects/firmware',
|
||||
'embed/rtl/inc',
|
||||
'embed/models',
|
||||
'embed/trezorhal',
|
||||
'embed/gfx/inc',
|
||||
'embed/sys/bsp/inc',
|
||||
'embed/util/bl_check/inc',
|
||||
'embed/util/image/inc',
|
||||
'embed/util/rsod/inc',
|
||||
'embed/util/translations/inc',
|
||||
] + CPPPATH_MOD + PATH_HAL
|
||||
|
||||
env.Replace(
|
||||
@ -374,7 +376,7 @@ VENDORHEADER = f'embed/models/{MODEL_IDENTIFIER}/vendorheader/vendorheader_{vend
|
||||
|
||||
obj_program.extend(
|
||||
env.Command(
|
||||
target='embed/kernel/vendorheader.o',
|
||||
target='embed/projects/kernel/vendorheader.o',
|
||||
source=VENDORHEADER,
|
||||
action='$OBJCOPY -I binary -O elf32-littlearm -B arm'
|
||||
' --rename-section .data=.vendorheader,alloc,load,readonly,contents'
|
||||
@ -384,9 +386,10 @@ tools.embed_compressed_binary(
|
||||
obj_program,
|
||||
env,
|
||||
'bootloader',
|
||||
'embed/bootloaders/bootloader.o',
|
||||
'embed/projects/bootloaders/bootloader.o',
|
||||
f'embed/models/{MODEL_IDENTIFIER}/bootloaders/bootloader_{BOOTLOADER_SUFFIX}.bin',
|
||||
'kernel'
|
||||
'kernel',
|
||||
'bootloader',
|
||||
)
|
||||
|
||||
linkerscript_gen = env.Command(
|
||||
@ -410,7 +413,7 @@ if CMAKELISTS != 0:
|
||||
BINARY_NAME = f"build/kernel/kernel-{models.get_model_identifier(TREZOR_MODEL)}"
|
||||
if not EVERYTHING:
|
||||
BINARY_NAME += "-btconly"
|
||||
BINARY_NAME += "-" + tools.get_version('embed/kernel/version.h')
|
||||
BINARY_NAME += "-" + tools.get_version('embed/projects/kernel/version.h')
|
||||
BINARY_NAME += "-" + tools.get_git_revision_short_hash()
|
||||
BINARY_NAME += "-dirty" if tools.get_git_modified() else ""
|
||||
BINARY_NAME += ".bin"
|
||||
@ -420,6 +423,14 @@ action_bin=[
|
||||
'$CP $TARGET ' + BINARY_NAME,
|
||||
]
|
||||
|
||||
if STORAGE_INSECURE_TESTING_MODE:
|
||||
INSECURE_TESTING_MODE_STR = """
|
||||
#########################################################
|
||||
# STORAGE_INSECURE_TESTING_MODE enabled, DO NOT USE #
|
||||
#########################################################
|
||||
"""
|
||||
action_bin.append(INSECURE_TESTING_MODE_STR)
|
||||
|
||||
program_bin = env.Command(
|
||||
target='kernel.bin',
|
||||
source=program_elf,
|
||||
|
@ -8,13 +8,9 @@ CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
|
||||
PRODUCTION = ARGUMENTS.get('PRODUCTION', '0') == '1'
|
||||
BOOTLOADER_DEVEL = ARGUMENTS.get('BOOTLOADER_DEVEL', '0') == '1'
|
||||
HW_REVISION = ARGUMENTS.get('HW_REVISION', None)
|
||||
NEW_RENDERING = ARGUMENTS.get('NEW_RENDERING', '1') == '1'
|
||||
|
||||
FEATURES_WANTED = ["input", "sbu", "sd_card", "rdb_led", "usb", "consumption_mask", "optiga", "haptic"]
|
||||
|
||||
if NEW_RENDERING:
|
||||
FEATURES_WANTED.append("new_rendering")
|
||||
|
||||
CCFLAGS_MOD = ''
|
||||
CPPPATH_MOD = []
|
||||
CPPDEFINES_MOD = [
|
||||
@ -66,42 +62,35 @@ CPPPATH_MOD += [
|
||||
]
|
||||
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/colors.c',
|
||||
'embed/lib/display_utils.c',
|
||||
'embed/lib/error_handling.c',
|
||||
'embed/lib/fonts/font_bitmap.c',
|
||||
'embed/lib/fonts/fonts.c',
|
||||
'embed/lib/gfx_color.c',
|
||||
'embed/lib/gfx_bitblt_rgb565.c',
|
||||
'embed/lib/gfx_bitblt_rgba8888.c',
|
||||
'embed/lib/gfx_bitblt_mono8.c',
|
||||
'embed/lib/image.c',
|
||||
'embed/lib/mini_printf.c',
|
||||
'embed/lib/rsod.c',
|
||||
'embed/lib/qr-code-generator/qrcodegen.c',
|
||||
'embed/lib/terminal.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_rgb565.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_rgba8888.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_mono8.c',
|
||||
'embed/gfx/fonts/font_bitmap.c',
|
||||
'embed/gfx/fonts/fonts.c',
|
||||
'embed/gfx/gfx_color.c',
|
||||
'embed/gfx/gfx_draw.c',
|
||||
'embed/gfx/terminal.c',
|
||||
'embed/gfx/qrcode/qrcodegen.c',
|
||||
'embed/io/display/display_utils.c',
|
||||
'embed/util/image/image.c',
|
||||
'embed/util/rsod/rsod.c',
|
||||
'embed/rtl/error_handling.c',
|
||||
'embed/rtl/mini_printf.c',
|
||||
'vendor/micropython/lib/uzlib/adler32.c',
|
||||
'vendor/micropython/lib/uzlib/crc32.c',
|
||||
'vendor/micropython/lib/uzlib/tinflate.c',
|
||||
]
|
||||
|
||||
|
||||
if NEW_RENDERING:
|
||||
CPPDEFINES_MOD += ['NEW_RENDERING']
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/gfx_draw.c',
|
||||
]
|
||||
else:
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/display_draw.c',
|
||||
]
|
||||
|
||||
ui.init_ui(TREZOR_MODEL, "prodtest", CPPDEFINES_MOD, SOURCE_MOD, RUST_UI_FEATURES)
|
||||
|
||||
env = Environment(
|
||||
ENV=os.environ,
|
||||
CFLAGS='%s -DPRODUCTION=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0')),
|
||||
CPPDEFINES_IMPLICIT=[])
|
||||
CPPDEFINES_IMPLICIT=[],
|
||||
CPPDEFPREFIX="-D'",
|
||||
CPPDEFSUFFIX="'",
|
||||
)
|
||||
|
||||
FEATURES_AVAILABLE = models.configure_board(TREZOR_MODEL, HW_REVISION, FEATURES_WANTED, env, CPPDEFINES_HAL, SOURCE_HAL, PATH_HAL)
|
||||
|
||||
@ -109,15 +98,15 @@ FILE_SUFFIX= env.get('ENV')['SUFFIX']
|
||||
|
||||
|
||||
SOURCE_PRODTEST = [
|
||||
f'embed/trezorhal/{FILE_SUFFIX}/startup_stage_2.s',
|
||||
'embed/prodtest/header.S',
|
||||
'embed/prodtest/main.c',
|
||||
'embed/prodtest/prodtest_common.c',
|
||||
f'embed/sys/startup/{FILE_SUFFIX}/startup_stage_2.s',
|
||||
'embed/projects/prodtest/header.S',
|
||||
'embed/projects/prodtest/main.c',
|
||||
'embed/projects/prodtest/prodtest_common.c',
|
||||
]
|
||||
|
||||
if 'optiga' in FEATURES_AVAILABLE:
|
||||
SOURCE_PRODTEST += [
|
||||
'embed/prodtest/optiga_prodtest.c',
|
||||
'embed/projects/prodtest/optiga_prodtest.c',
|
||||
]
|
||||
|
||||
env.Replace(
|
||||
@ -149,11 +138,14 @@ env.Replace(
|
||||
CCFLAGS_QSTR='-DNO_QSTR -DN_X64 -DN_X86 -DN_THUMB',
|
||||
LINKFLAGS=f'-T build/prodtest/memory.ld -Wl,--gc-sections -Wl,-Map=build/prodtest/prodtest.map -Wl,--warn-common',
|
||||
CPPPATH=[
|
||||
'embed/prodtest',
|
||||
'embed/lib',
|
||||
'embed/projects/prodtest',
|
||||
'embed/rtl/inc',
|
||||
'embed/models',
|
||||
'embed/trezorhal',
|
||||
'embed/extmod/modtrezorui',
|
||||
'embed/gfx/inc',
|
||||
'embed/sys/bsp/inc',
|
||||
'embed/util/image/inc',
|
||||
'embed/util/rsod/inc',
|
||||
'embed/upymod/modtrezorui',
|
||||
] + CPPPATH_MOD + PATH_HAL,
|
||||
CPPDEFINES=[
|
||||
'TREZOR_PRODTEST',
|
||||
@ -214,7 +206,7 @@ tools.embed_raw_binary(
|
||||
obj_program,
|
||||
env,
|
||||
'vendorheader',
|
||||
'embed/firmware/vendorheader.o',
|
||||
'embed/projects/firmware/vendorheader.o',
|
||||
VENDORHEADER,
|
||||
)
|
||||
|
||||
@ -234,7 +226,7 @@ program_elf = env.Command(
|
||||
env.Depends(program_elf, linkerscript_gen)
|
||||
|
||||
BINARY_NAME = f"build/prodtest/prodtest-{models.get_model_identifier(TREZOR_MODEL)}"
|
||||
BINARY_NAME += "-" + tools.get_version('embed/prodtest/version.h')
|
||||
BINARY_NAME += "-" + tools.get_version('embed/projects/prodtest/version.h')
|
||||
BINARY_NAME += "-" + tools.get_git_revision_short_hash()
|
||||
BINARY_NAME += "-dirty" if tools.get_git_modified() else ""
|
||||
BINARY_NAME += ".bin"
|
||||
|
@ -6,7 +6,6 @@ import tools, models, ui
|
||||
TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T')
|
||||
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
|
||||
HW_REVISION = ARGUMENTS.get('HW_REVISION', None)
|
||||
NEW_RENDERING = ARGUMENTS.get('NEW_RENDERING', '1') == '1'
|
||||
|
||||
if TREZOR_MODEL in ('DISC1', 'DISC2'):
|
||||
# skip reflash build
|
||||
@ -21,9 +20,6 @@ if TREZOR_MODEL in ('DISC1', 'DISC2'):
|
||||
|
||||
FEATURES_WANTED = ["input", "sd_card"]
|
||||
|
||||
if NEW_RENDERING:
|
||||
FEATURES_WANTED.append("new_rendering")
|
||||
|
||||
CCFLAGS_MOD = ''
|
||||
CPPPATH_MOD = []
|
||||
CPPDEFINES_MOD = []
|
||||
@ -52,52 +48,44 @@ CPPPATH_MOD += [
|
||||
'vendor/micropython/lib/uzlib',
|
||||
]
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/colors.c',
|
||||
'embed/lib/display_utils.c',
|
||||
'embed/lib/error_handling.c',
|
||||
'embed/lib/fonts/font_bitmap.c',
|
||||
'embed/lib/fonts/fonts.c',
|
||||
'embed/lib/gfx_color.c',
|
||||
'embed/lib/gfx_bitblt_mono8.c',
|
||||
'embed/lib/gfx_bitblt_rgb565.c',
|
||||
'embed/lib/gfx_bitblt_rgba8888.c',
|
||||
'embed/lib/image.c',
|
||||
'embed/lib/mini_printf.c',
|
||||
'embed/lib/rsod.c',
|
||||
'embed/lib/terminal.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_mono8.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_rgb565.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_rgba8888.c',
|
||||
'embed/gfx/fonts/font_bitmap.c',
|
||||
'embed/gfx/fonts/fonts.c',
|
||||
'embed/gfx/gfx_color.c',
|
||||
'embed/gfx/gfx_draw.c',
|
||||
'embed/gfx/terminal.c',
|
||||
'embed/io/display/display_utils.c',
|
||||
'embed/util/image/image.c',
|
||||
'embed/util/rsod/rsod.c',
|
||||
'embed/rtl/error_handling.c',
|
||||
'embed/rtl/mini_printf.c',
|
||||
'vendor/micropython/lib/uzlib/adler32.c',
|
||||
'vendor/micropython/lib/uzlib/crc32.c',
|
||||
'vendor/micropython/lib/uzlib/tinflate.c',
|
||||
'vendor/trezor-storage/flash_area.c',
|
||||
]
|
||||
|
||||
if NEW_RENDERING:
|
||||
CPPDEFINES_MOD += ['NEW_RENDERING']
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/gfx_draw.c',
|
||||
]
|
||||
else:
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/display_draw.c',
|
||||
]
|
||||
|
||||
|
||||
ui.init_ui(TREZOR_MODEL, "prodtest", CPPDEFINES_MOD, SOURCE_MOD, RUST_UI_FEATURES)
|
||||
|
||||
env = Environment(
|
||||
ENV=os.environ,
|
||||
CFLAGS='%s -DPRODUCTION=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0')),
|
||||
CPPDEFINES_IMPLICIT=[]
|
||||
)
|
||||
CPPDEFINES_IMPLICIT=[],
|
||||
CPPDEFPREFIX="-D'",
|
||||
CPPDEFSUFFIX="'",
|
||||
)
|
||||
|
||||
FEATURES_AVAILABLE = models.configure_board(TREZOR_MODEL, HW_REVISION, FEATURES_WANTED, env, CPPDEFINES_HAL, SOURCE_HAL, PATH_HAL)
|
||||
|
||||
FILE_SUFFIX= env.get('ENV')['SUFFIX']
|
||||
|
||||
SOURCE_REFLASH = [
|
||||
f'embed/trezorhal/{FILE_SUFFIX}/startup_stage_2.s',
|
||||
'embed/reflash/header.S',
|
||||
'embed/reflash/main.c',
|
||||
f'embed/sys/startup/{FILE_SUFFIX}/startup_stage_2.s',
|
||||
'embed/projects/reflash/header.S',
|
||||
'embed/projects/reflash/main.c',
|
||||
]
|
||||
|
||||
env.Replace(
|
||||
@ -129,11 +117,14 @@ env.Replace(
|
||||
CCFLAGS_QSTR='-DNO_QSTR -DN_X64 -DN_X86 -DN_THUMB',
|
||||
LINKFLAGS=f'-T build/reflash/memory.ld -Wl,--gc-sections -Wl,-Map=build/reflash/reflash.map -Wl,--warn-common',
|
||||
CPPPATH=[
|
||||
'embed/reflash',
|
||||
'embed/lib',
|
||||
'embed/projects/reflash',
|
||||
'embed/rtl/inc',
|
||||
'embed/models',
|
||||
'embed/trezorhal',
|
||||
'embed/extmod/modtrezorui',
|
||||
'embed/gfx/inc',
|
||||
'embed/sys/bsp/inc',
|
||||
'embed/util/image/inc',
|
||||
'embed/util/rsod/inc',
|
||||
'embed/upymod/modtrezorui',
|
||||
] + CPPPATH_MOD + PATH_HAL,
|
||||
CPPDEFINES=[
|
||||
'TREZOR_MODEL_'+TREZOR_MODEL,
|
||||
@ -175,7 +166,7 @@ tools.embed_raw_binary(
|
||||
obj_program,
|
||||
env,
|
||||
'vendorheader',
|
||||
'embed/firmware/vendorheader.o',
|
||||
'embed/projects/firmware/vendorheader.o',
|
||||
VENDORHEADER,
|
||||
)
|
||||
|
||||
@ -195,7 +186,7 @@ program_elf = env.Command(
|
||||
env.Depends(program_elf, linkerscript_gen)
|
||||
|
||||
BINARY_NAME = f"build/reflash/reflash-{models.get_model_identifier(TREZOR_MODEL)}"
|
||||
BINARY_NAME += "-" + tools.get_version('embed/reflash/version.h')
|
||||
BINARY_NAME += "-" + tools.get_version('embed/projects/reflash/version.h')
|
||||
BINARY_NAME += "-" + tools.get_git_revision_short_hash()
|
||||
BINARY_NAME += "-dirty" if tools.get_git_modified() else ""
|
||||
BINARY_NAME += ".bin"
|
||||
|
@ -2,6 +2,7 @@
|
||||
# fmt: off
|
||||
|
||||
import os
|
||||
import shlex
|
||||
import tools, models, ui
|
||||
|
||||
BITCOIN_ONLY = ARGUMENTS.get('BITCOIN_ONLY', '0')
|
||||
@ -10,7 +11,6 @@ TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T')
|
||||
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
|
||||
HW_REVISION ='emulator'
|
||||
THP = ARGUMENTS.get('THP', '0') == '1' # Trezor-Host Protocol
|
||||
NEW_RENDERING = ARGUMENTS.get('NEW_RENDERING', '1') == '1'
|
||||
BENCHMARK = ARGUMENTS.get('BENCHMARK', '0') == '1'
|
||||
PYOPT = ARGUMENTS.get('PYOPT', '1')
|
||||
FROZEN = ARGUMENTS.get('TREZOR_EMULATOR_FROZEN', 0)
|
||||
@ -21,9 +21,7 @@ if BENCHMARK and PYOPT != '0':
|
||||
print("BENCHMARK=1 works only with PYOPT=0.")
|
||||
exit(1)
|
||||
|
||||
FEATURES_WANTED = ["input", "sd_card", "dma2d", "optiga", "sbu"]
|
||||
if NEW_RENDERING:
|
||||
FEATURES_WANTED.append("new_rendering")
|
||||
FEATURES_WANTED = ["input", "sd_card", "dma2d", "optiga"]
|
||||
|
||||
if not models.has_emulator(TREZOR_MODEL):
|
||||
# skip unix build
|
||||
@ -54,11 +52,11 @@ RUST_UI_FEATURES = []
|
||||
|
||||
# modtrezorconfig
|
||||
CPPPATH_MOD += [
|
||||
'embed/extmod/modtrezorconfig',
|
||||
'embed/upymod/modtrezorconfig',
|
||||
'vendor/trezor-storage',
|
||||
]
|
||||
SOURCE_MOD += [
|
||||
'embed/extmod/modtrezorconfig/modtrezorconfig.c',
|
||||
'embed/upymod/modtrezorconfig/modtrezorconfig.c',
|
||||
'vendor/trezor-storage/norcow.c',
|
||||
'vendor/trezor-storage/storage.c',
|
||||
'vendor/trezor-storage/storage_utils.c',
|
||||
@ -84,9 +82,9 @@ CPPDEFINES_MOD += [
|
||||
('USE_EOS', '1' if (EVERYTHING and TREZOR_MODEL == "T") else '0'),
|
||||
]
|
||||
SOURCE_MOD += [
|
||||
'embed/extmod/trezorobj.c',
|
||||
'embed/extmod/modtrezorcrypto/crc.c',
|
||||
'embed/extmod/modtrezorcrypto/modtrezorcrypto.c',
|
||||
'embed/upymod/trezorobj.c',
|
||||
'embed/upymod/modtrezorcrypto/crc.c',
|
||||
'embed/upymod/modtrezorcrypto/modtrezorcrypto.c',
|
||||
]
|
||||
SOURCE_MOD_CRYPTO += [
|
||||
'vendor/trezor-crypto/address.c',
|
||||
@ -199,7 +197,7 @@ if THP:
|
||||
|
||||
# modtrezorio
|
||||
SOURCE_MOD += [
|
||||
'embed/extmod/modtrezorio/modtrezorio.c',
|
||||
'embed/upymod/modtrezorio/modtrezorio.c',
|
||||
]
|
||||
|
||||
# modtrezorui
|
||||
@ -207,36 +205,27 @@ CPPPATH_MOD += [
|
||||
'vendor/micropython/lib/uzlib',
|
||||
]
|
||||
SOURCE_MOD += [
|
||||
'embed/extmod/modtrezorui/modtrezorui.c',
|
||||
'embed/lib/colors.c',
|
||||
'embed/lib/display_utils.c',
|
||||
'embed/lib/error_handling.c',
|
||||
'embed/lib/fonts/font_bitmap.c',
|
||||
'embed/lib/fonts/fonts.c',
|
||||
'embed/lib/gfx_color.c',
|
||||
'embed/lib/gfx_bitblt_rgb565.c',
|
||||
'embed/lib/gfx_bitblt_rgba8888.c',
|
||||
'embed/lib/gfx_bitblt_mono8.c',
|
||||
'embed/lib/image.c',
|
||||
'embed/lib/mini_printf.c',
|
||||
'embed/lib/rsod.c',
|
||||
'embed/lib/terminal.c',
|
||||
'embed/lib/translations.c',
|
||||
'embed/lib/unit_variant.c',
|
||||
'embed/upymod/modtrezorui/modtrezorui.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_rgb565.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_rgba8888.c',
|
||||
'embed/gfx/bitblt/gfx_bitblt_mono8.c',
|
||||
'embed/gfx/fonts/font_bitmap.c',
|
||||
'embed/gfx/fonts/fonts.c',
|
||||
'embed/gfx/gfx_color.c',
|
||||
'embed/gfx/gfx_draw.c',
|
||||
'embed/gfx/terminal.c',
|
||||
'embed/io/display/display_utils.c',
|
||||
'embed/util/image/image.c',
|
||||
'embed/util/translations/translations.c',
|
||||
'embed/util/rsod/rsod.c',
|
||||
'embed/rtl/error_handling.c',
|
||||
'embed/rtl/mini_printf.c',
|
||||
'vendor/micropython/lib/uzlib/adler32.c',
|
||||
'vendor/micropython/lib/uzlib/crc32.c',
|
||||
'vendor/micropython/lib/uzlib/tinflate.c',
|
||||
]
|
||||
|
||||
if NEW_RENDERING:
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/gfx_draw.c',
|
||||
]
|
||||
else:
|
||||
SOURCE_MOD += [
|
||||
'embed/lib/display_draw.c',
|
||||
]
|
||||
|
||||
CPPDEFINES_MOD += [
|
||||
'TRANSLATIONS',
|
||||
'FANCY_FATAL_ERROR',
|
||||
@ -247,22 +236,19 @@ if FROZEN:
|
||||
if RASPI:
|
||||
CPPDEFINES_MOD += ['TREZOR_EMULATOR_RASPI']
|
||||
|
||||
if NEW_RENDERING:
|
||||
CPPDEFINES_MOD += ['NEW_RENDERING']
|
||||
|
||||
# modtrezorutils
|
||||
SOURCE_MOD += [
|
||||
'embed/extmod/modtrezorutils/modtrezorutils.c',
|
||||
'embed/upymod/modtrezorutils/modtrezorutils.c',
|
||||
]
|
||||
|
||||
# rust mods
|
||||
SOURCE_MOD += [
|
||||
'embed/extmod/rustmods.c',
|
||||
'embed/upymod/rustmods.c',
|
||||
]
|
||||
|
||||
# modutime
|
||||
SOURCE_MOD += [
|
||||
'embed/extmod/modutime.c',
|
||||
'embed/upymod/modutime.c',
|
||||
]
|
||||
|
||||
SOURCE_MICROPYTHON = [
|
||||
@ -392,23 +378,24 @@ SOURCE_MICROPYTHON = [
|
||||
]
|
||||
|
||||
SOURCE_UNIX = [
|
||||
'embed/trezorhal/unix/bootutils.c',
|
||||
'embed/trezorhal/unix/common.c',
|
||||
'embed/trezorhal/unix/entropy.c',
|
||||
'embed/trezorhal/unix/flash_otp.c',
|
||||
'embed/trezorhal/unix/flash.c',
|
||||
'embed/trezorhal/unix/fwutils.c',
|
||||
'embed/trezorhal/unix/mpu.c',
|
||||
'embed/trezorhal/unix/random_delays.c',
|
||||
'embed/trezorhal/unix/rng.c',
|
||||
'embed/trezorhal/unix/system.c',
|
||||
'embed/trezorhal/unix/systick.c',
|
||||
'embed/trezorhal/unix/systimer.c',
|
||||
'embed/trezorhal/unix/time_estimate.c',
|
||||
'embed/trezorhal/unix/usb.c',
|
||||
'embed/unix/main_main.c',
|
||||
'embed/unix/main.c',
|
||||
'embed/unix/profile.c',
|
||||
'embed/io/display/unix/display_driver.c',
|
||||
'embed/io/usb/unix/usb.c',
|
||||
'embed/sec/entropy/unix/entropy.c',
|
||||
'embed/sec/random_delays/unix/random_delays.c',
|
||||
'embed/sec/rng/unix/rng.c',
|
||||
'embed/sec/time_estimate/unix/time_estimate.c',
|
||||
'embed/sys/mpu/unix/mpu.c',
|
||||
'embed/sys/startup/unix/bootutils.c',
|
||||
'embed/sys/task/unix/system.c',
|
||||
'embed/sys/time/unix/systick.c',
|
||||
'embed/sys/time/unix/systimer.c',
|
||||
'embed/util/flash/unix/flash.c',
|
||||
'embed/util/flash/unix/flash_otp.c',
|
||||
'embed/util/fwutils/fwutils.c',
|
||||
'embed/util/unit_properties/unix/unit_properties.c',
|
||||
'embed/projects/unix/main_main.c',
|
||||
'embed/projects/unix/main.c',
|
||||
'embed/projects/unix/profile.c',
|
||||
'vendor/micropython/ports/unix/alloc.c',
|
||||
'vendor/micropython/ports/unix/gccollect.c',
|
||||
'vendor/micropython/ports/unix/input.c',
|
||||
@ -416,16 +403,6 @@ SOURCE_UNIX = [
|
||||
'vendor/micropython/shared/runtime/gchelper_generic.c',
|
||||
]
|
||||
|
||||
if NEW_RENDERING:
|
||||
SOURCE_MOD += [
|
||||
'embed/trezorhal/unix/display_driver.c',
|
||||
'embed/trezorhal/xdisplay_legacy.c',
|
||||
]
|
||||
else:
|
||||
SOURCE_MOD += [
|
||||
'embed/trezorhal/unix/display-unix.c',
|
||||
]
|
||||
|
||||
TRANSLATION_DATA = [
|
||||
"translations/en.json",
|
||||
"translations/order.json",
|
||||
@ -440,22 +417,15 @@ if PYOPT == '0' or not FROZEN:
|
||||
else:
|
||||
STATIC=""
|
||||
|
||||
env = Environment(ENV=os.environ, CFLAGS='%s -DCONFIDENTIAL= -DPYOPT=%s -DBITCOIN_ONLY=%s %s' % (ARGUMENTS.get('CFLAGS', ''), PYOPT, BITCOIN_ONLY, STATIC))
|
||||
env = Environment(
|
||||
ENV=os.environ,
|
||||
CFLAGS=ARGUMENTS.get("CFLAGS", "") + f" -DCONFIDENTIAL= -DPYOPT={PYOPT} -DBITCOIN_ONLY={BITCOIN_ONLY} {STATIC}",
|
||||
CPPDEFPREFIX="-D'",
|
||||
CPPDEFSUFFIX="'",
|
||||
)
|
||||
|
||||
FEATURES_AVAILABLE = models.configure_board(TREZOR_MODEL, HW_REVISION, FEATURES_WANTED, env, CPPDEFINES_HAL, SOURCE_UNIX, PATH_HAL)
|
||||
|
||||
|
||||
if 'sd_card' in FEATURES_AVAILABLE:
|
||||
SDCARD = True
|
||||
else:
|
||||
SDCARD = False
|
||||
|
||||
if 'optiga' in FEATURES_AVAILABLE:
|
||||
OPTIGA = True
|
||||
else:
|
||||
OPTIGA = False
|
||||
|
||||
|
||||
env.Tool('micropython')
|
||||
|
||||
env.Replace(
|
||||
@ -498,7 +468,7 @@ if ARGUMENTS.get('TREZOR_EMULATOR_DEBUGGABLE', '0') == '1':
|
||||
|
||||
if ARGUMENTS.get('TREZOR_MEMPERF', '0') == '1':
|
||||
CPPDEFINES_MOD += [
|
||||
('MICROPY_TREZOR_MEMPERF', '\(1\)')
|
||||
('MICROPY_TREZOR_MEMPERF', '1')
|
||||
]
|
||||
|
||||
env.Replace(
|
||||
@ -506,12 +476,28 @@ env.Replace(
|
||||
|
||||
ALLPATHS=['.',
|
||||
'embed/rust',
|
||||
'embed/lib',
|
||||
'embed/rtl/inc',
|
||||
'embed/models',
|
||||
'embed/unix',
|
||||
'embed/trezorhal',
|
||||
'embed/trezorhal/unix',
|
||||
'embed/extmod/modtrezorui',
|
||||
'embed/projects/unix',
|
||||
'embed/upymod/modtrezorui',
|
||||
'embed/gfx/inc',
|
||||
'embed/io/display/inc',
|
||||
'embed/io/usb/inc',
|
||||
'embed/sec/entropy/inc',
|
||||
'embed/sec/random_delays/inc',
|
||||
'embed/sec/time_estimate/inc',
|
||||
'embed/sys/bsp/inc',
|
||||
'embed/sec/rng/inc',
|
||||
'embed/sys/mpu/inc',
|
||||
'embed/sys/startup/inc',
|
||||
'embed/sys/task/inc',
|
||||
'embed/sys/time/inc',
|
||||
'embed/util/flash/inc',
|
||||
'embed/util/fwutils/inc',
|
||||
'embed/util/image/inc',
|
||||
'embed/util/rsod/inc',
|
||||
'embed/util/translations/inc',
|
||||
'embed/util/unit_properties/inc',
|
||||
'vendor/micropython',
|
||||
'vendor/micropython/ports/unix',
|
||||
'vendor/micropython/lib/mp-readline',
|
||||
@ -528,7 +514,7 @@ env.Replace(
|
||||
CPPDEFINES=[
|
||||
'TREZOR_EMULATOR',
|
||||
'TREZOR_MODEL_'+TREZOR_MODEL,
|
||||
('MP_CONFIGFILE', '\\"embed/unix/mpconfigport.h\\"'),
|
||||
('MP_CONFIGFILE', '"embed/projects/unix/mpconfigport.h"'),
|
||||
ui.get_ui_layout(TREZOR_MODEL),
|
||||
] + CPPDEFINES_MOD + CPPDEFINES_HAL,
|
||||
ASPPFLAGS='$CFLAGS $CCFLAGS', )
|
||||
@ -629,7 +615,7 @@ if FROZEN:
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/*.py',
|
||||
exclude=[
|
||||
SOURCE_PY_DIR + 'trezor/sdcard.py',
|
||||
] if not SDCARD else []
|
||||
] if 'sd_card' not in FEATURES_AVAILABLE else []
|
||||
))
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/crypto/*.py'))
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/*.py'))
|
||||
@ -650,11 +636,12 @@ if FROZEN:
|
||||
))
|
||||
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/wire/*.py'))
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/wire/codec/*.py'))
|
||||
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'storage/*.py',
|
||||
exclude=[
|
||||
SOURCE_PY_DIR + 'storage/sd_salt.py',
|
||||
] if not SDCARD else []
|
||||
] if 'sd_card' not in FEATURES_AVAILABLE else []
|
||||
))
|
||||
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/messages/__init__.py'))
|
||||
@ -679,16 +666,16 @@ if FROZEN:
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/common/*.py',
|
||||
exclude=[
|
||||
SOURCE_PY_DIR + 'apps/common/sdcard.py',
|
||||
] if not SDCARD else []
|
||||
] if "sd_card" not in FEATURES_AVAILABLE else []
|
||||
))
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/debug/*.py'))
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/homescreen/*.py'))
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/management/*.py',
|
||||
exclude=[
|
||||
SOURCE_PY_DIR + 'apps/management/sd_protect.py',
|
||||
] if not SDCARD else [] + [
|
||||
] if "sd_card" not in FEATURES_AVAILABLE else [] + [
|
||||
SOURCE_PY_DIR + 'apps/management/authenticate_device.py',
|
||||
] if not OPTIGA else [])
|
||||
] if "optiga" not in FEATURES_AVAILABLE else [])
|
||||
)
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/management/*/*.py'))
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/misc/*.py'))
|
||||
@ -700,6 +687,11 @@ if FROZEN:
|
||||
SOURCE_PY_DIR + 'apps/bitcoin/sign_tx/zcash_v4.py',
|
||||
])
|
||||
)
|
||||
if BENCHMARK:
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/benchmark/*.py'))
|
||||
|
||||
if THP:
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/thp/*.py'))
|
||||
|
||||
if EVERYTHING:
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/binance/*.py'))
|
||||
@ -742,8 +734,6 @@ if FROZEN:
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/tezos/*.py'))
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Tezos*.py'))
|
||||
|
||||
if THP:
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/thp/*.py'))
|
||||
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/zcash/*.py'))
|
||||
|
||||
@ -755,15 +745,15 @@ if FROZEN:
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/bitcoin/sign_tx/zcash_v4.py'))
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Zcash*.py'))
|
||||
|
||||
if BENCHMARK:
|
||||
SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/benchmark/*.py'))
|
||||
|
||||
source_mpy = env.FrozenModule(
|
||||
source=SOURCE_PY,
|
||||
source_dir=SOURCE_PY_DIR,
|
||||
bitcoin_only=BITCOIN_ONLY,
|
||||
backlight='backlight' in FEATURES_AVAILABLE,
|
||||
optiga=OPTIGA,
|
||||
optiga='optiga' in FEATURES_AVAILABLE,
|
||||
use_button='button' in FEATURES_AVAILABLE,
|
||||
use_touch='touch' in FEATURES_AVAILABLE,
|
||||
ui_layout=ui.get_ui_layout(TREZOR_MODEL),
|
||||
thp=THP,
|
||||
)
|
||||
@ -842,15 +832,12 @@ def cargo_build():
|
||||
|
||||
features.extend(FEATURES_AVAILABLE)
|
||||
|
||||
if NEW_RENDERING:
|
||||
features.append('new_rendering')
|
||||
|
||||
env.get('ENV')['TREZOR_MODEL'] = TREZOR_MODEL
|
||||
|
||||
bindgen_macros = tools.get_bindgen_defines(env.get("CPPDEFINES"), ALLPATHS)
|
||||
build_dir = str(Dir('.').abspath)
|
||||
|
||||
return f'export BINDGEN_MACROS=\'{bindgen_macros}\'; export BUILD_DIR=\'{build_dir}\'; cd embed/rust; cargo build --profile {RUST_PROFILE} --target-dir=../../build/unix/rust --no-default-features --features "{" ".join(features)}" --target {TARGET}'
|
||||
return f'export BINDGEN_MACROS={shlex.quote(bindgen_macros)}; export BUILD_DIR=\'{build_dir}\'; cd embed/rust; cargo build --profile {RUST_PROFILE} --target-dir=../../build/unix/rust --no-default-features --features "{" ".join(features)}" --target {TARGET}'
|
||||
|
||||
rust = env.Command(
|
||||
target=RUST_LIBPATH,
|
||||
|
@ -12,3 +12,6 @@ SConscript('SConscript.firmware', variant_dir='build/firmware', duplicate=False)
|
||||
SConscript('SConscript.prodtest', variant_dir='build/prodtest', duplicate=False)
|
||||
SConscript('SConscript.reflash', variant_dir='build/reflash', duplicate=False)
|
||||
SConscript('SConscript.unix', variant_dir='build/unix', duplicate=False)
|
||||
|
||||
if ARGUMENTS.get('QUIET_MODE', '0') == '1':
|
||||
Progress('$TARGET\r', overwrite=True)
|
||||
|
@ -1 +0,0 @@
|
||||
../../../tools/towncrier.template.md
|
@ -1 +0,0 @@
|
||||
../../../tools/generate-changelog-unreleased.sh
|
@ -1 +0,0 @@
|
||||
../../../tools/towncrier.toml
|
@ -1 +0,0 @@
|
||||
../../../tools/towncrier.template.md
|
@ -1 +0,0 @@
|
||||
../../../tools/generate-changelog-unreleased.sh
|
@ -1 +0,0 @@
|
||||
../../../tools/towncrier.toml
|
@ -1 +0,0 @@
|
||||
../../../tools/towncrier.template.md
|
@ -1 +0,0 @@
|
||||
../../../tools/generate-changelog-unreleased.sh
|
@ -1 +0,0 @@
|
||||
../../../tools/towncrier.toml
|
@ -1,119 +0,0 @@
|
||||
#ifdef SYSTEM_VIEW
|
||||
|
||||
#include "systemview.h"
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include "irq.h"
|
||||
#include "mpconfigport.h"
|
||||
|
||||
#include "SEGGER_SYSVIEW.h"
|
||||
#include "SEGGER_SYSVIEW_Conf.h"
|
||||
|
||||
#define SYSTICK ((SYSTICK_REGS *)0xE000E010)
|
||||
#define SCS ((SCS_REGS *)0xE000ED00)
|
||||
|
||||
// for storing DWT CYCCNT from SVC call
|
||||
volatile uint32_t cyccnt_cycles;
|
||||
|
||||
typedef struct {
|
||||
volatile unsigned int CSR;
|
||||
volatile unsigned int RVR;
|
||||
volatile unsigned int CVR;
|
||||
volatile unsigned int CALIB;
|
||||
} SYSTICK_REGS;
|
||||
|
||||
typedef struct {
|
||||
volatile unsigned int CPUID; // CPUID Base Register
|
||||
volatile unsigned int ICSR; // Interrupt Control and State Register
|
||||
volatile unsigned int VTOR; // Vector Table Offset Register
|
||||
volatile unsigned int
|
||||
AIRCR; // Application Interrupt and Reset Control Register
|
||||
volatile unsigned int SCR; // System Control Register
|
||||
volatile unsigned int CCR; // Configuration and Control Register
|
||||
volatile unsigned int SHPR1; // System Handler Priority Register 1
|
||||
volatile unsigned int SHPR2; // System Handler Priority Register 2
|
||||
volatile unsigned int SHPR3; // System Handler Priority Register 3
|
||||
volatile unsigned int SHCSR; // System Handler Control and State Register
|
||||
volatile unsigned int CFSR; // Configurable Fault Status Register
|
||||
volatile unsigned int HFSR; // HardFault Status Register
|
||||
volatile unsigned int DFSR; // Debug Fault Status Register
|
||||
volatile unsigned int MMFAR; // MemManage Fault Address Register
|
||||
volatile unsigned int BFAR; // BusFault Address Register
|
||||
volatile unsigned int AFSR; // Auxiliary Fault Status Register
|
||||
volatile unsigned int aDummy0[4]; // 0x40-0x4C Reserved
|
||||
volatile unsigned int aDummy1[4]; // 0x50-0x5C Reserved
|
||||
volatile unsigned int aDummy2[4]; // 0x60-0x6C Reserved
|
||||
volatile unsigned int aDummy3[4]; // 0x70-0x7C Reserved
|
||||
volatile unsigned int aDummy4[2]; // 0x80-0x87 - - - Reserved.
|
||||
volatile unsigned int CPACR; // Coprocessor Access Control Register
|
||||
} SCS_REGS;
|
||||
|
||||
extern uint32_t SystemCoreClock;
|
||||
|
||||
static inline uint32_t is_mode_unprivileged(void) {
|
||||
uint32_t r0;
|
||||
__asm__ volatile("mrs %0, control" : "=r"(r0));
|
||||
return r0 & 1;
|
||||
}
|
||||
|
||||
uint32_t svc_get_dwt_cyccnt() {
|
||||
if (is_mode_unprivileged()) {
|
||||
__asm__ __volatile__("svc %0" ::"i"(SVC_GET_DWT_CYCCNT));
|
||||
} else {
|
||||
cyccnt_cycles = *DWT_CYCCNT_ADDR;
|
||||
}
|
||||
return cyccnt_cycles;
|
||||
}
|
||||
|
||||
U32 SEGGER_SYSVIEW_X_GetInterruptId() {
|
||||
return ((*(U32 *)(0xE000ED04)) & 0x1FF);
|
||||
}
|
||||
|
||||
void enable_systemview() {
|
||||
SEGGER_SYSVIEW_Conf();
|
||||
SEGGER_SYSVIEW_Start();
|
||||
|
||||
U32 v;
|
||||
//
|
||||
// Configure SysTick and debug monitor interrupt priorities
|
||||
// Low value means high priority
|
||||
// A maximum of 8 priority bits and a minimum of 3 bits is implemented per
|
||||
// interrupt. How many bits are implemented depends on the actual CPU being
|
||||
// used If less than 8 bits are supported, the lower bits of the priority byte
|
||||
// are RAZ. In order to make sure that priority of monitor and SysTick always
|
||||
// differ, please make sure that the difference is visible in the highest 3
|
||||
// bits
|
||||
v = SCS->SHPR3;
|
||||
v |= (0xFFuL << 24); // Lowest prio for SysTick so SystemView does not get
|
||||
// interrupted by Systick
|
||||
SCS->SHPR3 = v;
|
||||
//
|
||||
// Configure SysTick interrupt
|
||||
// SysTick is running at CPU speed
|
||||
// Configure SysTick to fire every ms
|
||||
//
|
||||
SYSTICK->RVR = (SystemCoreClock / 1000) - 1; // set reload
|
||||
SYSTICK->CVR = 0x00; // set counter
|
||||
SYSTICK->CSR = 0x07; // enable systick
|
||||
}
|
||||
|
||||
#ifdef SYSTEMVIEW_DEST_RTT
|
||||
size_t _write(int file, const void *ptr, size_t len);
|
||||
#endif
|
||||
|
||||
size_t segger_print(const char *str, size_t len) {
|
||||
#ifdef SYSTEMVIEW_DEST_SYSTEMVIEW
|
||||
static char str_copy[1024];
|
||||
size_t copylen = len > 1023 ? 1023 : len;
|
||||
memcpy(str_copy, str, copylen);
|
||||
str_copy[copylen] = 0;
|
||||
SEGGER_SYSVIEW_Print(str_copy);
|
||||
return len;
|
||||
#endif
|
||||
#ifdef SYSTEMVIEW_DEST_RTT
|
||||
_write(0, str, len);
|
||||
return len;
|
||||
#endif
|
||||
}
|
||||
#endif
|
@ -1,23 +0,0 @@
|
||||
|
||||
#ifndef CORE_SYSTEMVIEW_H
|
||||
#define CORE_SYSTEMVIEW_H
|
||||
|
||||
#ifdef SYSTEM_VIEW
|
||||
|
||||
#include <stdint.h>
|
||||
#include "SEGGER_SYSVIEW.h"
|
||||
|
||||
#define DWT_CYCCNT_ADDR ((uint32_t*)(0xE0001004));
|
||||
#define SVC_GET_DWT_CYCCNT 3
|
||||
|
||||
extern volatile uint32_t cyccnt_cycles;
|
||||
|
||||
void enable_systemview();
|
||||
uint32_t svc_get_dwt_cyccnt();
|
||||
|
||||
#else
|
||||
#define SEGGER_SYSVIEW_RecordEnterISR()
|
||||
#define SEGGER_SYSVIEW_RecordExitISR()
|
||||
#endif
|
||||
|
||||
#endif // CORE_SYSTEMVIEW_H
|
@ -20,7 +20,7 @@
|
||||
#ifndef TREZORHAL_DMA2D_BITBLT_H
|
||||
#define TREZORHAL_DMA2D_BITBLT_H
|
||||
|
||||
#include "gfx_bitblt.h"
|
||||
#include <gfx/gfx_bitblt.h>
|
||||
|
||||
// Initializes DMA2D peripheral
|
||||
void dma2d_init(void);
|
@ -17,15 +17,16 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __TREZORHAL_TRUSTZONE__
|
||||
#define __TREZORHAL_TRUSTZONE__
|
||||
|
||||
#ifdef BOARDLOADER
|
||||
|
||||
// Provides initial security configuration of CPU and GTZC
|
||||
// in the board-loader
|
||||
void trustzone_init_boardloader(void);
|
||||
|
||||
#endif // BOARDLOADER
|
||||
#include "dma2d_bitblt.h"
|
||||
|
||||
void gfx_bitblt_init(void) {
|
||||
#if defined(USE_DMA2D) && !defined(TREZOR_EMULATOR)
|
||||
dma2d_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
void gfx_bitblt_wait(void) {
|
||||
#if defined(USE_DMA2D) && !defined(TREZOR_EMULATOR)
|
||||
dma2d_wait();
|
||||
#endif
|
||||
}
|
@ -17,7 +17,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "gfx_bitblt.h"
|
||||
#include <gfx/gfx_bitblt.h>
|
||||
|
||||
void gfx_mono8_fill(const gfx_bitblt_t* bb) {
|
||||
uint8_t* dst_ptr = (uint8_t*)bb->dst_row + bb->dst_x;
|
@ -17,7 +17,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "gfx_bitblt.h"
|
||||
#include <gfx/gfx_bitblt.h>
|
||||
|
||||
#if USE_DMA2D
|
||||
#include "dma2d_bitblt.h"
|
@ -17,7 +17,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "gfx_bitblt.h"
|
||||
#include <gfx/gfx_bitblt.h>
|
||||
|
||||
#if USE_DMA2D
|
||||
#include "dma2d_bitblt.h"
|
@ -17,12 +17,12 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include STM32_HAL_H
|
||||
#include <trezor_bsp.h>
|
||||
#include <trezor_rtl.h>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <gfx/gfx_color.h>
|
||||
|
||||
#include "dma2d_bitblt.h"
|
||||
#include "gfx_color.h"
|
||||
#include "../dma2d_bitblt.h"
|
||||
|
||||
static DMA2D_HandleTypeDef dma2d_handle = {
|
||||
.Instance = (DMA2D_TypeDef*)DMA2D_BASE,
|
@ -1,3 +1,3 @@
|
||||
#include <stdint.h>
|
||||
#include <trezor_types.h>
|
||||
|
||||
extern const uint8_t* const Font_Bitmap;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user