lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [lwip-users] lwip + sam7x = udef exception


From: B B
Subject: RE: [lwip-users] lwip + sam7x = udef exception
Date: Wed, 14 Feb 2007 12:23:51 +0000


Hi again,
 
correction to the below, the address calculated
is resulting in a 2 byte aligned value and not 4 byte as required.
 
(struct tcp_hdr *)((u8_t *)p->payload + IPH_HL(iphdr) * 4) = 0x0020b1fa

regards,
Martin




From: address@hidden
To: address@hidden
Subject: RE: [lwip-users] lwip + sam7x = udef exception
Date: Wed, 14 Feb 2007 12:13:41 +0000

Hi again Kieran,
 
the value given for tcphdr is the address.
So it seems to be the address of the tcphdr variable
which is 2 byte aligned and not 4 byte, as required.

How can i enforce alignment of that variable?
 
regards,
Martin





> Subject: RE: [lwip-users] lwip + sam7x = udef exception
> From: address@hidden
> To: address@hidden
> Date: Wed, 14 Feb 2007 11:28:25 +0000
>
> On Wed, 2007-02-14 at 11:19 +0000, B B wrote:
>
> > offending instruction:
> > adds r4, r3, #0x0
> >
> > offending c statement:
> > tcphdr = (struct tcp_hdr *)((u8_t *)p->payload + IPH_HL(iphdr) * 4);
> >
> > Register data:
> > R3 = 0x0020135c
> > R4 = 0x0020b1fa
> > CPSR = 0x0000009b
> > SPSR_UND = 0x0000001f
> >
> > Packetdata:
> > tcphdr @0x0020b1fa
>
>
> Looks to me (not 100% sure what "adds" does or the argument format on
> your hardware) that it's the instruction that is trying to store the
> result of that C statement into tcphdr that is causing the problem. I
> think this because the value of R4 matches the address given for tcphdr.
> Please correct me if you disagree.
>
> The problem would seem to be that tcphdr has an address that is 2 byte
> aligned, not 4 byte aligned as you require. However, it's not clear
> from the above to me whether the value give for tcphdr is the address of
> the tcphdr variable, or the contents of the tcphdr variable (i.e. the
> address of what it points to).
>
> Can you clarify this?
>
> Kieran
>
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users



Live Search: New search found Try it!


Live Search: New search found Try it!
reply via email to

[Prev in Thread] Current Thread [Next in Thread]