Changes

160 bytes added ,  16:26, 12 August 2017
The bootloader does not use the RTC but the timer
Line 228: Line 228:  
   
 
   
 
  u32 boot_res = 0;
 
  u32 boot_res = 0;
  u32 time = 0;
+
 
 +
// 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 RTC_MILLISECONDS
+
     // Read from TIMERUS_CNTR_1US (microseconds from boot)
     time = rtc_read();
+
     u32 current_time = read_timer();
 
      
 
      
 
     // Booting is taking too long
 
     // Booting is taking too long
     if (time > 2000000)
+
     if (current_time > maximum_time)
 
       panic();
 
       panic();
 
  }
 
  }
26

edits