This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: Memory access in a loop
- From: "peter_ku" <peter_ku at issc dot com dot tw>
- To: "'Ecos-Discuss'" <ecos-discuss at sources dot redhat dot com>
- Date: Thu, 10 Oct 2002 12:35:32 +0800
- Subject: RE: [ECOS] Memory access in a loop
I made some mistake, and confuse you.sorry for that and thank you for correction.
Hi,
I use GCC 2.95.2 / insight5.1 , target is E7T.
I want to access memory in a loop
unsigned short x[10];
for(int i=0; i<10; i++)
{
x[i] = *(volatile unsigned short *)(0x200b8f6);
}
the address 0x200b8f6 is a entry point for another memory pool, after I read it once, the memory pointer will increase automatically.
I found a problem.
1. If I didn't set any breakpoint , it will only access the memory once. it means x[0] and x[1]........[10] are all the same value.
I use the Logic Analyzer to make sure this
2. If I set a breakpoint or debug step by step, it will access the memory ten times. it is more normal.
any one can help me?
PS: I have already turn off the optimize -O0.
One more question:
When I use Logic Analyzer, I want to "read" *(volatile unsigned short *)(0x200b8f6)
I found it will read from 0x200b8f8, 0x200b8fa, 0x200b8fc, 0x200b8fe , 0x200b8f0, 0x200b8f2 , 0x200b8f4, and the last one is 0x200b8f6(this is what I want)
PS : "write" will not cause this problem
Best Regards,
Peter