Exemplo n.º 1
0
//
// Uint32 SCI_Boot - This module is the main SCI boot routine.
//                   It will load code via the SCI-A port.
//                   It will return a entry point address back
//                   to the InitBoot routine which in turn calls
//                   the ExitBoot routine.
//
Uint32 SCI_Boot(Uint32 BootMode)
{
    statusCode.status = NO_ERROR;
    statusCode.address = 0x12346578;

    Uint32 EntryAddr;

    //
    // Assign GetWordData to the SCI-A version of the
    // function. GetWordData is a pointer to a function.
    //
    GetWordData = SCIA_GetWordData;

    //
    // If the KeyValue was invalid, abort the load
    // and return the flash entry point.
    //
    if (SCIA_GetWordData() != 0x08AA)
    {
        statusCode.status = VERIFY_ERROR;
        statusCode.address = FLASH_ENTRY_POINT;
    }

    ReadReservedFn(); //reads and discards 8 reserved words

    EntryAddr = GetLongData();

    CopyData();

    Uint16 x = 0;
    for(x = 0; x < 32676; x++){}
    for(x = 0; x < 32676; x++){}

    return EntryAddr;
}
Exemplo n.º 2
0
Uint32 CAN_Boot()
{
   Uint32 EntryAddr;

   // If the missing clock detect bit is set, just
   // loop here.
   if(SysCtrlRegs.PLLSTS.bit.MCLKSTS == 1)
   {
      for(;;);
   }

   // Asign GetWordData to the CAN-A version of the
   // function.  GetWordData is a pointer to a function.
   GetWordData = CAN_GetWordData;

   CAN_Init();

   // If the KeyValue was invalid, abort the load
   // and return the flash entry point.
   if (CAN_GetWordData() != 0x08AA) return FLASH_ENTRY_POINT;

   ReadReservedFn();

   EntryAddr = GetLongData();

   CopyData();

   return EntryAddr;
}
Uint32 SCI_Boot()
{
   Uint32 EntryAddr;

   // Asign GetWordData to the SCI-A version of the
   // function.  GetOnlyWordData is a pointer to a function.
   // This version doesn't send echo back each character.
   GetOnlyWordData = SCIA_GetOnlyWordData;

   SCIA_Init();
   SCIA_AutobaudLock();
   checksum = 0;

   // If the KeyValue was invalid, abort the load
   // and return the flash entry point. 
   if (SCIA_GetOnlyWordData() != 0x08AA) return FLASH_ENTRY_POINT;

   ReadReservedFn();

   EntryAddr = GetLongData();   
   CopyData();

   return EntryAddr;
}