1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00

Fix compilation problems

This commit is contained in:
Jochen Hoenicke 2018-03-22 18:53:54 +01:00 committed by Pavol Rusnak
parent a7158f39a5
commit 4ebbe8c274
4 changed files with 15 additions and 3 deletions

View File

@ -48,6 +48,10 @@ void setup(void) {
setup_flash();
}
void __attribute__((noreturn)) shutdown(void) {
for(;;);
}
void emulatorRandom(void *buffer, size_t size) {
ssize_t n = read(urandom, buffer, size);
if (n < 0 || ((size_t) n) != size) {

View File

@ -47,7 +47,7 @@ void check_bootloader(void)
if (!known_bootloader(r, hash)) {
layoutDialog(&bmp_icon_error, NULL, NULL, NULL, "Unknown bootloader", "detected.", NULL, "Unplug your TREZOR", "contact our support.", NULL);
system_halt();
shutdown();
}
if (r == 32 && 0 == memcmp(hash, bl_hash, 32)) {
@ -55,6 +55,11 @@ void check_bootloader(void)
return;
}
#if 0
// ENABLE THIS AT YOUR OWN RISK
// ATTEMPTING TO OVERWRITE BOOTLOADER WITH UNSIGNED FIRMWARE MAY BRICK
// YOUR DEVICE.
// unlock sectors
memory_write_unlock();
@ -71,5 +76,6 @@ void check_bootloader(void)
// show info and halt
layoutDialog(&bmp_icon_info, NULL, NULL, NULL, _("Update finished"), _("successfully."), NULL, _("Please reconnect"), _("the device."), NULL);
system_halt();
shutdown();
#endif
}

View File

@ -19,6 +19,7 @@ if [ "$FASTFLASH" = 1 ]; then
make -C fastflash
fi
make -C bootloader
make -C vendor/nanopb/generator/proto
make -C firmware/protob

3
util.h
View File

@ -43,13 +43,14 @@ void data2hex(const void *data, uint32_t len, char *str);
// read protobuf integer and advance pointer
uint32_t readprotobufint(uint8_t **ptr);
extern void __attribute__((noreturn)) shutdown(void);
#if !EMULATOR
// defined in memory.ld
extern uint8_t _ram_start[], _ram_end[];
// defined in startup.s
extern void memset_reg(void *start, void *stop, uint32_t val);
extern void __attribute__((noreturn)) shutdown(void);
#define FW_SIGNED 0x5A3CA5C3
#define FW_UNTRUSTED 0x00000000