Content originally posted in LPCWare by Mile on Fri Sep 19 01:59:16 MST 2014
I have to set a fixed flash address initialized to a fixed value.
This process must be done when Code is being compiled.
I set flash as follows:
MEMORY
{
/* Define each memory region */
MFlash128 (rx) : ORIGIN = 0x0, LENGTH = 0x1dff0 /* 119k */
BootLoaderFlag (rx) : ORIGIN = 0x1fff0, LENGTH = 0x20000 /* 128k */
RamLoc16 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x4000 /* 16k */
RamAHB16 (rwx) : ORIGIN = 0x2007c000, LENGTH = 0x4000 /* 16k */
}
and my code is :
#pragma DATA_SECTION(FlashKeyword, "BootLoaderFlag");
const uint16_t FlashKeyword[1] = {0x6DA};
int main(void)
{
fp32 f32Value = 0;
f32Value = 0;
uint16_t u16Value = 0 ;
uint16_t *pTest = 0x1fff0;
u16Value = *pTest;
}
u16Value is 65535 not 0x6DA.
I have to set a fixed flash address initialized to a fixed value when Code is being compiled.
what should I do? How to accomplish this function in LPCXpresso?
My LPCXpresso Version is : LPCXpresso v5.2.4 [Build 2122] [2013-04-29]