I am trying to figure out how the heap size for kinetis K60 is set.

There is a memory layout like below. From my limited knowledge, it appears that 
the heap is not in a memory section, but instead a fixed size memory in some 
other section.

What I can't figure out is where the memory size is defined and how to control 
it. Also, whether mallinfo(...) will return the value of the allocated space or 
some other value. Basically I want to make it bigger, and to be sure that the 
amount of heap available reported by mallinfo is correct.

Does anybody know how this works and what files define this? I spend a lot of 
time with find/grep and came up empty.

Mike

// eCos memory layout

#ifndef __ASSEMBLER__
#include <cyg/infra/cyg_type.h>
#include <stddef.h>

#endif
#define CYGMEM_REGION_ram (0x20000000 - CYGHWR_HAL_KINETIS_SRAM_BANK_SIZE)
#define CYGMEM_REGION_ram_SIZE 
(CYGHWR_HAL_KINETIS_SRAM_SIZE-CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE)
#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)

#define CYGMEM_REGION_flash (0x00000000)
#define CYGMEM_REGION_flash_SIZE (CYGHWR_HAL_KINETIS_FLASH_SIZE)
#define CYGMEM_REGION_flash_ATTR (CYGMEM_REGION_ATTR_R)

#ifndef __ASSEMBLER__
extern char CYG_LABEL_NAME (__heap1) [];
#endif
#define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
#define CYGMEM_SECTION_heap1_SIZE (CYGMEM_REGION_ram+CYGMEM_REGION_ram_SIZE - 
(size_t) CYG_LABEL_NAME (__heap1))

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Reply via email to