コード例 #1
0
ファイル: startup.c プロジェクト: OS-Project/Divers
/**
 * \brief   This function does two operations:\n
 *          1> Copies an array which contains vector table values to the
 *             processor's vector table space.\n
 *          2> Then it calls the main() function.\n
 *
 * \param   None.
 *
 * \return  None.
 * 
 * \note    This function is the first function that needs to be called in a
 *          system. This should be set as the entry point in the linker script
 *          file if the ELF executable is to loaded via a debugger on the
 *          target. This function never returns, but gives control to the
 *          application entry point.
 **/
unsigned int start_boot(void) 
{
    /*
    ** Copy the vector table to desired location. This is needed if the vector
    ** table is to be relocated to OCMC RAM. The default vector table base is in
    ** OCMC RAM, but we can move it to the end of OCMC RAM, to make some more
    ** space in OCMC RAM for relocating any other code, if desired. 
    ** The vector table can be placed anywhere in the memory map. If the entire
    ** code is intended to be run from DDR, it can be placed in DDR also. In this
    ** case, only vector base address register need to be set with the base
    ** address of the vector table.
    */
    CopyVectorTable();

   /* Calling the main */
    main();

    while(1);
}
コード例 #2
0
ファイル: startup.c プロジェクト: ev3osek/ev3osek
/**
 * \brief   Boot strap function which enables the PLL(s) and PSC(s) for basic
 *          module(s)
 *
 * \param   none
 *
 * \return  None.
 * 
 * This function is the first function that needs to be called in a system.
 * This should be set as the entry point in the linker script if loading the
 * elf binary via a debugger, on the target. This function never returns, but
 * gives control to the application entry point
 **/
unsigned int start_boot(void) 
{

    /* Enable write-protection for registers of SYSCFG module. */
    SysCfgRegistersLock();

    /* Disable write-protection for registers of SYSCFG module. */
    SysCfgRegistersUnlock();

    PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_UART2, 0, PSC_MDCTL_NEXT_ENABLE);

    PSCModuleControl(SOC_PSC_0_REGS, HW_PSC_AINTC, 0, PSC_MDCTL_NEXT_ENABLE);
    /* Initialize the vector table with opcodes */
    CopyVectorTable();

   /* Calling the main */
    main();

    while(1);
}