From 1c1d5129c5d0aa9c52c236f96003aee04cc03d9e Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 9 Feb 2009 22:18:39 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@751 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- ports/ARM7/port.dox | 8 ++++---- ports/ARMCM3/port.dox | 46 +++++++++++++++++++++++++++++++++++++++++++ readme.txt | 2 +- 3 files changed, 51 insertions(+), 5 deletions(-) diff --git a/ports/ARM7/port.dox b/ports/ARM7/port.dox index 016d2aceb..f73b85875 100644 --- a/ports/ARM7/port.dox +++ b/ports/ARM7/port.dox @@ -149,13 +149,13 @@ * *

Startup Process

* The startup process, as implemented, is the following: - * -# Initialize the various stacks assigning them the sizes defined in the + * -# The stacks are initialized by assigning them the sizes defined in the * linker script (usually named @p ch.ld). Stack areas are allocated from * the highest RAM location downward. * -# The ARM state is switched to System with both IRQ and FIQ sources * disabled. - * -# An early initialization routine @p hwinit0 is invoked, if the symbol not - * defined then an empty default routine is executed (weak symbol). + * -# An early initialization routine @p hwinit0 is invoked, if the symbol is + * not defined then an empty default routine is executed (weak symbol). * -# DATA and BSS segments are initialized. * -# A late initialization routine @p hwinit1 is invoked, if the symbol not * defined then an empty default routine is executed (weak symbol).
@@ -175,7 +175,7 @@ * - @p __fiq_stack_size__ FIQ service stack size. * - @p __irq_stack_size__ IRQ service stack size. * - @p __svc_stack_size__ SVC service stack size. - * - @p __sys_stack_size__ System/User stack size. This is the stack used + * - @p __sys_stack_size__ System/User stack size. This is the stack area used * by the @p main() function. * - @p _textdata address of the data segment source read only data. * - @p _data data segment start location. diff --git a/ports/ARMCM3/port.dox b/ports/ARMCM3/port.dox index ba4111aed..888f58388 100644 --- a/ports/ARMCM3/port.dox +++ b/ports/ARMCM3/port.dox @@ -105,6 +105,52 @@ */ /** @} */ +/** + * @defgroup ARMCM3_STARTUP Startup Support + * @{ + * @brief ARM Cortex-M3 startup code support. + * @details ChibiOS/RT provides its own generic startup file for the ARM + * Cortex-M3 port. + * Of course it is not mandatory to use it but care should be taken about the + * startup phase details. + * + *

Startup Process

+ * The startup process, as implemented, is the following: + * -# Interrupts are masked globally. + * -# The two stacks are initialized by assigning them the sizes defined in the + * linker script (usually named @p ch.ld). Stack areas are allocated from + * the highest RAM location downward. + * -# An early initialization routine @p hwinit0 is invoked, if the symbol is + * notdefined then an empty default routine is executed (weak symbol). + * -# DATA and BSS segments are initialized. + * -# The CPU state is switched to Privileged and the PSP stack is used. + * -# A late initialization routine @p hwinit1 is invoked, if the symbol not + * defined then an empty default routine is executed (weak symbol).
+ * This late initialization function is also the proper place for a + * @a bootloader, if your application requires one. + * -# The @p main() function is invoked with the parameters @p argc and @p argv + * set to zero. + * -# Should the @p main() function return a branch is performed to the weak + * symbol MainExitHandler. The default code is an endless empty loop. + * . + *

Expected linker symbols

+ * The startup code starts at the symbol @p ResetHandler and expects the + * following symbols to be defined in the linker script: + * - @p __ram_end__ RAM end location +1. + * - @p __main_stack_size__ Exception stack size. + * - @p __process_stack_size__ Process stack size. This is the stack area used + * by the @p main() function. + * - @p _textdata address of the data segment source read only data. + * - @p _data data segment start location. + * - @p _edata data segment end location +1. + * - @p _bss_start BSS start location. + * - @p _bss_end BSS end location +1. + * . + * @ingroup ARMCM3 + * @file ports/ARMCM3/crt0.s Startup code. + */ +/** @} */ + /** * @defgroup ARMCM3_NVIC NVIC Support * @{ diff --git a/readme.txt b/readme.txt index 00dbb7a2c..307e98c29 100644 --- a/readme.txt +++ b/readme.txt @@ -123,7 +123,7 @@ Win32-MinGW - ChibiOS/RT simulator and demo into a WIN32 process, - Improved ARM7 and Cortex-M3 support, new configuration options. - Introduced the concept of interrupt classes, see the documentation. - Introduced the concept of system states, see the documentation. -- Huge improvements to the ports documentation. +- Huge improvements to the documentation. - Articles and notes previously in the wiki now merged in the general documentation and updated, the wiki entries are obsolete and will be removed. - New application notes and articles added.