Пример #1
0
static Uint32 LOCAL_boot(void)
{
  DEVICE_BootMode bootMode;
  
  // Read boot mode 
  bootMode = DEVICE_bootMode();
    
  if (bootMode == DEVICE_BOOTMODE_UART)
  {
    // Wait until the RBL is done using the UART. 
    while((UART0->LSR & 0x40) == 0 );
  }

  // Platform Initialization
  DEVICE_init();

  // Set RAM pointer to beginning of RAM space
  UTIL_setCurrMemPtr(0);

  // Send some information to host
  DEBUG_printString("TI SLT Version: ");
  DEBUG_printString(SLT_VERSION_STRING);
  DEBUG_printString("\r\nBooting Catalog Boot Loader\r\nBootMode = ");
  
  // Select Boot Mode
  switch(bootMode)
  {
    case DEVICE_BOOTMODE_UART:
    {
      //Report Bootmode to host
      DEBUG_printString("UART\r\n");
    }
    default:
    {
      UARTBOOT_copy();
      break;
    }
  }
    
  UART_sendString("   DONE", TRUE);
  
  UTIL_waitLoop(10000);

  DEVICE_TIMER0Stop();

  return E_PASS;    
}
Пример #2
0
static Uint32 LOCAL_boot(void)
{
  DEVICE_BootMode bootMode;

  // Read boot mode 
  bootMode = DEVICE_bootMode();
  
  if (bootMode == DEVICE_BOOTMODE_UART)
  {
    // Wait until the RBL is done using the UART. 
    while((UART0->LSR & 0x40) == 0 );
  }

  // Platform Initialization
  if ( DEVICE_init() != E_PASS )
  {
    DEBUG_printString(devString);
    DEBUG_printString(" initialization failed!\r\n");
    asm(" MOV PC, #0");
  }
  else
  {
    DEBUG_printString(devString);
    DEBUG_printString(" initialization passed!\r\n");
  }

  // Set RAM pointer to beginning of RAM space
  UTIL_setCurrMemPtr(0);

  // Send some information to host
  DEBUG_printString("TI SFT Version: ");
  DEBUG_printString(SFT_VERSION_STRING);
  DEBUG_printString("\r\nBooting Catalog Serial Flasher\r\n");
  
  // Perform UART boot (always assume UART boot since this is only used for serial flashing)
  UARTBOOT_copy();
    
  DEBUG_printString("   DONE");
  
  UTIL_waitLoop(10000);

  DEVICE_TIMER0Stop();

  return E_PASS;    
}
Пример #3
0
// Main entry point
void main(void)
{
  Uint32 status;

  // Give some time for host to become ready
  UTIL_waitLoop(100000);
  
  // Set RAM pointer to beginning of RAM space
  UTIL_setCurrMemPtr(0);
  
  // Init device PLLs, PSCs, external memory, etc.
  status = DEVICE_init();
  
  // Open UART peripheral for sending out status
  if (status == E_PASS)
  {
    DEVICE_UARTInit(DEVICE_UART_PERIPHNUM);
    hUartInfo = UART_open(DEVICE_UART_PERIPHNUM, hDEVICE_UART_config);
    //DEBUG_printString((String) devString);
    //DEBUG_printString(" initialization passed!\r\n");
  }
  else
  {
    return;
  }
  // Send some information to host
  //DEBUG_printString("TI SFT Version: ");
  //DEBUG_printString(SFT_VERSION_STRING);
  //DEBUG_printString("\r\n");
  
  // Perform UART boot (always assume UART boot since this is only used for serial flashing)
  UARTBOOT_copy();
    
  //DEBUG_printString("   DONE");
  
  //UTIL_waitLoop(10000);

  // FIXME: This should bre replaced with DEVICE_finalize()
  DEVICE_TIMER0Stop();

  // Jump to entry point
  APPEntry = (void (*)(void)) gEntryPoint;
  (*APPEntry)();
}