GithubHelp home page GithubHelp logo

spartacus429496 / bithd-mcu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bithd/bithd-mcu

0.0 1.0 0.0 1.92 MB

:lock: Sources for TREZOR firmware

License: GNU Lesser General Public License v3.0

Dockerfile 0.06% Makefile 0.65% C 95.21% Python 2.84% Shell 0.49% C++ 0.24% Perl 0.38% Assembly 0.13%

bithd-mcu's Introduction

TREZOR Firmware

Build Status gitter

https://trezor.io/

How to build TREZOR firmware?

  1. Install Docker
  2. git clone https://github.com/trezor/trezor-mcu.git
  3. cd trezor-mcu
  4. ./build-firmware.sh TAG (where TAG is v1.5.0 for example, if left blank the script builds latest commit in master branch)

This creates file build/trezor-TAG.bin and prints its fingerprint and size at the end of the build log.

How to build TREZOR bootloader?

  1. Install Docker
  2. git clone https://github.com/trezor/trezor-mcu.git
  3. cd trezor-mcu
  4. ./build-bootloader.sh TAG (where TAG is bl1.3.2 for example, if left blank the script builds latest commit in master branch)

This creates file build/bootloader-TAG.bin and prints its fingerprint and size at the end of the build log.

How to get fingerprint of firmware signed and distributed by SatoshiLabs?

  1. Pick version of firmware binary listed on https://wallet.trezor.io/data/firmware/releases.json
  2. Download it: wget -O trezor.signed.bin https://wallet.trezor.io/data/firmware/trezor-1.3.6.bin
  3. Compute fingerprint: tail -c +257 trezor.signed.bin | sha256sum

Step 3 should produce the same sha256 fingerprint like your local build (for the same version tag). Firmware has a special header (of length 256 bytes) holding signatures themselves, which must be avoided while calculating the fingerprint, that's why tail command has to be used.

git clone https://github.com/trezor/trezor-mcu.git cd trezor-mcu/ git submodule update --init --recursive make -C vendor/libopencm3/ lib/stm32/f2 export MEMORY_PROTECT=0 make make -C bootloader/ align make -C vendor/nanopb/generator/proto/ make -C firmware/protob/ make -C firmware/ sign cp bootloader/bootloader.bin bootloader/combine/bl.bin cp firmware/trezor.bin bootloader/combine/fw.bin cd bootloader/combine/ && ./prepare.py

cs find e main cs find e take the risk cs find e APPVER cs add ./cscope.out cs cs find g usbPoll cs f g usbd_ep_write_packet Tlist cs f e ep_write_packet cs f e msg_out_data cs f f message wa waa wqa cs show cs add cscope.out cs find f main tab co o set hlsearch !make -C vendor/libopencm3/ lib/stm32/f2 !export MEMORY_PROTECT=0 !make !make -C bootloader/ align !make -C vendor/nanopb/generator/proto/ !make -C firmware/protob/ ! make -C firmware/ sign t cs find main we !ls ../ cs find g main tab cw wq vs W cs find f uart TagbarOpen cw tab copen q !git log -L 112,117: uart.c !git log -L 112,117:uart.c !git log -L 90,117:uart.c cs tabnew % cs f f uart only w qa

git clone https://github.com/trezor/trezor-mcu.git cd trezor-mcu/ git submodule update --init --recursive make -C vendor/libopencm3/ lib/stm32/f2 export MEMORY_PROTECT=0 make make -C bootloader/ align make -C vendor/nanopb/generator/proto/ make -C firmware/protob/ make -C firmware/ sign cp bootloader/bootloader.bin bootloader/combine/bl.bin cp firmware/trezor.bin bootloader/combine/fw.bin cd bootloader/combine/ && ./prepare.py

bithd-mcu's People

Contributors

prusnak avatar jhoenicke avatar saleemrashid avatar yiwenlong avatar wangnan31415926 avatar romanz avatar axic avatar jiyajie avatar mruddy avatar arachnid avatar admin-slush avatar spartacus429496 avatar karelbilek avatar mcudev avatar darkskiez avatar jpz avatar daira avatar hno avatar schinzelh avatar ondrejsika avatar peterzen avatar bitcartel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.