13.3.1.  Initialization

The initialization of the code environment and system is almost identical, whether the code is to initialize the debugger only (full Angel) or to launch an application (minimal Angel). The initialization sequence is as follows:

  1. The processor is switched from the current privileged mode to Supervisor mode with interrupts disabled. Angel checks for the presence of an MMU. If an MMU is present it can be initialized after switching to Supervisor mode.

  2. Angel sets the code execution and vector location, depending on the compilation addresses generated by the values of ROADDR and RWADDR. Refer to Configuring where Angel runs for more information.

  3. Code and data segments for Angel are copied to their execution addresses.

  4. If the application is to be executed then the runtime system setup code and the application itself are copied to their execution addresses. If the system has ROM at address 0 and the code is to be run from ROM, only the Data and Zero Initialization areas are copied.

  5. The stack pointers are set up for each processor mode in which Angel operates. Angel maintains control of its own stacks separately from any application stacks. You can configure the location of Angel stacks. Refer to Configuring the memory map for more information.

  6. Target-specific functions such as MMU or Profiling Timer are initialized if they are included in the system.

  7. The Angel serializer is set up. Refer to the Angel task management for more information on the Angel serializer.

  8. The processor is switched to User mode and program execution is passed to the high level initialization code for the C library and Angel C functions.

    When initialization is complete, program execution is directed to the __main entry point.

  9. At this point, the initialization procedure is different for full Angel and minimal Angel.

    For minimal Angel:

    1. The device drivers are set up for transmission of raw data only. The ADP packet protocol and communications channels are not used.

    2. The application entry point is called by a branch with link (BL) instruction to an __entry label. You must use this label as your application entry point to ensure that the application is launched.

    For full Angel:

    1. The communications channels are initialized for ADP.

    2. Any raw data channels installed for the application are set up if you are using extra channels. The application can set this up itself. Refer to the Angel source code for details.

    3. Full Angel transmits its boot message through the boot task and waits for communication from the debugger.

Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0040D
Non-Confidential