lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] ip_addr_copy alignment issue


From: Ran Shalit
Subject: Re: [lwip-users] ip_addr_copy alignment issue
Date: Mon, 25 Sep 2017 09:21:14 +0300

Hello Dirk.

Thank you for the suggestion.
I am using IAR compiler, and there is no such flag:
http://netstorage.iar.com/SuppDB/Public/UPDINFO/006738/arm/doc/EWARM_DevelopmentGuide.ENU.pdf

Is there any way to workaround this issue ? I tried many stuff but
lwip doesn't work in any way. I can't be assure it works at all now.

Thank you,
Ran

On Sun, Sep 24, 2017 at 10:18 PM, Dirk Ziegelmeier <address@hidden> wrote:
> Packed structs imply two things: No padding inside the struct AND the
> struct's location may be unaligned in memory. So when this u32 access fails
> at runtime your compiler did not generate correct code for your platform.
> When copying an u32 to/from a packed struct, something like memcpy needs to
> be used when the processor requires aligned access.
> Some ARM platforms can be configured to handle unaligned access, and there
> is a gcc command line flag that tells the compiler it can assume this
> capability (sorry forgot the name of the flag, something like
> -munaligned-access, google it). Maybe this points you in the right
> direction.
>
>
> Ciao
> Dirk
>
>
> On Sun, Sep 24, 2017 at 2:47 PM, Ran Shalit <address@hidden> wrote:
>>
>> Hello,
>>
>> I get stuck in ip_addr_copy when called by ip_input.
>> I am using MEM_ALIGNMENT 4, and packed structs.
>> I tried many stuff, but nothing yet helped.
>> If I try MEM_ALIGNMENT 1, I get stuck in much earlier phase.
>> I'm using lwip 1.4.1 , which is a stable release as I understand.
>>
>> Is there any idea how this issue can be fixed ?
>>
>> This is the code for ip_addr_copy
>> #define ip_addr_copy(dest, src) ((dest).addr = (src).addr)
>>
>> Best Regards,
>> Ran
>>
>> _______________________________________________
>> lwip-users mailing list
>> address@hidden
>> https://lists.nongnu.org/mailman/listinfo/lwip-users
>
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/lwip-users



reply via email to

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