Mistake on this page?
Report an issue in GitHub or email us
Functions
Boot sequence

Boot sequence overview. More...

Functions

void mbed_init (void)
 Perform low level init of mbed. More...
 
void mbed_start (void)
 Start the main mbed application. More...
 
void mbed_rtos_init (void)
 Perform low level initialization of the RTOS. More...
 
MBED_NORETURN void mbed_rtos_start (void)
 Start the RTOS. More...
 
void mbed_toolchain_init (void)
 Perform toolchain specific initialization. More...
 
void mbed_sdk_init (void)
 SDK hook for running code before ctors or OS. More...
 
void mbed_main (void)
 Application hook for running code before main. More...
 

Detailed Description

Boot sequence overview.

  1. Setup target
    • Configure clocks
    • Configure watchdog (if applicable)
    • Turn on RAM (if applicable)
    • Jump to setup toolchain
  2. Setup toolchain
    • Initialize RAM
    • Initialize standard library
    • Call mbed_init
    • jump to start rtos
  3. Start RTOS
    • Create main thread
    • Start scheduler
    • main thread calls start mbed
  4. Start mbed
    • Call mbed_main
    • Call main

Function Documentation

void mbed_init ( void  )

Perform low level init of mbed.

The toolchain calls this function as part of the boot sequence. This function does the following:

  • Sets up NVIC so interrupts can be used
  • Calls into the vendor SDK so it can be used
  • Initializes the RTOS so it can be used

Preconditions:

  • Target is initialized
  • Ram is initialized
  • value set for mbed_heap_start
  • value set for mbed_heap_size
  • value set for mbed_stack_isr_start
  • value set for mbed_stack_isr_size

The following events must not have happened yet:

  • global constructors must not be called yet
void mbed_main ( void  )

Application hook for running code before main.

This is a weak function which can be overridden by an application to allow code to run before main is called.

Preconditions:

  • The RTOS has been started by a call to mbed_rtos_start
  • The toolchain has been initialized by a call to mbed_toolchain_init
void mbed_rtos_init ( void  )

Perform low level initialization of the RTOS.

Set the RTOS to a known state but don't start the scheduler. After the RTOS has been initialized it is safe to create RTOS primitives for file locks or other purposes.

Preconditions:

  • Ram is initialized
  • NVIC is setup
  • Vendor SDK must be initialized by a call to mbed_sdk_init
MBED_NORETURN void mbed_rtos_start ( void  )

Start the RTOS.

Start the RTOS scheduler and call mbed_start on the main thread. This function does not return.

Preconditions:

  • RTOS has been initialized by a call to mbed_rtos_init
void mbed_sdk_init ( void  )

SDK hook for running code before ctors or OS.

This is a weak function which can be overridden by a target's SDK to allow code to run after ram is initialized but before the OS has been started or constructors have run.

Preconditions:

  • Ram is initialized
  • NVIC is setup
void mbed_start ( void  )

Start the main mbed application.

This is the last stage of the boot sequence. This function must be called only after the RTOS has been fully initialized. This function does the following:

  • Initialize the toolchain
  • Run mbed_main
  • Run main

Preconditions:

  • The RTOS has been started by a call to mbed_rtos_start
void mbed_toolchain_init ( void  )

Perform toolchain specific initialization.

Initialize locks if this has not been done already and call global C++ constructors.

Preconditions:

  • The RTOS has been started by a call to mbed_rtos_start
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.