Hi Mike On 28/02/13 06:04, Michael Jones wrote:
> 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. Take a look at the files: hal/cortexm/kinetis/var/current/include/pkgconf/mlt*.ldi Depending on your selection of startup type (CYG_HAL_STARTUP) and possibly other configuration options, one of these files will be processed by the C pre-processor during build to generate the eCos linker script (target.ld). Note that __heap1 is typically defined as a label following the last of the linker output sections in the .ldi files. This is the start address of the heap. So the heap typically occupies the remainder of RAM that the linker has not allocated to code and data. If you want to modify the location of the heap, you will need to edit the .ldi file and possibly also the corresponding .h file (to ensure the heap size calculation is correct). mallinfo() should work as expected. I hope this helps... John Dallaway eCos maintainer http://www.dallaway.org.uk/john -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss