Page 1 of 1

placing data into program memory

Posted: Tue Jul 10, 2012 2:05 pm
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

Re: placing data into program memory

Posted: Tue Jul 10, 2012 4:14 pm
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