Hi,
i am using CodeWarrior 6.2. I can't put an array of constants in a flash when using Coldfire V1 mcu. It works very well with 8-bit s08 mcus. Can someone please tell me how to make it work with Coldfire V1 mcus also.
For example, i want these array in a flash:
const char [8][200];
已解决! 转到解答。
Dear pgo,
i have found the solution. The catch was that the const array was put in to the flash correctly while the interface on the left side of a Codewarrior window reported increase in data instead of a code and I was thinking that it is placed in ram. Maybe this is a minor bug. Because it is only the case when using Coldfire V1 processors.
Have a nice day!
Dear Florijan,
I'm won't pretend to be an expert on the subtities of C constants but I think that a 'definitiion' of a constant array without an initialisation is treated differently to one with. It's treated as a declaration rather than a definition. You are free to define the array in another location - the const qualifier on the declaration appears to be ignored for placement.
If I declare an _initialised_ constant array:
const unsigned char dummy[5] = {1};
it ends up in the ROM area.
However,
const unsigned char dummy[5];
ends up in RAM.
So - either initialise the array or use the @notation to place the array in Flash.
const unsigned char myData[10]@0x1000;
bye
PS. Above tested with CW v6.2.2?
Dear pgo,
i have found the solution. The catch was that the const array was put in to the flash correctly while the interface on the left side of a Codewarrior window reported increase in data instead of a code and I was thinking that it is placed in ram. Maybe this is a minor bug. Because it is only the case when using Coldfire V1 processors.
Have a nice day!