SAM E70 Xplained, "LwIP Example" does not work

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

Hi,

could please anybody confirm the "LwIP Example" really works ?

 

In my case, it does something else to what I expected. On start it prints message:

Hello ATMEL World!

 

And when Ethernet cable is connected there appears:

Ethernet Connection established
IP_ADDR    : 192.168.1.100
NET_MASK   : 255.255.255.0
GATEWAY_IP : 192.168.1.1

 

 

Ping to 192.168.1.100 fails.

My computer (in the same network) has IP 192.168.88.254 and other device has IPs 192.168.88.246, and router provides gateway IP 192.168.88.1,

=> I suppose router's DHCP range is 192.168.88.xxx (with Subnet mask 255.255.255.0).

 

The IP 192.168.1.100 seems to be defined in source lwip_macif_config.h :

#define CONF_LWIP_MACIF_IP "192.168.1.100"

 

#define CONF_LWIP_MACIF_GATEWAY "192.168.1.1"

 

 

=> I suppose, a static IP is used then.

I checked configuration of project "LwIP Example" and indeed, DHCP doesn't seem to be enabled.

(source lwipopts.h : #define LWIP_DHCP 0)

 

So I tried

1) enable DHCP, I have changed:

#define LWIP_DHCP 1

but still appears the same text, no ping

 

2) change the static (default ?) IP address definition:

#define CONF_LWIP_MACIF_IP "192.168.88.249" ----------// is between existing .246 and .254, and is not used by other device

#define CONF_LWIP_MACIF_GATEWAY "192.168.88.1"

Text when cable plugged has changed to:

Ethernet Connection established
IP_ADDR    : 192.168.88.249
NET_MASK   : 255.255.255.0
GATEWAY_IP : 192.168.88.1

 

 

but still no ping.

 

I suppose it should not work this way.

If the Static IP is used, then I would expect also the ping should work.

If IP is assigned to my board via DHCP, then I would expect it shows IP like 192.168.88.xxx and ping should work too.

 

I would like to exclude problem is caused by possibly unsuccessful migration of the original project "LwIP Example" from SAME70Q21B to SAME70Q21A really fitted on my board.

 

Could please anybody show me what his board prints, whether the IP printed is correct, and if able to ping.

Thanks

 

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

Silly thing to check - make sure a firewall isn't blocking the pings.  I thought a Win10 client machine by default would not respond to pings.  So grab a laptop or some other computer and try to ping your desktop at 192.168.88.  Once it's confirmed as working, then move on to trying the ATSAME70 pinging your desktop.

 

And yes they need to be on the same private subnet in this case unless your router is setup to forward to other private subnets (very rare)

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

I think it must be misunderstanding.

The ATSAME70 is not sending ping to my desktop PC, it is the PC who makes ping.

The source code "LwIP Example" doesn't seem to send any ping or print any results.

It only prints its IP when connection established (I suppose).

 

I am no expert on network stuff, no experience with LwIP and Atmel E70.

I worked with Microchip PIC + TCP/IP stack before.

But isn't PING based on ICMP protocol ?

Watching project "LwIP Example" configuration / "LWIP" module settings, the ICMP module is not enabled here - how could the PING work then ?

 

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

Uprom wrote:
the ICMP module is not enabled here - how could the PING work then ?

If it's not enabled then it clearly won't respond to PINGs.

 

So it is, in fact, working correctly!

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Description of "LwIP Example":

 

The example sends "Hello ATMEL World!" to the debug console by usart port, and once the ethernet connection was established, the debug console will print the static IP address and netmask address.

The user can ping the board from the host computer.

 

I am not native speaker so I have probably misunderstood the part "user can ping the board"..

It's just my first experience with E70, previously worked with D21 and all demos did exactly what description said, so I didn't suspect wrong description.

Thanks

 

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

Well, as a native speaker, I would also understand, "The user can ping the board from the host computer" to mean what you thought it meant!

 

But then it's not unknown for Atmel to be sloppy in their documentation - and a lot of it is clearly written by non-native speakers.

 

frown

 

Please give a link to the actual documentation so that we can see it in context...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

>> Please give a link to the actual documentation so that we can see it in context...

As a description I meant the brief info what a selected Example project does:

Atmel Start --> BROWSE EXAMPLES --> select Board=SAM E70 Xplained --> find "LwIP Example" and click button User guide (see the attachment screencopy)

 

I tried to change the configuration to have in "LWIP" module checked box for ICMP,

and then in source files changed default Static IP to 192.168.88.249 that should work on my network, but PING still doesn't work.

Well, it was too optimistic to think that such a little change could fix it..

 

I don't understand meaning of the "LwIP Example" provided;

without the ability to answer to PING there is no way to check Ethernet conectivity.

A simple example of TCP server + echo, with DHCP enabled would help much more on begin with networking.

 

E70 is device with MAC, the only example that uses MAC+LwIP doesn't work, and all other TCP/IP examples work with WiFi WINC1500, brilliant..

 

Attachment(s): 

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

Uprom wrote:

without the ability to answer to PING there is no way to check Ethernet conectivity.

 

    Not exactly. Start from down up. Use Wireshark on your PC. When you send a ping to your device, your computer first sends an ARP packet and waits for a response from your device. If it gets back the ARP response, then it sends the ICMP packet. You can see on Wireshark if these things happen or not. If your device is just not responding to a ping request, ok, you can go ahead and use UDP protocol and exchange some data. Ping is not something mandatory. For a local network ICMP is not mandatory either providing you know well your network capabilities. If you intend to exchange data over the internet, then you must have ICMP up and running (PING still not mandatory). For example, if down the path, a network section or router has a lower MTU than your packet requires, an ICMP message is sent back to you and that packet discarded. What your TCP-IP stack is doing is first notifies your application about this issue, and then lowers your MTU, so subsequent packets will be able to pass through the network. Without ICMP up and running you may send packets that would only be discarded not knowing why.

 

Uprom wrote:

A simple example of TCP server + echo, with DHCP enabled would help much more on begin with networking.

 

    Not exactly. First, servers need static IPs. You use DHCP when you are a client. This is because with DHCP, you may see your given IP address on your serial terminal, but you don't want always to look at that terminal. Secondly, to have a server replying to your request, many things need to be up and running, something that not always happen right out of the box. As I pointed earlier, you start and debug your network from down up. ARP, (ICMP PING if available), UDP client, TCP.

 

Last Edited: Thu. Aug 23, 2018 - 04:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello UPROM, did you solve the not working example ??

FQG

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

I couldn't get it to work either.

 

Then I noticed that my board has a ATSAME70Q21 but Atmel Start is generating code for a ATSAME70Q21B.  When using XC32 + MPLABX it was just happy programming Q21B onto a vanilla Q21, when I rolled back to Atmel Studio it finally warned me that the chip was different.

 

When I tried to rebuild it with the vanilla Q21, it wouldn't because the vanilla Q21 doesn't have LPI or TSUTIMCOMP interrupt.  I don't see any documented reason why those definitions aren't in the vanilla Q21 gmac.h file, so maybe the vanilla Q21 didn't support them because of an errata or if they just added support for it later.

 

What really irritates me is that I feel like when I last played with this board late 2016, Atmel Start had a working LWIP netconn example.

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

 

I try to migrate ATSAME70Q21B to ATSAME70Q21 using Atmel Studio 7 (by using the change device drop_down options on the Atmel  Studio 7),  

it always gives errors.

 

I don't know how to migration those chips.

If someone know how, Please give some helps, Thanks a lot. 

junp

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

Hello All, 

I am new to this forum as well as beginner in firmware development. I am using ATSAME54N19A for my project and i want to see if i can communicate through Ethernet.  I have used all the atmel start LWIP examples but it does not work. I can not ping the device using IP. I tried working on both static and dynamic mode. I don't know how to proceed now. Is there anyone who faced this problem and found the solution? Please let me know how to solve this problem?

Pushparaj Adka
Firmware Engineer
Unbox Robotics