Hi...
Porting LWIP to TMS320F2812 + ENC28J60 , the ethernet packet received by F2812 can not match with the header struct which defined by LWIP.
in LWIP : sizeof(unsigned char) = 1 sizeof(unsigned short) = 2
in F2812 : sizeof(unsigned char) = 1 sizeof(unsigned short) = 1
So, the length of struct is different between lwip and F2812, if the struct usd unsigned shor data type.
In following code, I wish the length of eth_hdr is 14, just like defined by lwip, but it is 13 in TMS320F2812 + CCS.
sizeof(eth_hdr) = 13 // in TMS320F2812
sizeof(eth_hdr) = 14 // in LWIP
There are many struct like this in lwip, how can I resolve it ?
THANKS !
//--source code like this-------------------------------------------------------------------------
typedef unsigned char u8_t;
typedef unsigned short u16_t;
#define ETHARP_HWADDR_LEN 6
#define ETH_PAD_SIZE 0
PACK_STRUCT_BEGIN
struct eth_addr {
PACK_STRUCT_FIELD(u8_t addr[ETHARP_HWADDR_LEN]);
} PACK_STRUCT_STRUCT;
PACK_STRUCT_END
PACK_STRUCT_BEGIN
struct eth_hdr {
#if ETH_PAD_SIZE
PACK_STRUCT_FIELD(u8_t padding[ETH_PAD_SIZE]);
#endif
PACK_STRUCT_FIELD(struct eth_addr dest);
PACK_STRUCT_FIELD(struct eth_addr src);
PACK_STRUCT_FIELD(u16_t type);
} PACK_STRUCT_STRUCT;
PACK_STRUCT_END