trezor-firmware icon indicating copy to clipboard operation
trezor-firmware copied to clipboard

New bootloader UI in rust

Open TychoVrahe opened this issue 2 years ago • 4 comments

This PR implements new bootloader UI partially in rust.

There is a new menu, allows wiping device directly without suite and rust library allows interactive buttons.

TychoVrahe avatar May 27 '22 10:05 TychoVrahe

I don't really like we are introducing Micropython stuff into the bootloader.

far as we're aware, nothing micropythonic gets into the build

matejcik avatar May 27 '22 10:05 matejcik

oh, but some source files are added. huh. will need to investigate that.

matejcik avatar May 27 '22 10:05 matejcik

There are some config files needed for the QSTR generation. We should get rid of it along with the whole qstr generation in bootloader, but it will probably require some restructuring of the whole rust part.

TychoVrahe avatar May 27 '22 10:05 TychoVrahe

Rebased - since the #2332 has now been merged, i removed all the micropython stuff here.

TychoVrahe avatar Jun 16 '22 15:06 TychoVrahe

rebased and implemented latest design updates.

TychoVrahe avatar Oct 19 '22 15:10 TychoVrahe

rebased.

TychoVrahe avatar Dec 16 '22 18:12 TychoVrahe

The rust bootloader takes about 104kB, which surprisingly is even less than current master (106kB). One reason is that this uses algorithmic loader instead of the data based one (cca 7kB savings).

I don't have screenshots (bootloader doesn't support it), can make some photos.

But its a good point: since we are now sharing UI code between firmware and bootloader it would be very wise to add the bootloader screens to fixtures somehow

TychoVrahe avatar Jan 30 '23 22:01 TychoVrahe

Yeah, the code sharing may become problematic. Regarding UI perhaps we can expose the bootloader screens in PYOPT=0 emulator and write a device tests to cover them?

mmilata avatar Jan 31 '23 15:01 mmilata

Rebased before next reviews. Includes fixed loader that was broken since the Icon type introduction - https://github.com/trezor/trezor-firmware/pull/2306/commits/e8bfaaf0ce8931678427c9ef304bce3f83feda70.

Device tests with exposure via PYOPT=0 seem reasonable. Lets do that in separate issue though?

TychoVrahe avatar Jan 31 '23 21:01 TychoVrahe

rebased, implemented #71 and latest design changes

TychoVrahe avatar Feb 09 '23 09:02 TychoVrahe

New designs of RSOD in linked issue.

Hannsek avatar Feb 15 '23 14:02 Hannsek

related issue #2823

Hannsek avatar Feb 16 '23 14:02 Hannsek

Can we wait with merging this for new designs?

Hannsek avatar Feb 21 '23 12:02 Hannsek

I would prefer to merge this and do the design updates in next PR, as this has already been reviewed and its quite big already.

TychoVrahe avatar Feb 21 '23 13:02 TychoVrahe

Can we then merge it?

Hannsek avatar Mar 01 '23 12:03 Hannsek

fixed the StrBuffer issue in error screens by a dirty trick that is ok for error screens but not much else. we'll need lifetimes for StrBuffer to fix this properly

matejcik avatar Mar 01 '23 13:03 matejcik

force-pushed to get the build working and fix conflicts (they were trivial except for a disagreement about what is "TOP_RIGHT", but there was only one correct answer)

matejcik avatar Mar 01 '23 14:03 matejcik

rebased again to solve latest conflicts

TychoVrahe avatar Mar 04 '23 20:03 TychoVrahe

one more force-push to squash the huge number of fixups

matejcik avatar Mar 09 '23 12:03 matejcik

@mmilata a quick review of 7a110aa0b57c290610cab5b10f67f5884c6d7727 please? if you feel it's ok then please go ahead and merge this

matejcik avatar Mar 09 '23 14:03 matejcik

Click tests got stuck at test_reset_slip39_advanced_16of16groups_16of16shares, re-running the job.

mmilata avatar Mar 09 '23 14:03 mmilata

QA OK

tested on bf27e4ebb5a58864ff02e1f7e5d5e624cd9bdbce version restart and wipe device buttons works as expected in BL mode

bosomt avatar Mar 30 '23 11:03 bosomt