A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
@ANN can you specify your requirements in more detail? Are the array contents defined at compile time (const) or do you wish to change the array contents at run time? How big is the array, how big is your code, which device will you be using? Is it possible for reset or power down to occur while changing the array? If so can you live with the array being lost -- if not you will need to keep copies of flash pages before erasing pages and be able to detect and fix broken array at start up.
As you can see there are a lot of unknowns so you need to provide the detail
The question was how to locate an array into flash; ie, how to store the content in flash.
You can't do that just by setting a pointer.
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Posted on May 17, 2011 at 14:26 Agree with Andrew. In IAR and STM32L combination, when the array ws defined with const key word it was placed in RAM. Thanks for replies even though I am wondering how to do that :)
Can you post the code or maybe even the whole project as if the array is of significant size and is const (and not ''volatile'' or ''fast'' etc.) it should really end up in flash not RAM. What Andrew said is that const does not always force const variables to flash but in this case it should allow the compiler to do so unless I don't understand what you are trying to do (hence why you should post the code).