Ethernet with SAME70

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello all, I have configured ethernet LWIP on SAME70 and trying to transmit some data to PC. My current configurations are given below.

 

at MCU Side

IP Address: 192.168.0.100

Gateway:    192.168.0.250

Destination IP: 192.168.0.1

Subnet Mask:255.255.255.0

 

at PC Side

IP Address: 192.168.0.250

Gateway:    None

Subnet Mask:255.255.255.0

 

When I set IP at PC 192.168.0.1, nothing is received on wireshark but ARP packets. When I set IP at PC 192.168.0.250 following packets are viewed on wire shark that shows inverted destination IP, but Whyyy??? Please Please Please help.

 

This topic has a solution.

Last Edited: Wed. Jan 23, 2019 - 03:47 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Any help please??

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Any commments please?

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Without seeing your source code or diving too deeply into the lwIP drivers, it sounds like a big-endian versus little-endian problem.  By definition Ethernet packets and TCP/IP are in big-endian (Network Order).  A SAME70 ARM processor is a little-endian machine (Host Order).  Take a closer look at host-to-network and network-to-host conversion functions for 16-bit and 32-bit quantities:  lwip_htons(), lwip_ntohs(), lwip_htonl(), lwip_ntohl(), etc.

Last Edited: Mon. Jan 21, 2019 - 06:09 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the reply ScottMN. Yes Endianness was the issue byte swapped the address and it worked.