This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi Sir,
When using FR5949, for some special reason, need to use FRAM >0x10000 to store customer data. At the same time, they don't want to these data be erased every time enter in debugging, even in first programming, they don't need to load data to address >0x10000
Would you please tell how to configure in IAR to realize this function?
Best regards
Jacky Xu
Hi Jacky,
For this case, you want to use the __no_init compiler attribute where the variables are declared. In the IAR environment, the standard default linker command file places __no_init variables into SRAM. You can force the toolchain's hand a bit by creating a custom linker file, by using the directive #pragma location, or by using the '@' operator.
For example, let's say you had an array of unsigned 16-bit words that you wanted placed into FRAM, and you didn't want the values to be initialized to anything both when a new program is downloaded and when the device goes through boot-up and runs CINIT. The simplest way to get there in IAR is to initialize the array like this:
//! g_ui16DataBlock[256] //! Global variable located in FRAM info memory at 0x01800 //! Not initialized by program download or by boot-up cinit execution //! __no_init uint16_t g_ui16DataBlock[256] @ 0x01800;
Here are some reference documents for you to use:
IAR Embedded Workbench MSP430 Compiler User's Guide
See "DATA PLACEMENT AT AN ABSOLUTE LOCATION" on page 235 of the current version
In addition to configuring the variables, you will also need to ensure that the memory protection unit (MPU) is set up correctly to allow read and write access to the memory area you want to work with.
Best regards,
Walter
**Attention** This is a public forum