Keil Logo


4.55 __vectab_stack_and_reset

__vectab_stack_and_reset is a library section that provides a way for the initial values of sp and pc to be placed in the vector table, starting at address 0 for M-profile processors, such as Cortex-M1 and Cortex-M3 embedded applications.

__vectab_stack_and_reset requires the existence of a main() function in your source code. Without a main() function, if you place the __vectab_stack_and_reset section in a scatter file, an error is generated to the following effect:
Error: L6236E: No section matches selector - no section to be FIRST/LAST
If the normal start-up code is bypassed, that is, if there is intentionally no main() function, you are responsible for setting up the vector table without __vectab_stack_and_reset.
The following segment is part of a scatter file. It includes a minimal vector table illustrating the use of __vectab_stack_and_reset to place the initial sp and pc values at addresses 0x0 and 0x4 in the vector table:
;; Maximum of 256 exceptions (256*4 bytes == 0x400)
VECTORS 0x0 0x400
    ; First two entries provided by library
    ; Remaining entries provided by the user in exceptions.c
    * (:gdef:__vectab_stack_and_reset, +FIRST)
    * (exceptions_area)
    * (+RO)
Related information
Non-ConfidentialPDF file icon PDF versionARM DUI0378H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.