i appriate you at all. thanks for advice.
i was install CW 5.1 as your advice. but, it was still.
so, i dig and dig and dig. as infinite loop.
then i found a cause of memory corruption.
it is cross-file-using(???) like below code.
i was define variables at main.c. and it refered by another file.
-- main.c --#define LARGE_BUFF_LEN 25000#pragma DATA_SEG __GPAGE_SEG GRAM_25Kunsigned char large_buff[LARGE_BUFF_LEN];#pragma DATA_SEG DEFAULT-- other.c --#define LARGE_BUFF_LEN 25000 // never mind this :smileyhappy:#pragma DATA_SEG __GPAGE_SEG GRAM_25Kextern unsigned char large_buff[LARGE_BUFF_LEN];#pragma DATA_SEG DEFAULT
it was a problem.
so, i fix as below code.
-- main.c --CopyToLargeBuff(..., ...);-- other.c --#define LARGE_BUFF_LEN 25000#pragma DATA_SEG __GPAGE_SEG GRAM_25Kunsigned char large_buff[LARGE_BUFF_LEN];#pragma DATA_SEG DEFAULTunsigned int CopyToLargeBuff(unsigned char* buf, unsigned int size){ unsigned int cnt=0; static unsigned int insertion_pos = 0; if(size == 0) return 0; do { insertion_pos %= LARGE_BUFF_LEN; large_buff[insertion_pos] = buf[cnt]; cnt++; insertion_pos++; } while(size != cnt); return cnt;}
i don't know why. but i did fix it. and i can go home.
thank you again, kef. have a good day.