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:
parent
07d2994d0c
commit
402e7c4ec6
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user