Commit Graph

503 Commits (6d98a97f7cbc177b9c2e811142549874b782e0f9)

Author SHA1 Message Date
Pavol Rusnak ee925f7813
prodtest: draw border on start too
7 years ago
Jan Pochyla 622cb847e5 prodtest: fix touch coordinates
7 years ago
Pavol Rusnak 7537c26c83
trezor.crypto: use mp_obj_new_str_from_vstr where we already have preallocated vstr
7 years ago
Pavol Rusnak 981ec87877
trezor.crypto: put back vstr where it makes sense (= user controlled input)
7 years ago
Pavol Rusnak 4a7592d470
trezor.crypto: remove vstr usage, refactor mp_obj_new_str_from_vstr into mp_obj_new_bytes and mp_obj_new_str
7 years ago
Pavol Rusnak b98a1db6ee
embed: cleanup unused modules
7 years ago
Pavol Rusnak fa95f0a037
trezor.crypto: implement chacha20poly1305 aka rfc7539
7 years ago
Pavol Rusnak b9d5af8c19
modtrezorcrypto: remove ssss (different implementation will be re-added later)
7 years ago
Pavol Rusnak 4cc8a5432d
bootloader: use normal/regular font rather than bold
7 years ago
Pavol Rusnak 94588dd588
modtrezorui: introduce TREZOR_FONT_PREFILL, set it to 0 in bootloader
7 years ago
Pavol Rusnak 424115967f
embed: fix wur for usb functions
7 years ago
Pavol Rusnak f1a75b36f7
vendor: update micropython to 1.9.3 release
7 years ago
Pavol Rusnak d6593e710b
apps.ethereum: implement SignMessage/VerifyMessage
7 years ago
Pavol Rusnak 333c0a633a
trezor.crypto: adopt crc32 function
7 years ago
Pavol Rusnak eff3ce2aa8
unix: use ensure, not (void)
7 years ago
Jan Pochyla 7be96048f8 unix: fix wur in usb
7 years ago
Pavol Rusnak 4b54bfbbf2
modtrezorui: change loader size to 120x120
7 years ago
Pavol Rusnak 63e999ab84
trezor.ui: introduced minwidth to display.text functions; more optimizations
7 years ago
Pavol Rusnak 47f5cba439
flash/sdcard: introduce wur, simplify code
7 years ago
Pavol Rusnak 5e93cca0a9
WIP
7 years ago
Jochen Hoenicke beef9ecfb5 Moved flash_unlock to norcow_update
7 years ago
Pavol Rusnak 6aae87437f
modtrezorui: draw bars under letters
7 years ago
Pavol Rusnak 11a3ff055c
boardloader/bootloader: typo
7 years ago
Pavol Rusnak 4584861385
trezor.ui: introduce ui.SIZE
7 years ago
Pavol Rusnak 79a3f84c3c
modtrezorui: invert FONT macro inclusion logic
7 years ago
Pavol Rusnak 80707f195b
modtrezorui: small cleanup
7 years ago
Pavol Rusnak 7504366a02
bootloader: simplify vtrust code
7 years ago
Jochen Hoenicke c0cd252c83 Store pin as integer
7 years ago
Pavol Rusnak 125ab8471c
trezorhal: store image fingerprint in the image_header structure
7 years ago
Pavol Rusnak be302480fd
modtrezorcrypto: cleanup random
7 years ago
Pavol Rusnak 1a32e46e5d
bootloader: cleanup ui code
7 years ago
Pavol Rusnak 5e476b856e
unix: implement sdcard, add unit test
7 years ago
Pavol Rusnak 48ef409fdb
modtrezorio: remove mocks
7 years ago
Pavol Rusnak b4933f969e
bootloader: don't downgrade firmware below fix_version in the current firmware
7 years ago
Pavol Rusnak 965aa73b63
trezorhal: introduce fix_version in image header (version of last critical bugfix)
7 years ago
Pavol Rusnak e8f70ed4af
pin: implement graphics pin timeout
7 years ago
Jochen Hoenicke 87f7054e46 Added callback for PIN timeout
7 years ago
Jochen Hoenicke 9f2bbb0e1a Removed references to pin fail area
7 years ago
Jochen Hoenicke 497021f2ef storage: New pin fail section inside NORCOW
7 years ago
Pavol Rusnak b7444ac13e
modtrezorconfig: fix wipe error
7 years ago
Pavol Rusnak 2f719526e7
bootloader: implement vendor keys lock
7 years ago
Pavol Rusnak 45c290d24c
trezorhal: introduce vendor_keys_hash, use it in compare_to_current_vendor_header
7 years ago
Pavol Rusnak 70ac202d7a
modtrezorcrypto: add trezor.crypto.hashlib.blake256
7 years ago
Pavol Rusnak 34322d5fb6
firmware: enable stack protector (except nlr stuff)
7 years ago
Pavol Rusnak 1aba175d7d
build: adapt to new trezor-crypto changes
7 years ago
Pavol Rusnak 7b9fcf98ae
drop embed/extmod/modtrezorcrypto/trezor-crypto symlink
7 years ago
Jochen Hoenicke 816bfe387f Bug fix: missing parenthesis in flash_write_word
7 years ago
Pavol Rusnak 20a1326ebb
storage: fix typo
7 years ago
Pavol Rusnak ce3eaba925
trezorhal: use static inline instead of static (gcc 7.2 workaround)
7 years ago
Pavol Rusnak 8a8450d6be
fix build for older compilers
7 years ago
Pavol Rusnak e268aeb8b7
flash: simplify/unify flash_erase_sectors usage
7 years ago
Pavol Rusnak 6ab0f03ec4
embed: norcow_init, storage_init and flash_init don't return secbool, they halt using ensure if something goes wrong
7 years ago
Pavol Rusnak 6b94fd26e4
boardloader: rename reset_flags_init to reset_flags_check
7 years ago
Jan Pochyla 314e6a99c1 modtrezorcrypto/bip32: add HDNode.__init__
7 years ago
Pavol Rusnak 626a8885ce
trezor.config: add compaction test
7 years ago
Pavol Rusnak b39b4a4947
norcow: fix bug
7 years ago
Pavol Rusnak 7f5192701f
unix: use mmap to access flash file
7 years ago
Pavol Rusnak 44a11fa3ef
norcow: introduce NORCOW_MAGIC
7 years ago
Pavol Rusnak 38e3088325
common: don't expose shutdown() via common.h
7 years ago
Pavol Rusnak f88080b904
Merge branch 'pin_fails'
7 years ago
Pavol Rusnak 40104822e8
unix: make SDL failures fatal
7 years ago
Pavol Rusnak 04d980f8f0
add Features.model field (set to "T")
7 years ago
Jan Pochyla 8b85078730
reflash: add new firmware target
7 years ago
Jan Pochyla 09af312789 prodtest: add BORDER command
7 years ago
Pavol Rusnak 679d024df0
display: use CMD2EN: Command 2 Enable
7 years ago
mcudev 6179edde90 touch: reset and usage updates
7 years ago
mcudev 5556c37f6f display: hardware reset updates
7 years ago
mcudev 61ff3b46c5 display: ST7789V porch settings are for RGB interface, not parallel 8080-I
7 years ago
mcudev 30829b281c display: ST7789V remove commands that unnecessarily set default values again
7 years ago
mcudev e62fa345c8 display: minor ILI9341 updates
7 years ago
mcudev a0129e7715 display: orientation, windowing, and config updates
7 years ago
mcudev f53ec3f928 display: update display_unsleep
7 years ago
mcudev 5e867cc092 display: update display_sleep
7 years ago
mcudev 2ea5d102a8 bootloader, firmware: remove unneeded call to display_orientation
7 years ago
Pavol Rusnak 4002ef2a49
firmware, unix: return cpython compatibility (needed for __class__ and __dict__)
7 years ago
Pavol Rusnak ec6c3c2cdc
unix, firmware: more cleanup
7 years ago
Pavol Rusnak d4893add54
firmware, unix: turn off some modules
7 years ago
Jan Pochyla 5bd39c70b0 storage: fix change_pin and small details
7 years ago
Jan Pochyla cf14717d43 unix: add shutdown()
7 years ago
Pavol Rusnak 879a3e85bd
trezorhal: reorder stuff in common.{c,h}; remove unnecessary externs for functions
7 years ago
Pavol Rusnak d9574bf131
trezorhal: enable BOR level 3, PVD level 5, turn off display in PVD handler
7 years ago
Pavol Rusnak e4360a7296
bootloader: change upgrade criteria to vendor keyset comparison
7 years ago
Jan Pochyla 237740de9c storage: implement change_pin
7 years ago
Jan Pochyla 5e643e9195 modtrezorconfig: fix has_pin
7 years ago
Jan Pochyla df77e74988 storage: fix unlock
7 years ago
Pavol Rusnak 3636a5f1b1
bootloader/vendorheader: vtrust is bitmap not scalar
7 years ago
Pavol Rusnak 5444410e04
unix: use return value from fread properly
7 years ago
mcudev 430900ea2c boardloader: ensure check_sdcard fails when read fails
7 years ago
Pavol Rusnak 2e3b8336c2
unix: fix unused-result warning
7 years ago
Pavol Rusnak ee7d260d2f
trezorhal: use const where possible for flash
7 years ago
Pavol Rusnak 30363305f4
modtrezorconfig: use secbool, not bool
7 years ago
Jan Pochyla 1f6cc70480 flash: remove flash_set_option_bytes
7 years ago
Jan Pochyla 0376ff7f48 storage, norcow: use secbool
7 years ago
Jan Pochyla 662cfc1b2c unix/flash: use secbool
7 years ago
Jan Pochyla 418f035811 storage: add has_pin and change_pin
7 years ago
Jan Pochyla c2ec40bebf flash: flash_init returns bool
7 years ago
Jan Pochyla 353883e0f3 storage: rename constant
7 years ago
Jan Pochyla b6ba95625c norcow: port on top of flash.c, remove config
7 years ago
Jan Pochyla 27bfcfe1af norcow: import into tree
7 years ago
Jan Pochyla d4443a4f7f unix/flash: start with 0xff
7 years ago
Jan Pochyla 12708b4987 unix/flash: default FLASH_FILE
7 years ago
Jan Pochyla c78babdc12 flash: add flash_get_address
7 years ago
Jan Pochyla f07b4dda0b modtrezorconfig: extract pin & unlocking to storage.c
7 years ago
Jan Pochyla fdc2f6a39d modtrezorconfig: use new flash API
7 years ago
Jan Pochyla 543e8c5007 flash: add unix/flash.c
7 years ago
Jan Pochyla 4cabe40220 storage: pin checking in c proof of concept
7 years ago
mcudev 2ebd2b1b6b jump_to: clear out before the next stage NMI exception handler can run
7 years ago
mcudev ffc16a98b5 rng: header cleanup, loop codestyle
7 years ago
mcudev cc9aa8c197 cleanup: do not use reserved identifiers for header guards
7 years ago
Pavol Rusnak 77cc62644d
firmware: don't return CYCCNT contents as it is always zero anyway (cycle counter is disabled)
7 years ago
Pavol Rusnak 8190e0909e
boardloader: set BOR level to 2
7 years ago
mcudev 1737f17f43
boardloader: flash option bytes, production changes
7 years ago
mcudev 15bdc59b46 touch: reset touch panel
7 years ago
mcudev d9a64fbb6a touch: app note related updates and exit loop upon detection
7 years ago
mcudev 2ae1c99b06 touch: address simplification
7 years ago
mcudev 6aeccd5ee1 touch: make i2c_handle static and trivial simplification
7 years ago
mcudev d1ed02fb98 touch: use full 12-bit X and Y values
7 years ago
mcudev edd95d9b65 secbool: add unsigned literal suffixes
7 years ago
mcudev 7e01a733a3 shutdown: reorder operations
7 years ago
mcudev 5be5e19f99 clear_otg_hs_memory: remove unpredictable write
7 years ago
Jan Pochyla c632f9450f trezorhal: add spread spectrum clock
7 years ago
Jan Pochyla 6213974b6e prodtest: emulate python impl in OTP READ
7 years ago
Pavol Rusnak 7d0a12c29e
unix: fix build
7 years ago
Pavol Rusnak 311a28242b
boardloader: fix production build, disable reset_flags_init for now
7 years ago
Pavol Rusnak 16f657361c
boardloader: disable BOR protection; fix setting OB flags
7 years ago
Pavol Rusnak a08f18c2ce
boardloader: use PVD level 4
7 years ago
Pavol Rusnak 30ddb53c11
prodtest: fix calls to sdcard functions
7 years ago
Pavol Rusnak 6738796d8b
trezorhal: call shutdown in default_handler
7 years ago
Pavol Rusnak 69c17dae9b
trezorhal: use uint32_t* for sdcard_{read,write}_blocks
7 years ago
Pavol Rusnak fa802e9353
boardloader: fix test for existence of bootloader on sd card
7 years ago
Pavol Rusnak a56da7d7ed
prodtest: fix sdcard test
7 years ago
Pavol Rusnak 5d6d342813
bootloader: erase storage on vendor change
7 years ago
Jan Pochyla 836508657d prodtest: style
7 years ago
Pavol Rusnak 3851404d04
small cosmetic changes to prodtest and others
7 years ago
Pavol Rusnak d0e81edc8f
bootloader: check chunk hash before flashing
7 years ago
Pavol Rusnak 36143033c4
bootloader: check vendor header / image header before flashing
7 years ago
Pavol Rusnak 9690f1abdf
bootloader: load chunk into memory first, then save it to flash
7 years ago
Pavol Rusnak 4d36d0e1c1
trezorhal: use sectrue where possible
7 years ago
Pavol Rusnak efa918a2f9
prodtest: code cleanup, fix build
7 years ago
Jan Pochyla 905e0bc82a
prodtest: codestyle, touch, fixes
7 years ago
Jan Pochyla 51d00e1de7
trezorhal/usb: add Inf timeout to blocking fns
7 years ago
Jan Pochyla 9cb342fcb6
prodtest: implement commands
7 years ago
Jan Pochyla 95965c3ff7
prodtest: add new target
7 years ago
Pavol Rusnak f73eb3effd
trezorhal: introduce secbool/sectrue/secfalse and use it where possible
7 years ago
Pavol Rusnak 7ddfdf69d6
trezorhal: support for non-continous areas in check_image_contents
7 years ago
Pavol Rusnak 89cc35b195
trezorhal: fix hash offset in check_image_contents
7 years ago
Pavol Rusnak 7c891e19e5
boardloader, bootloader: check image contents against hashes in the header
7 years ago
Pavol Rusnak b4ff9deb6b
bootloader: better wording
7 years ago
Pavol Rusnak 63636be0a3
trezorhal: rework header checking to new format
7 years ago
Pavol Rusnak 9e82a4d348
bootloader, firmware: introduce chunk hashes in the image header
7 years ago
Pavol Rusnak 3c974095aa
trezorhal: increase image header size from 512 to 1024 bytes
7 years ago
Pavol Rusnak 0c6ee14ee1
trezorhal: move image related defines to image.h
7 years ago
Pavol Rusnak 28aca51bc8
firmware: sign just the firmware part, not vendor header
7 years ago
Pavol Rusnak e4003700cd
bootloader, firmware: update visuals
7 years ago
Pavol Rusnak 8bd258db6f
trezorhal: added calls to USBD_LL_FlushEP in deinit functions
7 years ago
Pavol Rusnak 9e31e0f4d4
bootloader: stop/deinit usb for unplug events as well
7 years ago
mcudev b922579173 bootloader: cleanup usb on firmware upload success before jumping to firmware (#68)
7 years ago
Pavol Rusnak d2ecae71d7
trezorhal: return position of last touch event from touch_click
7 years ago
Pavol Rusnak 6e51ee251f
bootloader+firmware: call shutdown instead of inf-loop after main is finished
7 years ago
mcudev abf7f822b8 boardloader: do not call shutdown directly, return and the startup code handles it
7 years ago
mcudev 041dd951d3 boardloader: do not use ensure before display_init, just return
7 years ago
mcudev 1f6edb448c boardloader: check reset flags for production
7 years ago
mcudev 3f58a771b4 boardloader: stop clearing standby flag
7 years ago
mcudev b1eea5a434 boardloader: enable PVD programmable voltage detector and interrupt
7 years ago
Jan Pochyla f93316bebd cleanup .gitignore files
7 years ago
Pavol Rusnak 6b9751d30d
trezorhal: cleanup usb api
7 years ago
Pavol Rusnak 4f041e9f3a
trezorhal: update sdcard api
7 years ago
Pavol Rusnak 3033762618
trezorhal: make touch_init and usb_init return void, use ensure inside
7 years ago
Pavol Rusnak 5f256ce0b0
bootloader: show DOM QR code on welcome screen
7 years ago
Pavol Rusnak b544fd3f81
bootloader: fix usb_init_all api
7 years ago
Pavol Rusnak 79fe9162b5
trezorhal: simplify api for init functions, use bool and void rather than int
7 years ago
Pavol Rusnak b51ca0a16e
trezorhal: remove extra comment
7 years ago
Pavol Rusnak 21fac2e2c3
boardloader: don't erase sectors in flash_set_option_bytes for now
7 years ago
mcudev d6ae912703 boardloader: flash option bytes updates
7 years ago
mcudev fc7b1cfe81 flash_init: remove empty function from all stages
7 years ago
mcudev 167d476fff image_parse_header: remove undefined behavior and other updates (#61)
7 years ago
mcudev a0286bcc29 build: further cleanup common symbols (#63)
7 years ago
Pavol Rusnak 749b80ba03
bootloader: fix touch detection at start
7 years ago
mcudev ee7e6134a2 bootloader, firmware: do not need touch interrupt handlers or to enable touch interrupts (#59)
7 years ago
mcudev 73897c1147 boardloader: remove micropython related code that enables debug features to get clock cycle counts (#58)
7 years ago
Pavol Rusnak e10d40f846
bootloader: restart into firmware after update, don't shutdown
7 years ago
Pavol Rusnak c689b1f2cd
bootloader: remove debug code
7 years ago
mcudev 4bda828cbd boardloader: disable flash data cache (#57)
7 years ago
Pavol Rusnak 17c3d2b56f
bootloader: implement UI according to mockup
7 years ago
Pavol Rusnak fdafae7d8d
trezorhal: remove timer1_get_source_freq function
7 years ago
mcudev 4f16aed757 display: handle TEON and COLMOD the same for both display types (#55)
7 years ago
Pavol Rusnak 4a14fb6c4d
boardloader: move periph_init to lowlevel.c
7 years ago
mcudev 45a4a944d0 boardloader, bootloader, firmware: only call periph_init in boardloader (#54)
7 years ago
mcudev ac89203e7c SDIO: remove SDIO_IRQHandler and interrupt config (#53)
7 years ago
Pavol Rusnak 6ea9b105e5
boardloader, bootloader: reorder erasing of sectors, check whether sector was really erased
7 years ago
Pavol Rusnak b1d9a59a79
unix: fix build
7 years ago
Pavol Rusnak 82050912c4
bootloader: implement WipeDevice
7 years ago
mcudev ca8d93ab5d boardloader, bootloader, firmware: factor out display_pwm_init (#52)
7 years ago
Pavol Rusnak 2010213338
bootloader: first UI steps
7 years ago
mcudev 0e2a1da99b display: remove redundant display commands and increase wait after reset (#51)
7 years ago
Pavol Rusnak 001298a90e
boardloader: erase storage on failed option_bytes
7 years ago
Pavol Rusnak e8e3ed98f3
boardloader: usability fixes
7 years ago
Pavol Rusnak b6f9df10bb
display: set minimum possible values for sram controller
7 years ago
Pavol Rusnak 46a0dd8648
display: fix DataSetupTime for ST7789V
7 years ago
mcudev e2b66436df display: tearing effect cleanup
7 years ago
mcudev 26852e5aee boardloader: display_init stm32f42x updates
7 years ago
mcudev e4aec8f302 code cleanup 3: add note about timer wrap and use increment operator
7 years ago
mcudev a1c33e32f0 code cleanup 2: explicit .bss, linker map, and simpler systick
7 years ago
mcudev 5b634098d9 code cleanup
7 years ago
Pavol Rusnak 06fc509cbb
boardloader: reorder calls so one can abort also by ejecting SD card
7 years ago
Pavol Rusnak 8a707ce40d
boardloader: check flash_option_bytes at start
7 years ago
mcudev 70594a9bfe startup: setup the stack protector for the stage before main function (#46)
7 years ago
Pavol Rusnak 4c9e2d45a5
bootloader: use display_fade
7 years ago
Pavol Rusnak 204f0c55e4
bootloader: use ensure
7 years ago
Pavol Rusnak bdae87ddde
boardloader: small changes to program flow and display output
7 years ago
Pavol Rusnak 4831287357
embed: move call to usb_clear to shutdown function in assembler
7 years ago
Pavol Rusnak 88894e7a8d
embed: disable stack protector for SysTick_Handler
7 years ago
Pavol Rusnak a7625877ef
embed: call clear_otg_hs_memory from fatal_error
7 years ago
mcudev 73214017fa clear_otg_hs_memory: Delay after an RCC peripheral clock enabling
7 years ago
mcudev 7103404b90 RNG: Delay after an RCC peripheral clock enabling
7 years ago
Pavol Rusnak c5dfa37f3e
boardloader: don't call copy_sdcard twice
7 years ago
Pavol Rusnak b60a1ad79f
embed: add shutdown function to fatal_error
7 years ago
Pavol Rusnak 2fc69bed61
embed: rename trassert to ensure
7 years ago
Pavol Rusnak 8cc8272fb3
build: pass gitrev, use it in fatal_error
7 years ago
mcudev 0c1f609675 SystemInit: add more waiting just to be sure (#41)
7 years ago
mcudev be92d9a7ee vector table updates (#40)
7 years ago
Pavol Rusnak 66b6406b7c
boardloader, bootloader: add write-protection and downgrade-protection respectively
7 years ago
Pavol Rusnak 9a0c8f4687
build: introduce PRODUCTION flag
7 years ago
Pavol Rusnak 380d08f1d0
embed: introduce trassert (trezor assert)
7 years ago
Pavol Rusnak d003c250d8
boardloader: refactor flash_option_bytes from trezorhal to boardloader/lowlevel
7 years ago
Pavol Rusnak 3982c19378
fix whitespace
7 years ago
mcudev 61e0f6c818 stm32f427 sram bigger (#39)
7 years ago
Pavol Rusnak 98ad17e1ea
firmware: use __FUNCTION__ in consistency with the rest of the code
7 years ago
Pavol Rusnak 7babde646e
embed: more cleanup
7 years ago
Pavol Rusnak 7653eb699d
embed: use 4bpp fonts again
7 years ago
Pavol Rusnak a43aec0fe3
embed: make F427 the default mcu
7 years ago
Pavol Rusnak 6413c2c23e
embed: rework memory layout, enable stack protector
7 years ago
Pavol Rusnak 7117c59ed9
firmware: drop firmware0 concept
7 years ago
Pavol Rusnak 10ebd43261
firmware: move nlr_jump_fail from common to firmware
7 years ago
Pavol Rusnak 32e48258e4
trezorhal: preparations for F427 support
7 years ago
Pavol Rusnak eb345046d3
trezorhal: move internal constants to common.c
7 years ago
Pavol Rusnak 69953a91c5
trezorhal: code cleanup, combine stm32_it.c + stm32_system.c into stm32.c
7 years ago
Pavol Rusnak a6fd1da237
boardloader: wait 5 seconds before copying bootloader
7 years ago
mcudev ead626404b boardloader: issue 34 (#36)
7 years ago
mcudev 9ea975d37d jump_to: reset registers to zero (#33)
7 years ago
mcudev 8e96978ce2 boardloader, bootloader, firmware stage switching updates (#30)
7 years ago
mcudev dbfeddce79 firmware: issue #12 (#29)
7 years ago
mcudev 08caf86c5b bootloader: issue #12 (#28)
7 years ago
mcudev b0c54e2a4b boardloader: simplify linker script (#27)
7 years ago
Pavol Rusnak 7bbfba1ac0
boardloader, bootloader: moving embed/common/* to embed/trezorhal/*
7 years ago
mcudev 8d3540c858 boardloader, bootloader: jump_to memory clearing and simplify code to asm
7 years ago
mcudev acca6a0945 boardloader: move memset_reg to separate source file
7 years ago
mcudev bb5b4d2e55 boardloader: simplify vector table config with macro
7 years ago
mcudev 08b231a298 boardloader: factor out vector table
7 years ago
mcudev 4ee5872a55 display: backlight handling (#25)
7 years ago