diff --git a/cpu/lpc2387/include/cpu_conf.h b/cpu/lpc2387/include/cpu_conf.h index ad6699259d..1c72db1e7c 100644 --- a/cpu/lpc2387/include/cpu_conf.h +++ b/cpu/lpc2387/include/cpu_conf.h @@ -83,6 +83,12 @@ extern unsigned __stack_irq_size; #define ISR_STACKSIZE ((unsigned) &__stack_irq_size) /** @} */ +/** + * @brief The CPU has 4 blocks of SRAM at different addresses. + * (primary RAM, USB RAM, Ethernet RAM & Backup RAM) + */ +#define NUM_HEAPS (4) + #ifdef __cplusplus } #endif diff --git a/cpu/lpc2387/ldscripts/lpc2387.ld b/cpu/lpc2387/ldscripts/lpc2387.ld index 8e266b5538..6619f571db 100644 --- a/cpu/lpc2387/ldscripts/lpc2387.ld +++ b/cpu/lpc2387/ldscripts/lpc2387.ld @@ -175,10 +175,10 @@ SECTIONS _sram = ORIGIN(ram); _eram = ORIGIN(ram) + LENGTH(ram); - __heap2_size = LENGTH(ram_ethernet); - .heap2 (NOLOAD) : + .heap1 ALIGN(4) (NOLOAD) : { - PROVIDE(__heap2_start = . ); + _sheap1 = ORIGIN(ram_ethernet); + _eheap1 = ORIGIN(ram_ethernet) + LENGTH(ram_ethernet); } > ram_ethernet . = ORIGIN(ram_usb); @@ -187,12 +187,11 @@ SECTIONS *(.usbdata) } > ram_usb - .heap3 ALIGN(0x1000) (NOLOAD) : + .heap2 ALIGN(4) (NOLOAD) : { - __heap3_size = ORIGIN(ram_usb) + LENGTH(ram_usb) - ABSOLUTE(.); - PROVIDE(__heap3_start = . ); + _sheap2 = . ; + _eheap2 = ORIGIN(ram_usb) + LENGTH(ram_usb); } > ram_usb - __heap_size = SIZEOF(.heap3); _sbackup_data_load = LOADADDR(.backup.data); .backup.data : ALIGN(4) { @@ -210,4 +209,9 @@ SECTIONS /* Round size so that we can use 4 byte copy in init */ . = ALIGN(4); } > ram_battery + + .heap3 (NOLOAD) : ALIGN(4) { + _sheap3 = . ; + _eheap3 = ORIGIN(ram_battery) + LENGTH(ram_battery); + } > ram_battery }