This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Error when write a uint32 with not aligned pointer.
- From: "wang cui" <iucgnaw at msn dot com>
- To: ecos-discuss at sources dot redhat dot com
- Date: Mon, 12 Feb 2007 05:34:40 +0000
- Subject: [ECOS] Error when write a uint32 with not aligned pointer.
- Bcc:
Hi, compiler and ARM experts:
I am faceing a problem like below:
Arch of my target is arm7tdmi(lpc2xxx), little endian.
When I use a (cyg_uint32 *)ptr to write a 32bit value, it always error if
the ptr is not 4-byte aligned.
For example:
ptr = 0x8106409a;
*ptr = 0x00000001;
The result is not like:
0x81064098: 0xXX - shouldn't be modified
0x81064099: 0xXX - shouldn't be modified
0x8106409a: 0x01
0x8106409b: 0x00
0x8106409c: 0x00
0x8106409d: 0x00
but
0x81064098: 0x01
0x81064099: 0x00
0x8106409a: 0x00
0x8106409b: 0x00
0x8106409c: 0xXX - should be modified
0x8106409d: 0xXX - should be modified
It always cause problem when I use tcpip stack.(not cause problem for other
packages with luck)
So how to solve it? Should I modify some compiling options?
Thanks in advance!
_________________________________________________________________
免费下载 MSN Explorer: http://explorer.msn.com/lccn
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss