- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to store a 10 bit sine table in the flash during programming and access it during runtime. How to go about this?
Please provide relevant information and resources related to flash IO
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Easiest solution:
static const int16 SineTable[NumEntries] = {0,2, and so on };
This will be put into flash because of the "static const" and the initialization. Both are required.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok now it's getting slightly unclear. (M new to programming, please bear)
If declaring and initializing a constant string stores the value in the flash, why do we need dedicated API functions for the same. I think I came across something like "CYC_Read or CYC_write" not exactly the same, but similar.
App notes are in bits and pieces for learning the basics.
Please suggest a good book on ARM programming in C using the GCC standard library. I can't find one after searching a lot.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I only know of the GCC documentation which explains things that are special to ARM in some chapters. This is not a PSoC special function, but implemented by Gnu C.
The different methods are not the "same", my suggestion does not store the table on a specific address which can be done using one of the other approaches.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
flash based constant tables are your best friend. we do a lot of look-up tables, xml definition files, character to pixel tables, translate tables with function pointers etc. all in flash.
like Bob said you have to do static and const (and for pointers even more const) in your definitions to make the compiler save it all in flash. the default action is to save it in flash but at start-up copy into ram, which you don't want unless it has to be capable of modification.
declare your stuff, then look on the .map file to make sure it is stored in flash.
Ed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please could you provide me a link to the GCC Compiler documentation...
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you!