You can put the const keyword in front of your definition of the string.
Example:
#include <stdio.h>
const char stringInFlash[] = "Hello world, this string is in flash memory!";
int main(void)
{
printf("%s", stringInFlash);
return 0;
}
This is just an example of course, your MSP430 won't really be able to printf
unless you have done something special.
Note also that you can't modify the string directly in flash since it is read
only. You would need to copy it into a ram buffer to do that.
I hope that helps you out.
- Wayne
-----Original Message-----
From: Kasun Hewage [mailto:[email protected]]
Sent: Wednesday, 25 March 2009 2:20 AM
To: MSPGCC-Users
Subject: [Mspgcc-users] Loading data directly from flash without loadingthem
into RAM first
Hello,
I am using MSP430F1612 and writing a program which manipulates
strings. I think it is better to load the strings directly from flash
without loading them into RAM first to save the RAM space. Is there
any mechanism to do that? Any suggestions? I am sorry if this question
has been answered previously.
Thank you.
Best Regards,
--
..:: කසුන් චන්ද්රනාත් ::..
..:: Kasun Chandranath ::..
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users