From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8823 invoked by alias); 1 Mar 2013 09:30:28 -0000 Received: (qmail 8812 invoked by uid 22791); 1 Mar 2013 09:30:28 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from tetra.codeconfidence.com (HELO tetra.codeconfidence.com) (94.229.66.225) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Mar 2013 09:30:18 +0000 Received: from cog.dallaway.org.uk (cpc1-cmbg10-0-0-cust34.5-4.cable.virginmedia.com [81.102.132.35]) by tetra.codeconfidence.com (Postfix) with ESMTP id B5B55234C03E; Fri, 1 Mar 2013 09:30:17 +0000 (GMT) Received: from cog.dallaway.org.uk (cog.dallaway.org.uk [127.0.0.1]) by cog.dallaway.org.uk (8.13.8/8.13.8) with ESMTP id r219UHpe001101; Fri, 1 Mar 2013 09:30:17 GMT Message-ID: <51307529.4010603@dallaway.org.uk> Date: Fri, 01 Mar 2013 09:30:00 -0000 From: John Dallaway User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.11) Gecko/20121120 Thunderbird/10.0.11 MIME-Version: 1.0 To: Michael Jones CC: eCos Discussion References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: [ECOS] Re: Kinetis heap size? X-SW-Source: 2013-03/txt/msg00001.txt.bz2 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