const char xdata var[6]={0,0,0,0,0,0},the number of a const array member can't be more than six

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,everybody.     

   

I'm troubled by a wierd problem. Tthe number of a const array member can't be more than six.     

   

for example. "const char xdata rar[6]={0,0,0,0,0,0};" in the code it runs normally. but when I write"const char xdata rar[7]={0,0,0,0,0,0,0}" in the code. the firmware stalls. it doesn't react to the cyconsole.exe.     

   

what's wrong? so weird it is.     

0 Likes
3 Replies
Anonymous
Not applicable

 Hi,

   

 

   

What is the error that is seen? Is that a compiler error or is something unexpected happening while execution? What do you mean by firmware stalls? Can you please detail the behaviour seen. 

   

 

   

Regards,

   

Gayathri

0 Likes
Anonymous
Not applicable

hi,Gayathri.

   

it passed the compiling without any error.but after i download the hex file with the cyconsole.exe. the firmware doesn't react to cyconsole.exe any more.

   

I think it may be that my board hasd no external memmory. but i used the "xdata".

   

however, when i try to define the const in"const char waveform[128]", the Keil errored "segment is too large, target not build". defining the data  in "unsigned char  waveform[128]" has the same error.

   

i don't know how to resolve it

0 Likes
Anonymous
Not applicable

 Hi,

   

 

   

Does it atleast enumerate after downloading the program ? How doeas it show up in Device manager ?

   

In order to resolve the Keil error, please ensure that values that you have mentioned in the "Options for Target" in Keil, for Code and Xdata are proper. For details refer: http://www.keil.com/appnotes/files/apnt_162.pdf

   

 

   

Regards,

   

Gayathri

0 Likes