Hello, I use keil compiler V7.50 with DS80C400 µC in LARGE memory model. I declare several string constants like this :
const char far image[] = "\x25\x50\x44\x46\x2D\x31\x2E\x34\xD\xA\x25[...] \x30\x34\x38\xD\xA\x25\x25\x45\x4F\x46\xD\xA";
SRC\UTILE.C(255): error C281: illegal hex constant SRC\UTILE.C(255): error C103: '<string>': unclosed string SRC\UTILE.C(256): error C141: syntax error near '42' SRC\UTILE.C(258): error C103: '<string>': unclosed string
SRC\IMAGE.C(360): error C249: '!': SEGMENT TOO LARGE
So, it looks like you're trying to load a static web page into ROM - yes? yes, except that web page are not really static, I use sprintf functions to get them alive Looks like it might be easier to just have a separate utility that create the HEX file directly, and merge that as a post-build operation? Thanks for your suggestion, however I don't think this is the right solution. I use a lots of html files and I have a tool which creates one C file containing all the corresponding vars ; then keil compiler manage to get them at the right memory location automatically. Creating an hex file would mean to handle all the memory organization by hand ... Moreover, I am just doing a product upgrade, the actual product is up and running. the size of my files has slightly increased that's why I discovered this 16kB limit. I can't change everything just because keil doesn't support what it advertises ! Sorry to be a bit crude but as it seems to be the compiler fault it should be solved at compiler level. Regards, Xavier
Are you using an outdated C51 version ? Tried it with C51 V8.01c, here is the result:
#pragma OMF2 STRING (far) const char far cTab[] = { "0123456789ABCDEF 0123456789ABCDEF 0123456789ABCDEF 0123456789ABCDEF" // line repeated 978 times ... };
MODULE INFORMATION: STATIC OVERLAYABLE CODE SIZE = ---- ---- CONSTANT SIZE = ---- ---- XDATA SIZE = ---- ---- PDATA SIZE = ---- ---- DATA SIZE = ---- ---- IDATA SIZE = ---- ---- BIT SIZE = ---- ---- EDATA SIZE = ---- ---- HDATA SIZE = ---- ---- XDATA CONST SIZE = ---- ---- FAR CONST SIZE = 65393 ---- END OF MODULE INFORMATION.