1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 14:28:07 +00:00
trezor-firmware/core/tools
Martin Milata 777ad11bec feat(core/translations): add it, pt
Partially added TR.
2024-09-03 21:58:09 +02:00
..
codegen feat(core/translations): add it, pt 2024-09-03 21:58:09 +02:00
dialog-designer ci: enable editorconfig checks, fix whitespace issues 2020-11-11 14:43:50 +01:00
gdb_scripts feat(core): add support for gdb scripts to emulator 2023-05-11 21:02:21 +02:00
hid-bridge style(all): use f-strings for formatting 2021-10-13 11:53:17 +02:00
size chore(core): replace master branch comparison with main branch 2023-11-08 10:42:24 +01:00
snippets chore(core): add type hints to tools 2023-05-11 21:02:21 +02:00
translations feat(core/translations): add it, pt 2024-09-03 21:58:09 +02:00
trezor_core_tools chore(core): use trezor-core-tools in scripts 2024-08-28 16:15:10 +02:00
.gitignore feat(core/tools): create a poetry-installable package from some cli tools 2024-08-28 16:15:10 +02:00
alloc.py feat(core/tools): improve alloc.py for seeing allocations 2023-04-14 11:22:36 +02:00
analyze-memory-dump.py feat(core): add Rust UI components, layouts, text rendering 2021-10-07 15:01:55 +02:00
bootloader_hashes.py feat(core/tests): add core bootloader hashes to make gen and gen_check targets 2024-08-29 12:47:24 +02:00
build_icons.py fix(core/ui/mercury): FIDO2 layouts 2024-09-02 19:36:25 +02:00
build_mocks chore(core): change build_mocks to include empty lines 2024-05-31 13:35:11 +02:00
build_templates feat(solana): add solana templates 2023-12-05 22:11:41 +01:00
build_vendorheader tools(core): nicer build_vendorheader for manual use 2024-04-12 16:13:52 +02:00
coverage-report chore(core): silence false alarms in coverage report 2023-03-09 16:50:32 +01:00
frozen_mpy_translator.py feat(tools): add tool for frozen_mpy bytecode analysis 2022-11-10 14:08:28 +01:00
generate_vendorheader.sh chore(core): use trezor-core-tools in scripts 2024-08-28 16:15:10 +02:00
jpg_to_h.py refactor(core/tools): add argument to jpg_to_h.py, move it to tools 2023-07-07 22:09:56 +02:00
make_cmakelists.py chore(core): automatic generation of CMakeLists 2023-02-02 11:32:37 +01:00
provision_device.py chore(core): add prodtest provisioning script 2024-05-03 09:49:37 +02:00
pyproject.toml feat(core/tools): create a poetry-installable package from some cli tools 2024-08-28 16:15:10 +02:00
README.md feat(core/tools): create a poetry-installable package from some cli tools 2024-08-28 16:15:10 +02:00
rust_api_check.py feat(all): add UI for Model R 2023-05-31 10:14:54 +02:00
rust_api_models_unification.py feat(core/tools): add scripts to check Rust API 2023-05-11 21:02:21 +02:00
upysize_ignore.json feat(tools): add ignore file for upysize tool 2022-11-10 14:08:28 +01:00

Scripts for managing the project

This directory contains various scripts that are used either in some of the make targets, or manually, to generate code, check its size, etc.

Most used tools

headertool

Lives in trezor_core_tools/headertool.py and is exposed as a CLI tool by the same name.

Headertool can generate, analyze, and modify vendor and firmware headers. Use headertool --help to get the full list of commands.

The most common usage is headertool somefile.bin that will dump header information.

Another useful feature is headertool -V vendor_header.bin firmware.bin, which will replace the embedded vendor header in firmware.bin with the one in vendor_header.bin.

build_mocks

Generate .pyi stubs from C and Rust source files.

build_templates

Regenerate sources from Mako templates.

build_vendorheader

Generate a vendor header binary from a json description.

combine_firmware

Combine a flashable image from a boardloader, bootloader, and firmware.

Everything else

codegen

Code generation tool for fonts, the loader graphic (deprecated) and cryptographic keys (also deprecated).

dialog-designer

Deprecated tool to visually preview multi-line dialogs in the old Trezor T UI.

gdb_scripts

Scripts for GDB debugger.

hid-bridge

Tool that creates a virtual HID device bridged to a UDP. This allows using the emulator as a FIDO/U2F authenticator in a browser.

size

Scripts to examine size of firmware.

snippets

Ad-hoc scripts for various one-off tasks that could become useful again.

(the whole thing is prooobably deprecated by LLMs, which will regenerate any script on demand).

translations

Tools for checking validity of translation data and its usage.

trezor_core_tools

A Python package that exposes certain functionalities as CLI commands.

headertool and combine_firmware live here, more may be moved or added.

One additional tool is layout_parser, which is used to extract memory layout information from a model .h file.

alloc.py

Generate a HTML report of allocation count per line of code, as captured when running emu.py -p.

analyze-memory-dump.py

Generate a HTML report of a state of the Micropython GC heap, as captured by trezor.utils.mem_dump at some execution point.

build_icons.py

Regenerate embedded TOIF icons for webauthn apps from png files.

coverage-report

Combine coverage reports from multiple CI jobs and generate a report.

frozen_mpy_translator.py

Translate bytecode instructions in frozen_mpy.c to human readable form.

generate_vendorheader.sh

Uses build_vendorheader to rebuild all vendor headers for all models.

jpg_to_h.py

Convert a JPG image to a C array that can be embedded into the firmware.

(TODO could we replace it with xxd -i?)

make_cmakelists.py

Generate a CMakeLists.txt file for the core.

provision_device.py

Run the provisioning flow on a prodtest firmware, against a staging provisioning server.

rust_api_checks.py

Check that the Rust UI API is consistent with the Python UI API.

rust_api_models_unification.py

Checks the consistency of the Rust API between models.