- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
for a project with a CY8Y5856 with a display I need to store lots of text to be displayed.
How can I put the text into the program memory so that it does not waste RAM?
The text should be stored in a struct or at least in an array.
Best regards,
Günter
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How many bytes you are looking to store?
odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
for PSoC3 I use the following:
const uint8 code TestStr[1024]={0};
for PSoC4 and 5 seems to need another ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
there will be about 400 "strings" of 20 bytes each (several languages on the display).
It seems that the "const" keyword does the job for PSoC5LP.
Thanks,
Günter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re the ARM compilers -
I would have liked to see a different solution like a "flash" qualifier, but GCC developers have choosen a different solution. Now the "const" qualifier has two different meanings depending on the context it appears.
Used in a parameter-list the consequences are: the parameter will not be modified by a direct assignment.
Used in a variable declaration and followed by an initialization the variable will be put into the code area which will be flash memory in all embeddeds.
This improvement is not ARM specific but works in GCC generally.
http://www.keil.com/support/docs/2829.htm Abs variable location Keil and ARM GCC
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually its not really something gcc invented. The different meanings of const are defined in the C / C++ standards. Its merely an optimization gcc can do that const strings / fields can be put to flash memory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hli, can you point put where in the standard const adresses storage class ?
I cannot seem to find it.
http://www.open-std.org/jtc1/sc22/wg14/www/standards.html#9899
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Like I said, the C/C++ standard addresses the different semantics of const (namely that the affected variable / field is not to be modified, and depending on context is either a requirement or a guarantee).
GCC (when compiling for embedded environments) uses this information to handle variable placement in flash or volatile memory. So in that sense GCC has added an additional meaning to const, but it still has the other one as before.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Excerpt from AN89610 www.cypress.com/
Bob