Content originally posted in LPCWare by skeeve on Mon Jun 24 15:34:14 MST 2013
Quote: mvinger
I thought putting the following would create a 64-byte block (1 page) in FLASH.
It does not seem to always work.
[SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][B]const[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#005032][SIZE=2][COLOR=#005032]uint32_t[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] FLASHPAGE[16] [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]__attribute__[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] ((aligned (64)))[/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]
[/COLOR][/SIZE][/COLOR][/SIZE]
I'm surprised it ever works.
Probably you need to specify a section attribute that will place it in a flash section.
Also, you need at most one of those zeros.
The rest will default to zero.