mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			ISR_Stack_start/size defines are not needed, use linker file defines
							parent
							
								
									9d1ce66b14
								
							
						
					
					
						commit
						b36147fbe9
					
				| 
						 | 
				
			
			@ -917,18 +917,12 @@ __asm(".global __use_no_semihosting\n\t");
 | 
			
		|||
#pragma import(__use_two_region_memory)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(ISR_STACK_START)
 | 
			
		||||
extern uint32_t               Image$$ARM_LIB_STACK$$ZI$$Base[];
 | 
			
		||||
extern uint32_t               Image$$ARM_LIB_STACK$$ZI$$Length[];
 | 
			
		||||
#define ISR_STACK_START       Image$$ARM_LIB_STACK$$ZI$$Base
 | 
			
		||||
#define ISR_STACK_SIZE        Image$$ARM_LIB_STACK$$ZI$$Length
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(HEAP_START)
 | 
			
		||||
// Heap here is considered starting after ZI ends to Stack start
 | 
			
		||||
extern uint32_t               Image$$ARM_LIB_STACK$$ZI$$Base[];
 | 
			
		||||
extern uint32_t               Image$$RW_IRAM1$$ZI$$Limit[];
 | 
			
		||||
#define HEAP_START            Image$$RW_IRAM1$$ZI$$Limit
 | 
			
		||||
#define HEAP_SIZE             ((uint32_t)((uint32_t)ISR_STACK_START - (uint32_t)HEAP_START))
 | 
			
		||||
#define HEAP_SIZE             ((uint32_t)((uint32_t) Image$$ARM_LIB_STACK$$ZI$$Base - (uint32_t) HEAP_START))
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define HEAP_LIMIT            ((uint32_t)((uint32_t)HEAP_START + (uint32_t)HEAP_SIZE))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -27,18 +27,14 @@
 | 
			
		|||
__value_in_regs struct __argc_argv __rt_lib_init(unsigned heapbase, unsigned heaptop);
 | 
			
		||||
void _platform_post_stackheap_init(void);
 | 
			
		||||
 | 
			
		||||
#if !defined(ISR_STACK_START)
 | 
			
		||||
extern uint32_t               Image$$ARM_LIB_STACK$$ZI$$Base[];
 | 
			
		||||
extern uint32_t               Image$$ARM_LIB_STACK$$ZI$$Length[];
 | 
			
		||||
#define ISR_STACK_START       Image$$ARM_LIB_STACK$$ZI$$Base
 | 
			
		||||
#define ISR_STACK_SIZE        Image$$ARM_LIB_STACK$$ZI$$Length
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(HEAP_START)
 | 
			
		||||
// Heap here is considered starting after ZI ends to Stack start
 | 
			
		||||
extern uint32_t               Image$$RW_IRAM1$$ZI$$Limit[];
 | 
			
		||||
#define HEAP_START            Image$$RW_IRAM1$$ZI$$Limit
 | 
			
		||||
#define HEAP_SIZE             ((uint32_t)((uint32_t)ISR_STACK_START - (uint32_t)HEAP_START))
 | 
			
		||||
#define HEAP_SIZE             ((uint32_t)((uint32_t)Image$$ARM_LIB_STACK$$ZI$$Base - (uint32_t)HEAP_START))
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
| 
						 | 
				
			
			@ -58,10 +54,10 @@ extern uint32_t               Image$$RW_IRAM1$$ZI$$Limit[];
 | 
			
		|||
 */
 | 
			
		||||
void __rt_entry(void)
 | 
			
		||||
{
 | 
			
		||||
    mbed_stack_isr_start = (unsigned char *)ISR_STACK_START;
 | 
			
		||||
    mbed_stack_isr_size = (uint32_t)ISR_STACK_SIZE;
 | 
			
		||||
    mbed_heap_start = (unsigned char *)HEAP_START;
 | 
			
		||||
    mbed_heap_size = (uint32_t)HEAP_SIZE;
 | 
			
		||||
    mbed_stack_isr_start = (unsigned char *) Image$$ARM_LIB_STACK$$ZI$$Base;
 | 
			
		||||
    mbed_stack_isr_size = (uint32_t) Image$$ARM_LIB_STACK$$ZI$$Length;
 | 
			
		||||
    mbed_heap_start = (unsigned char *) HEAP_START;
 | 
			
		||||
    mbed_heap_size = (uint32_t) HEAP_SIZE;
 | 
			
		||||
 | 
			
		||||
    mbed_init();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -40,34 +40,18 @@
 | 
			
		|||
 * Memory layout notes:
 | 
			
		||||
 * ====================
 | 
			
		||||
 *
 | 
			
		||||
 * IAR Default Memory layout notes:
 | 
			
		||||
 * -Heap defined by "HEAP" region in .icf file
 | 
			
		||||
 * -Interrupt stack defined by "CSTACK" region in .icf file
 | 
			
		||||
 * -Value INITIAL_SP is ignored
 | 
			
		||||
 * IAR Memory layout :
 | 
			
		||||
 * - Heap defined by "HEAP" region in .icf file
 | 
			
		||||
 * - Interrupt stack defined by "CSTACK" region in .icf file
 | 
			
		||||
 * - Value INITIAL_SP is ignored
 | 
			
		||||
 *
 | 
			
		||||
 * IAR Custom Memory layout notes:
 | 
			
		||||
 * -There is no custom layout available for IAR - everything must be defined in
 | 
			
		||||
 *      the .icf file and use the default layout
 | 
			
		||||
 * GCC Memory layout :
 | 
			
		||||
 * - Heap explicitly placed in linker script (*.ld file) and heap start (__end___) and heap end (__HeapLimit) should be defined in linker script
 | 
			
		||||
 * - Interrupt stack placed in linker script **.ld file) and stack start (__StackTop) and stack end (__StackLimit) should be defined in linker script
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * GCC Default Memory layout notes:
 | 
			
		||||
 * -Block of memory from symbol __end__ to define INITIAL_SP used to setup interrupt
 | 
			
		||||
 *      stack and heap in the function set_stack_heap()
 | 
			
		||||
 * -ISR_STACK_SIZE can be overridden to be larger or smaller
 | 
			
		||||
 *
 | 
			
		||||
 * GCC Custom Memory layout notes:
 | 
			
		||||
 * -Heap can be explicitly placed by defining both HEAP_START and HEAP_SIZE
 | 
			
		||||
 * -Interrupt stack can be explicitly placed by defining both ISR_STACK_START and ISR_STACK_SIZE
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * ARM Memory layout
 | 
			
		||||
 * -Block of memory from end of region "RW_IRAM1" to define INITIAL_SP used to setup interrupt
 | 
			
		||||
 *      stack and heap in the function set_stack_heap()
 | 
			
		||||
 * -ISR_STACK_SIZE can be overridden to be larger or smaller
 | 
			
		||||
 *
 | 
			
		||||
 * ARM Custom Memory layout notes:
 | 
			
		||||
 * -Heap can be explicitly placed by defining both HEAP_START and HEAP_SIZE
 | 
			
		||||
 * -Interrupt stack can be explicitly placed by defining both ISR_STACK_START and ISR_STACK_SIZE
 | 
			
		||||
 * ARM Memory layout :
 | 
			
		||||
 * - Heap can be explicitly placed by adding ARM_LIB_HEAP section in scatter file and defining both HEAP_START and HEAP_SIZE
 | 
			
		||||
 * - Interrupt stack placed in scatter files (*.sct) by adding ARM_LIB_STACK section
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -24,11 +24,9 @@
 | 
			
		|||
    extern uint32_t Image$$ARM_LIB_STACK$$Base[];
 | 
			
		||||
    extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Limit[];
 | 
			
		||||
    extern uint32_t Image$$ARM_LIB_HEAP$$Base[];
 | 
			
		||||
    #define ISR_STACK_START       Image$$ARM_LIB_STACK$$Base
 | 
			
		||||
    #define ISR_STACK_SIZE        (uint32_t)((uint32_t)Image$$ARM_LIB_STACK$$ZI$$Limit - (uint32_t)Image$$ARM_LIB_STACK$$Base)
 | 
			
		||||
    #define INITIAL_SP            Image$$ARM_LIB_STACK$$ZI$$Limit
 | 
			
		||||
    #define HEAP_START            Image$$ARM_LIB_HEAP$$Base
 | 
			
		||||
    #define HEAP_SIZE             (uint32_t)((uint32_t)ISR_STACK_START - (uint32_t)HEAP_START)
 | 
			
		||||
    #define HEAP_SIZE             (uint32_t)((uint32_t) Image$$ARM_LIB_STACK$$Base - (uint32_t) HEAP_START)
 | 
			
		||||
#elif defined(__GNUC__)
 | 
			
		||||
    #define INITIAL_SP            (&__StackTop)
 | 
			
		||||
#elif defined(__ICCARM__)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue