Commit Graph

301 Commits

Author SHA1 Message Date
Roman Zeyde
cb23774065 feat(core): allow exporting unit serial number
[no changelog]
2025-10-03 17:37:10 +03:00
cepetr
6096623322 feat(core): use tropic chip entropy in RNG
[no changelog]
2025-09-24 15:51:02 +02:00
obrusvit
cb6da02dfc refactor(core): move power management modules
- better code organization

[no changelog]
2025-09-16 14:30:06 +02:00
Suyash Shandilya
f51a8fe8bf feat(translations): allow dev-signed translation blobs in non-production builds
Changed the feature lock on accepting dev signed translation blobs from `debug` to `dev_keys` (new). This is enabled for all non-production builds so QA can test translations even on production ready, unsigned builds.
[no changelog]
2025-09-12 11:16:07 +02:00
cepetr
ff77431790 fix(core): enable debuglink when PYOPT=0
[no changelog]
2025-09-08 08:22:54 +02:00
cepetr
ca929574e8 feat(core): introduce DBG_CONSOLE build argument
[no changelog]
2025-08-28 15:25:56 +02:00
cepetr
71d6052652 refactor(core): simplify usb driver api
[no changelog]
2025-08-28 14:57:24 +02:00
tychovrahe
c1d0a8f1e8 chore(core): prepare for including production nRF application binary
[no changelog]
2025-08-27 16:38:35 +02:00
cepetr
2f74e03e88 chore(core): remove unused define
[no changelog]
2025-08-12 13:47:39 +02:00
cepetr
9951c962c3 refactor(core): remove circular dependencies, new 'storage' feature
[no changelog]
2025-08-12 13:47:39 +02:00
cepetr
8a8ecdfcc8 refactor(core): cleanup storage syscalls, prepare early initialization
[no changelog]
2025-08-12 13:47:39 +02:00
obrusvit
384e0157e6 fix(build): no ui_debug_overlay only in prod
[no changelog]
2025-08-11 22:52:36 +02:00
tychovrahe
74c3deaf27 refactor(core): rewrite debug overlay in rust
[no changelog]
2025-08-11 16:41:35 +02:00
tychovrahe
98692d5401 refactor(core): rename debug overlay to performance overlay
[no changelog]
2025-08-11 16:41:35 +02:00
M1nd3r
936c767db4 chore: adjust SConscripts to THP 2025-07-31 20:29:05 +02:00
cepetr
681b0d389e feat(core): introduce fail-safe/pq signed boardloader
[no changelog]
2025-07-29 11:37:47 +02:00
cepetr
6e75352af2 refactor(core): improve bl_check api
[no changelog]
2025-07-29 11:37:47 +02:00
obrusvit
059d795ec3 feat(core): implement autodim in app firmware
- similarly to bootloader, firmware sets backlight to LOW (45) after 30s
of inactivity when the device is not connected via USB
- implemented via IdleTimer

[no changelog]
2025-07-25 17:12:47 +02:00
tychovrahe
d38546e229 feat(core): add option to build dev FW with unsage vendorheader
[no changelog]
2025-07-22 14:04:09 +02:00
cepetr
564743ef7e refactor(core): introduce suspend module
[no changelog]
2025-06-25 10:54:20 +02:00
tychovrahe
9f2dec6169 refactor(core): update bootloader from coreapp, using syscalls (and smcalls)
[no changelog]
2025-06-24 14:58:11 +02:00
Martin Milata
200eac6384 refactor(core): exclude THP related string identifiers from non-THP builds
[no changelog]
2025-06-13 15:58:33 +02:00
obrusvit
f04edf3a28 feat(core): battery updates in FW event loop
[no changelog]
2025-06-11 23:39:28 +02:00
tychovrahe
01465aac7c feat(core): update NRF application from firmware
[no changelog]
2025-06-09 17:12:31 +02:00
Martin Milata
2c45bac81a refactor(core): ignore BLE exceptions on boot
[no changelog]
2025-06-05 15:53:23 +02:00
cepetr
8a115eff03 chore(core): reformat FEATURES_WANTED list for readability
[no changelog]
2025-06-04 16:58:15 +02:00
cepetr
bbb74c03a4 feat(core): introduce secure monitor
[no changelog]
2025-06-04 16:58:15 +02:00
cepetr
a7466298ff refactor(core): prepare for secure/non-secure memory layout
[no changelog]
2025-06-04 16:58:15 +02:00
Martin Milata
39a1c81154 refactor(core): device menu modules
[no changelog]
2025-05-30 17:38:16 +02:00
tychovrahe
6e82c2415f refactor(core): refactor power manager syscalls
[no changelog]
2025-05-30 14:04:45 +02:00
Roman Zeyde
556e29b068 perf(core): enable MICROPY_ROM_TEXT_COMPRESSION
Also, use `__builtin_strcmp` instead of `strcmp`.

[no changelog]
2025-05-15 09:55:40 +03:00
Roman Zeyde
bd87ebd4b0 chore(core): use -ffreestanding for SOURCE_MOD_CRYPTO and SOURCE_MOD_SECP256K1_ZKP
[no changelog]
2025-05-13 20:17:41 +03:00
Roman Zeyde
7cdb0cf244 feat(vendor): update MicroPython to allow excluding line numbers from bytecode
Setting `MICROPY_ENABLE_SOURCE_LINE=0` helps reducing the debug firmware size by ~2%:
```
$ TREZOR_MODEL=T3T1 MICROPY_ENABLE_SOURCE_LINE=0 PYOPT=0 make -C core build_firmware
<snip>
           FLASH:     1,629,456 B      1664 KB     95.63%
```

Before this PR:
```
           FLASH:     1,662,224 B      1664 KB     97.55%
```

[no changelog]
2025-05-13 17:07:37 +03:00
Roman Zeyde
3a7850f6a0 chore: remove BNB Beacon Chain support 2025-05-13 09:04:48 +03:00
cepetr
452e63c4fb feat(core): add display feature to SConscript
[no changelog]
2025-05-12 07:57:46 +02:00
cepetr
daa6ea25fb feat(core): add powerctl feature to SConscript
[no changelog]
2025-05-12 07:57:46 +02:00
Eugene Rossokha
ffbdea202a feat(core): add loadable solana tokens 2025-04-29 14:54:41 +02:00
M1nd3r
10f9254f7a chore(core): remove wire_log from non-debug builds
[no changelog]
2025-04-28 23:52:47 +02:00
Roman Zeyde
09a323e578 fix(core): remove debug-related data from PYOPT=1 firmware builds
It reduces T3T1 release universal firmware size by ~2kB:
```
Memory region         Used Size  Region Size  %age Used
           FLASH:     1580304 B      1664 KB     92.74%
```

Before this PR:
```
Memory region         Used Size  Region Size  %age Used
           FLASH:     1578256 B      1664 KB     92.62%
```

(Tested with `TREZOR_MODEL=T3T1 PYOPT=1 make -C core build_firmware`)

[no changelog]
2025-04-24 17:27:21 +03:00
Roman Zeyde
879cc69c63 perf(core): intern non-alphanumeric characters
It was found by running `micropython.mem_info()` with the following patch:
```diff
diff --git a/py/gc.c b/py/gc.c
index 604334c95..bff62b754 100644
--- a/py/gc.c
+++ b/py/gc.c
@@ -840,6 +840,7 @@ void gc_dump_info(void) {
         (uint)info.total, (uint)info.used, (uint)info.free);
     mp_printf(&mp_plat_print, " No. of 1-blocks: %u, 2-blocks: %u, max blk sz: %u, max free sz: %u\n",
         (uint)info.num_1block, (uint)info.num_2block, (uint)info.max_block, (uint)info.max_free);
+    qstr_dump_data();
 }

 void gc_dump_alloc_table(void) {
```

New QSTR definitions:
```
$ tail -n4 ./core/build/unix/genhdr/qstrdefs.generated.h
QDEF(MP_QSTR__paren_close_, 46476, 1, ")")
QDEF(MP_QSTR__paren_open_, 46477, 1, "(")
QDEF(MP_QSTR__lt_, 46489, 1, "<")
QDEF(MP_QSTR__semicolon_, 46494, 1, ";")
```

[no changelog]
2025-04-07 20:19:31 +03:00
Martin Milata
199c02adb2 build(core): only include apps.management.ble when needed
[no changelog]
2025-04-03 16:17:12 +02:00
Roman Zeyde
567de7e643 feat(core): increase MicroPython bytecode optimizations
[no changelog]
2025-03-28 19:46:24 +03:00
Roman Zeyde
cc416720f0 build(core): explicitly map PYOPT to MicroPython bytecode optimization level
[no changelog]
2025-03-28 19:46:24 +03:00
tychovrahe
b7b8e77ccb feat(core): enable tropic in firmware/kernel on hw
[no changelog]
2025-03-27 11:59:10 +01:00
Roman Zeyde
4c2c6f13e7 fix(core): add BLE feature flag to MicroPython build sed scripts
[no changelog]
2025-03-20 15:22:32 +02:00
Roman Zeyde
5fd168c363 feat(core): dump GC arena on OOM
Enabled for debug firmware and non-frozen emulator.

JSON dump can be extracted from debug log and analyzed using:

$ awk '/^\[$/,/^\]$/' <debug.log >dump.json
$ core/tools/analyze-memory-dump.py dump.json

[no changelog]
2025-03-17 20:17:42 +02:00
Roman Zeyde
2333a6a262 feat(core): log GC info in case of OOM
Enabled on debug firmware and non-frozen emulator.

[no changelog]
2025-03-17 20:17:42 +02:00
Roman Zeyde
90d7713592 build(core): fix RUST_PRINT_TYPES_SIZES passing to SConscript.firmware
Use a list to collect RUSTFLAGS, to prevent overwriting them.

Also:
- fix a typo in `SConscript.unix` (it was using `firmware` build directory)
- use keyword arguments for better readability
- reformat Rust library build command string

[no changelog]
2025-03-13 18:18:48 +02:00
Ioan Bizău
3efa0480c6 feat(core): add libtropic to the unix build
[no changelog]
2025-03-13 15:08:48 +01:00
Roman Zeyde
c95158751a build(core): allow increasing VCP write timeout
It should allow us exporting larger amounts of debug data.

[no changelog]
2025-03-13 16:07:09 +02:00