lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Bare Metal / Memory Alignment


From: Jens Breuer
Subject: Re: [lwip-users] Bare Metal / Memory Alignment
Date: Wed, 7 Sep 2011 16:16:41 +0200

Hi Ake,

> My Target cpu is an Atmel AT91SAM9261 (ARM9), and I haven't seen any problems 
> like the one you described. I'm not sure I had exactly the same problems but 
> when I started to work with lwip it discarded packages due to missing 
> settings for packing structs.

The target device I am using is STM32F107VC.

As explained there are no other errors so far. At least none that I am
aware of at this time. However I am still quite at the beginning.
Next I'm going to get TCP and UDP included and test that.

> Are you using packed structs or ETH_PAD_SIZE set to some value? Just guesses 
> from the top of my head.

Yes, I use packed structs. I thought, that it would be mandatory.
These are the related defines in cc.h:
===3<===
#define PACK_STRUCT_USE_INCLUDES
#define PACK_STRUCT_FIELD(x)    x
#define PACK_STRUCT_STRUCT
#define PACK_STRUCT_BEGIN
#define PACK_STRUCT_END
===3<===

This is the content of bpstruct.h:
===3<===
#pragma push
#pragma pack(1)
===3<===

This is the content of epstruct.h:
===3<===
#pragma pop
===3<===

ETH_PAD_SIZE is not defined in my case. It is using the default from opt.h of 0.
I set it to 2 some time, but I realized quickly that lwIP then uses
the wrong data as the type field value (misalign by 2, surprise).

However, I still have the feeling that I am just doing something wrong...

@Kieran & Ake: Thanks for your replies and interest in the problem.

Kind regards
Jens



reply via email to

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