[arm-gnu] Placing variable at absolute address in RAM

JM hondgm at yahoo.com
Thu Apr 5 14:02:47 UTC 2012





________________________________
 From: Tom Evans <tom_usenet at optusnet.com.au>
To: JM <hondgm at yahoo.com> 
Cc: "arm-gnu at codesourcery.com" <arm-gnu at codesourcery.com> 
Sent: Thursday, April 5, 2012 1:24 AM
Subject: Re: [arm-gnu] Placing variable at absolute address in RAM
 
>JM wrote:
> >Hello
> >
> >I've researched this, asked on other forums, and so far I'm no closer.  
>> I'm trying to place a variable at a specific address in RAM on a TI ARM Cortex-M3.  I have good reason for doing so, which I can explain briefly:

>How about just calling malloc() in a loop until you get an allocation that matches all of your addressing requirements, and then free all the ones that didn't. Brutal, but it should work if called >very early on in your startup before anything else has got to malloc().

>If you don't have "malloc" then you should have something similar managing your heap that could be abused to do this for you.

>Tom

Intriguing idea, but I actually do not use malloc, but rather a replacement I wrote that simply allocates RAM in consecutive chunks of the requested size.  I found malloc was wasting a few kilobytes of RAM so I did it this way.  If I did this in my case, it would leave 400-500 bytes unused. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/arm-gnu/attachments/20120405/36d89492/attachment.html>


More information about the arm-gnu mailing list