SCIOPTALogo System Software for Safety-Critical Embedded Applications
Copyright
/home/support/articles/system_start
Home
Support
Technical Articles
Boards Presentation
Products Contact Company Support Documentation CPUs
Technical Article
System Start
As in each embedded and real-time system the exact operational sequence of the system start gives repeatedly cause for questions and discussions also with SCIOPTA. In this short article we would like to describe the SCIOPTA system start in detail.
Reset Hook
After system reset the SCIOPTA kernel initializes a small stack and jumps directly into the so-called resethook. The resethook must be written by the user and serves to execute early chip-setup and board-setup functions (e.g. chip selects).

The resethook must be written in assembler as the C-environment is not yet initialized. In every SCIOPTA system the resethook must be present and must be called reset_hook.
The C function prototype is:

int reset_hook (void);

If the user returns a zero (==0) the following C-startup function will be executed. That implies a coldstart.
If the user returns a value not equal than zero (!=0) the following C-startup function (and the starthook) will not be executed and the dispatcher will be called directly. That implies a warmstart.
The resethook is part of the Board Support Packages (BSP).

You can find examples of resethooks in the SCIOPTA BSP deliveries:

...\bsp\<processor>\<cpu>\<board>\src\
C Startup
After returning from the resethook, the kernel checks the returned value and jumps into the C-Startup function if this value was zero. This function is called cstartup (file name: cstartup.S for GNU) and initializes the C system. Initialized data (and poss. code) will be copied into RAM. The file cstartup.S is included in the SCIOPTA delivery.

The file is part of the Board Support Package (BSP) and can be found at:

...\bsp\<processor>\src\
Start Hook
Starthook is a user written function which carries out some system-wide initialization. For instance, some of the delivered SCIOPTA starthook examples are setting-up a simple serial driver.

The starthook can be written in C as the C-environment is already initialized. In every SCIOPTA system the starthook must be present and must be called start_hook.

The C function prototype is:

void start_hook (void);
Start SCIOPTA
After the starthook has been executed, the kernel creates the system module and calls the dispatcher. The process with the highest priority will be swapped-in (the INIT process of the system module) and the SCIOPTA system starts.
SCIOPTA Boot Time
The SCIOPTA kernel is very efficient and highly optimized. The boot time depends of course on the size of the system, the CPU and the clock frequency and on many other external factors but typical boot time of SCIOPTA systems are between a few milliseconds and several hundreds of milliseconds.