|
|
|
@ -89,12 +89,6 @@ void check_lock_screen(void)
|
|
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
|
{
|
|
|
|
|
#if EMULATOR
|
|
|
|
|
memzero(HW_ENTROPY_DATA, HW_ENTROPY_LEN);
|
|
|
|
|
#else
|
|
|
|
|
desig_get_unique_id((uint32_t*)HW_ENTROPY_DATA);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef APPVER
|
|
|
|
|
setup();
|
|
|
|
|
__stack_chk_guard = random32(); // this supports compiler provided unpredictable stack protection checks
|
|
|
|
@ -106,12 +100,19 @@ int main(void)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if (!is_mode_unprivileged()) {
|
|
|
|
|
|
|
|
|
|
desig_get_unique_id((uint32_t*)HW_ENTROPY_DATA);
|
|
|
|
|
timer_init();
|
|
|
|
|
|
|
|
|
|
#ifdef APPVER
|
|
|
|
|
// enable MPU (Memory Protection Unit)
|
|
|
|
|
mpu_config();
|
|
|
|
|
#endif
|
|
|
|
|
} else {
|
|
|
|
|
#if EMULATOR
|
|
|
|
|
memzero(HW_ENTROPY_DATA, HW_ENTROPY_LEN);
|
|
|
|
|
#else
|
|
|
|
|
// we are running in unprivileged mode
|
|
|
|
|
// use fixed HW_ENTROPY
|
|
|
|
|
memset(HW_ENTROPY_DATA, 0x3C, HW_ENTROPY_LEN);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|