Author Topic: Ethernet and telnet  (Read 13233 times)

Offline Itche

  • Newbie
  • *
  • Posts: 10
    • View Profile
Ethernet and telnet
« on: August 18, 2008, 08:04:53 PM »
Hello All,
I encountered an issue regarding the ethernet/telnet application.
after configuring MAC and IP i have started the simulator and was able to "telnet" and try all the network related options. I compiled the utasker code under Eclips 3.2 in order to download it to my atmel AT91SAM7X-EK board. when i restarted by board i noticed the H.B LED blinking as in the simulator. when i tried to telnet to my board i wasn't successful. I captured the telnet attempt using WireShark. please see attached file. Any ideas anyone??

Thanks so much
Itche

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Ethernet and telnet
« Reply #1 on: August 18, 2008, 08:24:36 PM »
Hi Itche

What you are seeing is a (typical) GNU packing problem. What is happening is that the ARP frame being sent out has two additional 0x00 0x00 (between the Ethernet II header and the ARP protocol header). This is because GNU defaults to aligning structs on long word boundaries and thus adds two dummy bytes to align the ARP header struct.

The simulator (using Microsoft C/C++ compiler) doesn't do this so worked correctly.

However I don't understand why your GNU compiler/project is doing it since the project has been set up to tell GCC to pack structs. See tcpip.h:

#ifdef _GNU
    #define _PACK               __attribute__((__packed__))              // {1}
#else
    #define _PACK               
#endif



If the GNU define is set in the project the GNU compiler should then pack these structs and so generate correct frames.

Try to find out why this is not working. Are you using a difference GCC version which requires a new pragma? Have you modified anything which has lost the project pre-processor define?

Do the following test:
Corrupt the line above (eg.)
  hwjehdlwe  #define _PACK               __attribute__((__packed__))
and compile. If there are loads of errors due to the corruption you know that the line is being used and you will need to find out why GCC is (suddenly) ignoring it.
If the project still compiles without errors find out why the _GNU define has gone missing (check the make file).

Regards

Mark



Offline Itche

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Ethernet and telnet
« Reply #2 on: August 19, 2008, 03:39:17 AM »
Mark,
Thanks for the quick response.
I'll try that first thing tomorrow morning
Itche

Offline Itche

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Ethernet and telnet
« Reply #3 on: August 19, 2008, 03:12:16 PM »
Mark,
These lines do not exist in my tcpip.h
I added them and tried following your guide but got the same result.
When i created an error I did not receive build errors and a new .bin file got generated.
When i looked into the project definitions i see that GNU is defined.
Not sure what I'm doing wrong
Thanks for your help
Itche

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Ethernet and telnet
« Reply #4 on: August 19, 2008, 04:07:26 PM »
Hi

It seems as though you have not installed any service packs. GNU support was added with SP1. ROWLEY 16.9.2007.

Go to the service pack page and download the latest SP for the SAM7X (it includes all intermediate SPs as well):
http://www.utasker.com/software/softwareV1.3.html
(SP3 is latest at the moment)

Installing new SPs is in fact very easy but there is also a step-by-step description in the following document:
http://www.utasker.com/docs/uTasker/uTaskerV1.3_user_guide.PDF
(on page 4/11).

Regards

Mark



Offline Itche

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Ethernet and telnet
« Reply #5 on: August 20, 2008, 04:07:55 AM »
Mark,
After applying SP3 it started working.
Thanks so much for your time and help ;D

Itche