??? 05/19/08 21:04 Read: times |
#154920 - Array size limitation for Keil ? |
I am using Keil compiler along with Silabs IDE for programming Silicon labs C8051F340. In the C Code, when I define an array of size greater than 64 bytes, the code doesn't execute properly.
char myalarms[]="ALARM1XXXXxxxxxxxxxxALARM2XXXXxxxxxxxxxxALARM3XXXXxxxxxxxxxxALAR"; L=0x1200; Compiles fine. If I insert a break at both the lines, it first stops at the first line, continues to second break point a L=.. line and then proceeds further, without issues. But if I change the total characters to 65 (it is 64 in the above example) then the execution stops at the first breakpoint, ie: the array definition, and then it just seems to be coninuously jumping to the same line when I press the 'go' button. char myalarms[]="ALARM1XXXXxxxxxxxxxxALARM2XXXXxxxxxxxxxxALARM3XXXXxxxxxxxxxxALAR"; char alarms1[]="ALARM4XXXXxxxxxxxxxxALARM5XXXXxxxxxxxxxxALARM6XXXXxxxxxxxxxx"; L=0x1200; If the code is as above, and if I insert breakpoints at all 3 lines, then the program counter pointer reaches the first line, and then executes it fine and moves to the second. When it reaches the second line, and if I press continue, it goes back to the first line and loops there. The first array is 64 bytes long. This issue gets solved if I reduce the size of first array to 62 bytes and the second array to just to bytes, totalling 64 bytes. Is is some limitation of compiler or am I doing something stupid? Keil C compiler doesn't say anything about max size being limited to 64 bytes. 64 bytes is too low!! |
Topic | Author | Date |
Array size limitation for Keil ? | 01/01/70 00:00 | |
if you breakpoint | 01/01/70 00:00 | |
Time to check the assembler output.... | 01/01/70 00:00 | |
RE: you can not break on the declaration of a vari | 01/01/70 00:00 | |
you can not break on the declaration of a variable![]() | 01/01/70 00:00 | |
You seem to be declaring constant | 01/01/70 00:00 | |
It is fully possible.... | 01/01/70 00:00 | |
idata as stack | 01/01/70 00:00 | |
Keil compiler limits | 01/01/70 00:00 | |
I agree - its not a limit | 01/01/70 00:00 | |
Well maybe.... | 01/01/70 00:00 | |
64 or 128 | 01/01/70 00:00 | |
It was the stack | 01/01/70 00:00 | |
The compiler cannot really guess .. | 01/01/70 00:00 | |
Glad you have it working | 01/01/70 00:00 | |
Map the variables in correct memory area | 01/01/70 00:00 |