Content originally posted in LPCWare by OldManVimes on Mon Aug 04 05:04:05 MST 2014
I currently do not have access to an instance of LPCXpresso, so I'm commenting of the top of my head.
Possible issue:
The 'linker section' named "Flash" does not exist. Therefore the linker will not include the array in the binary. If you use managed linker scripts, then look at the device specific settings in the project settings.
Tip: If you generate a .map file after linking, then you can check the location for the array in the image. This is a very useful tool and .map files are easy to read.
Alternative coding style:
static const char data[] = { /* data */ };
The 'static' is probably optional, but useful. The point is that making an array 'const' will ensure it is placed in the .rodata section by the linker. So if you have no requirement for a specific location within flash memory, then there is no need for the section specifier.
For shits and giggles:
static char data[] = { /* non zero data */ };
What happens now is that the linker places the array in the .data section. It still gets added to flash, but the start-up code will copy it from flash to RAM. That last step is not done when data is const.
Hope this helps and that I haven't provided any false information (since I am unable to fact check this post at the moment).