mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
init cleanup: use irq stack during early init
No functionality changed. Clean up only. Make early init code (Reset_Handler) use the existing irq stack rather than the hard-coded one. Remove (now) unused references to the hard-coded stack. Removed the link-time check for a minimal task stack in RAM since FreeRTOS allocates user stacks from the heap which is already reserved in the .bss section (as symbol xHeap). git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@756 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
90f9e6d309
commit
8b5e1e8aea
@ -36,37 +36,12 @@ MEMORY
|
||||
EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
}
|
||||
|
||||
/* higher address of the user mode stack */
|
||||
_estack = 0x20010000;
|
||||
|
||||
/* This is the size of the stack for early init and for all FreeRTOS IRQs */
|
||||
_irq_stack_size = 0x400;
|
||||
|
||||
/* default stack sizes.
|
||||
|
||||
These are used by the startup in order to allocate stacks for the different modes.
|
||||
|
||||
Note: FreeRTOS gives each task an own stack
|
||||
*/
|
||||
|
||||
__Stack_Size = 128 ;
|
||||
|
||||
PROVIDE ( _Stack_Size = __Stack_Size ) ;
|
||||
|
||||
__Stack_Init = _estack - __Stack_Size ;
|
||||
|
||||
/*"PROVIDE" allows to easily override these values from an object file or the commmand line.*/
|
||||
PROVIDE ( _Stack_Init = __Stack_Init ) ;
|
||||
|
||||
/*
|
||||
There will be a link error if there is not this amount of RAM free at the end.
|
||||
*/
|
||||
_Minimum_Stack_Size = 0x100 ;
|
||||
|
||||
/* Check valid alignment for VTOR */
|
||||
ASSERT(ORIGIN(FLASH) == ALIGN(ORIGIN(FLASH), 0x80), "Start of memory region flash not aligned for startup vector table");
|
||||
|
||||
|
||||
/*
|
||||
this sends all unreferenced IRQHandlers to reset
|
||||
*/
|
||||
@ -317,23 +292,6 @@ SECTIONS
|
||||
PROVIDE ( end = _ebss );
|
||||
PROVIDE ( _end = _ebss );
|
||||
|
||||
/* This is the user stack section
|
||||
This is just to check that there is enough RAM left for the User mode stack
|
||||
It should generate an error if it's full.
|
||||
*/
|
||||
._usrstack :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_susrstack = . ;
|
||||
|
||||
. = . + _Minimum_Stack_Size ;
|
||||
|
||||
. = ALIGN(4);
|
||||
_eusrstack = . ;
|
||||
} >RAM
|
||||
|
||||
|
||||
|
||||
/* this is the FLASH Bank1 */
|
||||
/* the C or assembly source must explicitly place the code or data there
|
||||
using the "section" attribute */
|
||||
|
@ -69,7 +69,7 @@ Reset_Handler:
|
||||
required, then adjust the Register Addresses */
|
||||
bl SystemInit_ExtMemCtl
|
||||
/* restore original stack pointer */
|
||||
LDR r0, =_estack
|
||||
LDR r0, =_irq_stack_top
|
||||
MSR msp, r0
|
||||
/* Copy the data segment initializers from flash to SRAM */
|
||||
movs r1, #0
|
||||
|
Loading…
x
Reference in New Issue
Block a user