placing data into program memory

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
davet
Posts: 27
Joined: Mon Jun 11, 2012 11:08 am
Been thanked: 1 time

placing data into program memory

Post by davet »

Hi all!

I want to place some data in program memory. At the moment I am using:

signed char states[]={,,,,,,,,} which uses ram.

How can I put this in program memory? I have tried by writing "rom signed char states[]={,,,,,,,,} but this does not work!

Flowcode 5 uses boost c.

Can anyone help?
Thanks

Dave

Flowcode v5 User

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: placing data into program memory

Post by Enamul »

Hi,
I have found a function to do that..you can have play..

Memory mapped functions
Functions just as variables can be forced to be placed at certain addresses. Syntax
is the same as in the legacy C2C compiler:
void foo() @ <addr>;
where <addr> is an hex or decimal address.
//This function placed at address 0x100
void foo1() @ 0x100
{
...
}
In most cases there is no need to use memory mapped functions as linker will
analyze the code and optimize function allocation. Only very special occasions
require this feature.

You have to put the function in ....>V5>Tools>boostc>include>boostc.h

Enamul
Enamul
University of Nottingham
enamul4mm@gmail.com

Post Reply