Content originally posted in LPCWare by RolandWOW on Mon Apr 08 00:22:26 MST 2013
I try to maintain an absolute readonly section in FLASH with LPC1111/201.
Using 0X1000 as --section-start=READONLY=... it works after downloading via debugger, with 0X1F00, however, I find the previous contents in FLASH. The hex-files seem to be always correct.
I prepared a minimal program, which listed subsequently. Linker settings are -nostdlib and --section-start=READONLY=0X... .
<<<<<<<<<<<<<<<<<<<<<<<<<<<< almaty.c >>>>>>>>>>>>>>>>>>>>
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]extern
[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]
[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2] [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] almaty[4];[/SIZE]
[SIZE=2]
[/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]
/* Main Program */
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]
int
[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]
[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2] [B]main[/B] ([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]void[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2]
{
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] almaty[0];[/SIZE]
[SIZE=2]
}
<<<<<<<<<<<<<<<<<<<<<< data.c >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]#include
[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]
[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]<stdint.h>[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]
[/SIZE][SIZE=2][COLOR=#005032][SIZE=2][COLOR=#005032]
uint32_t
[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2] [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]__attribute__[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ((section ([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"READONLY"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]))) almaty[4]={ 1, 2, 3, 4,};[/SIZE]
[SIZE=2][/SIZE][/SIZE]