Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T1 firmware update via trezorctl incorrectly throws "Invalid firmware data." if firmware image is too small #1082

Closed
hiviah opened this issue Jun 24, 2020 · 1 comment
Assignees
Labels
bug Something isn't working as expected T1B1 legacy Trezor One trezorlib Python library and the command line trezorctl tool.

Comments

@hiviah
Copy link
Contributor

hiviah commented Jun 24, 2020

Describe the bug
Updating T1 via trezorctl firmware-update -f trezor.bin throws Invalid firmware data if firmware is too small (I guess less than a full chunk). See attached small sample firmware that just shows trezor logo.

Firmware version and revision
Bootloader must be at least 1.8.0. Revision tested 6ebb388

To Reproduce
Steps to reproduce the behavior:

  1. go to bootloader
  2. trezorctl firmware-update -f trezor.bin
  3. throws Invalid firmware data
  4. if you comment out throwing the exception in python/src/trezorlib/firmware.py and try again, the flashing will succeed and firmware will run

Additional context
To create similar small T1 firmware, just put while(1); after oledRefresh in main of trezor.c and build with MEMORY_PROTECT=0

trezor.zip

@hiviah hiviah added T1B1 legacy Trezor One trezorlib Python library and the command line trezorctl tool. bug Something isn't working as expected labels Jun 24, 2020
@matejcik
Copy link
Contributor

fwiw you can use firmware-update --skip-check to side-step the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected T1B1 legacy Trezor One trezorlib Python library and the command line trezorctl tool.
Projects
None yet
Development

No branches or pull requests

2 participants