2007-08-07 11:46 PM
2007-08-07 08:36 PM
Hi, I use Hiware compiler for program st7LITE19.
I have declared: const unsigned char far TAB_SENS[4]; and in my .prm file: FLAGS = -Ms -Cc -Cq -Lasm=%n.lst I compiled it but when I go to see the .map file I found: TAB_SENS ( 12) DEFAULT_RAM and a WARNING message: ''WARNING L2208: No copydown created for initialized object ''_TAB_SENS''. Initialization data lost''. Why? Why my const TAB is insert in RAM? :o Thanks for your help! ;)2007-08-07 10:52 PM
Hi Marco,
you should use the line ''const unsigned ...'' strictly outside of subroutines (don't ask me, why!! perhaps because otherwise it will get a local) or you have to define it as ''static const unsigned ...''. I usually use the pragma CONST_SEG e.g. #pragma CONST_SEG NEAR TAB_ROM prior to the definition - also at declarations in include-files. By the way: What is the sense of a const array whithout assigning any values?? Regards, WoRo2007-08-07 11:46 PM
Thanks! :-]
I have cut the post: in the real code I have assigned the value: const unsigned char far TAB_SENS[4] = { 0x00, 0x02, 0x03, 0x01 }; Now work! I have used #pragma directive before the define: #pragma INTO_ROM const unsigned char far TAB_SENS[4] = { 0x00, 0x02, 0x03, 0x01 }; Thanks again