TSEC: Difference between revisions
The bootloader does not use the RTC but the timer |
|||
Line 228: | Line 228: | ||
u32 boot_res = 0; | u32 boot_res = 0; | ||
u32 | |||
// The bootloader allows the TSEC two seconds from this point to do its job | |||
u32 maximum_time = read_timer() + 2000000; | |||
while (!boot_res) | while (!boot_res) | ||
Line 235: | Line 237: | ||
boot_res = *(u32 *)FALCON_SCRATCH1; | boot_res = *(u32 *)FALCON_SCRATCH1; | ||
// Read from | // Read from TIMERUS_CNTR_1US (microseconds from boot) | ||
u32 current_time = read_timer(); | |||
// Booting is taking too long | // Booting is taking too long | ||
if ( | if (current_time > maximum_time) | ||
panic(); | panic(); | ||
} | } |