diff --git a/tools/binctl b/tools/binctl index 16250f403b..7819062ce1 100755 --- a/tools/binctl +++ b/tools/binctl @@ -18,7 +18,18 @@ def format_sigmask(sigmask): def format_vtrust(vtrust): bits = [str(b) if vtrust & (1 << b) == 0 else '.' for b in range(16)] - return '%d = [%s]' % (vtrust, ' '.join(bits)) + # see docs/bootloader.md for vtrust constants + desc = '' + wait = (vtrust & 0x000F) ^ 0x000F + if wait > 0: + desc = 'WAIT_%d' % wait + if vtrust & 0x0010 == 0: + desc += ' RED' + if vtrust & 0x0020 == 0: + desc += ' CLICK' + if vtrust & 0x0040 == 0: + desc += ' STRING' + return '%d = [%s] = [%s]' % (vtrust, ' '.join(bits), desc) # bootloader/firmware headers specification: https://github.com/trezor/trezor-core/blob/master/docs/bootloader.md