1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-30 09:11:07 +00:00

firmware: fix undefined symbol in emulator

This commit is contained in:
Pavol Rusnak 2019-02-18 00:53:56 +01:00
parent 07d2994d0c
commit 402e7c4ec6
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -33,7 +33,9 @@
#include "gettext.h" #include "gettext.h"
#include "bl_check.h" #include "bl_check.h"
#include "memzero.h" #include "memzero.h"
#if !EMULATOR
#include <libopencm3/stm32/desig.h> #include <libopencm3/stm32/desig.h>
#endif
/* Screen timeout */ /* Screen timeout */
uint32_t system_millis_lock_start; uint32_t system_millis_lock_start;
@ -99,17 +101,21 @@ int main(void)
__stack_chk_guard = random32(); // this supports compiler provided unpredictable stack protection checks __stack_chk_guard = random32(); // this supports compiler provided unpredictable stack protection checks
#endif #endif
#if EMULATOR
memzero(HW_ENTROPY_DATA, HW_ENTROPY_LEN);
#endif
if (!is_mode_unprivileged()) { if (!is_mode_unprivileged()) {
#if !EMULATOR
desig_get_unique_id((uint32_t*)HW_ENTROPY_DATA); desig_get_unique_id((uint32_t*)HW_ENTROPY_DATA);
#endif
timer_init(); timer_init();
#ifdef APPVER #ifdef APPVER
// enable MPU (Memory Protection Unit) // enable MPU (Memory Protection Unit)
mpu_config(); mpu_config();
#endif #endif
} else { } else {
#if EMULATOR #if !EMULATOR
memzero(HW_ENTROPY_DATA, HW_ENTROPY_LEN);
#else
// we are running in unprivileged mode // we are running in unprivileged mode
// use fixed HW_ENTROPY // use fixed HW_ENTROPY
memset(HW_ENTROPY_DATA, 0x3C, HW_ENTROPY_LEN); memset(HW_ENTROPY_DATA, 0x3C, HW_ENTROPY_LEN);