This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Debug ok but hexfile not.

Hi,

I am playing with demo version of the Keil µVersion 2.03 and the
Infineon SK-167SR. Also , I am not very familair with in C, which
makes thinks not easier for me.
For me the problem is rather strange. During a debug session
almost every thing is runining fine, but if i let the same programm
run from the flash of the board it does not.

here is (not) working code

void main(void)
{
unsigned char num_str[6];

... do soemthing ...

write_string(num_str,1);
}

void write_string(char * s, unsigned char line)
{
unsigned int i;
if (line == 1) LCD_CNTL = 0x80;
wait(30000);
for (i=0; i<strlen(s); i++)
{
LCD_DATA = s[i];
wait(300);
}
}

During debuging this is working perfectly. It shows some data on a LCD,
but the same program running from flash, writes "only" black squares
on the LCD (the complete fist line on my 20*2 LCD).

For me it is quite hard to find the reason for this behavior.

thanks in advance,
Thomas

Parents
  • Obviously, your program must have two different configurations: one for debugger mode (running from RAM) and the other for normal mode (running from flash). For that I use the multiple targets feature of uVision. You should specify the correct memory mapping for both configurations in the target options window (carefully check ROM and RAM ranges). Another important thing is that C startup file (start167.a66 or whatever it's called) is most probably different for the two configurations, so you need to check that too (external bus settings: BUSCONx and ADDRSELx - it is VERY IMPORTANT).
    For your first C166 project small memory model is the best choice as long as your code fits in 64K because you don't have to worry about xhuge modifiers and stuff like that. The small memory model allows you to have your code and data separated as far as you want in the address space (see C166 compiler manual).
    Good luck!
    Mike

Reply
  • Obviously, your program must have two different configurations: one for debugger mode (running from RAM) and the other for normal mode (running from flash). For that I use the multiple targets feature of uVision. You should specify the correct memory mapping for both configurations in the target options window (carefully check ROM and RAM ranges). Another important thing is that C startup file (start167.a66 or whatever it's called) is most probably different for the two configurations, so you need to check that too (external bus settings: BUSCONx and ADDRSELx - it is VERY IMPORTANT).
    For your first C166 project small memory model is the best choice as long as your code fits in 64K because you don't have to worry about xhuge modifiers and stuff like that. The small memory model allows you to have your code and data separated as far as you want in the address space (see C166 compiler manual).
    Good luck!
    Mike

Children