IP address in the LPC 1857 controller

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

IP address in the LPC 1857 controller

2,145件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by saur on Wed Sep 04 21:31:22 MST 2013
I am trying to implement Ethernet communication using the MCB1800 kit which has an LPC1857 controller on board with the provision for Ethernet communication. I was studying the example programs already given by keil to understand it.

In the code related to Ethernet, I couldn't find any place where they have assigned the IP address of the device to the controller, though they have defined it in the Net_Config.c file.

I also read the user manual for LPC1857 (i.e. LPC18xx with title "UM10430") and found that there is no register assigned in the controller for IP address. Only the register for MAC address is present.

So, how to assign the IP address to the device??

I don't think communication is possible without the IP address.

Also, do we need to create a socket or provide a port ID to perform Ethernet communication??

Any light on these matters would be great.

Thanks.
ラベル(1)
0 件の賞賛
返信
7 返答(返信)

1,936件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by saur on Tue Oct 01 01:16:23 MST 2013
Hello Alaric,

It would be great if you could send me a simple example. I would really appreciate it, as I'm not able to fully understand the code given in the example program.

I also have a 1 month license of MDK ARM PRO, so it would be great if you could send me some examples I could understand easily.

Also, some of the functions in the example programs are never defined and say "Source Browser:'<name of function>':undefined Definition/Reference". So, are they not defined or not visible to me????

Anyways Alaric, it would be great if you could send me some simple examples I could start with.

Thanks.
0 件の賞賛
返信

1,936件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Alaric on Mon Sep 23 06:13:05 MST 2013
Unfortunately the Keil "MDK ARM Lite license" (free) does not support the TCP/IP Networking Suite which is required to configure the MAC and IP address.
http://www.keil.com/arm/selector.asp

If you had the MDK ARM PRO License I could have sent you a simple example to get you up and running.


Sorry,
Alaric
0 件の賞賛
返信

1,936件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by capiman on Thu Sep 12 03:23:30 MST 2013
Hello Saur,

yes, this is correct. For using ping (and a lot other things) you need the IP address.

There are usually two ways to get such an IP address:

- Static IP address: You choose one address (hopefully unique in your network and reachable by your PC)
  and use this address in your sources. If it is never used inside the sources, not even given
  as parameter in a function call or written into a global variable,
  then i assume this way is not used.

- Dynamic IP address: Your LPC1857 send to all: "I want an IP address".
  Then someone (e.g. your Internet router) says: "Take this one".
  How do you find out this IP address: Look into your router, if there is perhaps a list of assigned IP addresses.
  Or do some logging output (or perhaps it is already there) in software of LPC1857
  to display the assigned IP address.

Now when you have this address, you can call ping on PC.

One additional hint: There is a program called "Wireshark". Very helpful. You can do and save traces on your PC,
and see what the PC is sending and if it gets an answer from your LPC1857.

Additional hint:
http://en.wikipedia.org/wiki/Internet_Protocol
http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol
http://en.wikipedia.org/wiki/Address_Resolution_Protocol

Best regards,

Martin
0 件の賞賛
返信

1,936件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by saur on Thu Sep 12 03:09:21 MST 2013
Hello Martin,

I get the fact that, for Ethernet communication, the packets we send use only the MAC addresses of sender and receiver for communication.

But, when I read the programs given by Keil for this purpose, they have defined the IP address but never ever used it in the code.

My problem atpresent is not about performing an Ethernet communication, but to establish connection.

Though for communication it uses MAC address, if I want to ping IP address is needed and also my guides are saying, IP address is needed for establishing connection.

They say, without IP address you cannot communicate and I must set it within the controller.
So, are they mistaken or am I not able to understand something?

Thanks,
saur
0 件の賞賛
返信

1,936件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by capiman on Thu Sep 12 03:01:31 MST 2013
Hello Saur,

there is the MAC address available. This is set into Ethernet peripheral of LPC1857.
Every packet (e.g. from PC) to LPC1857 with this MAC address as destination MAC address (and a few others)
are received by Ethernet peripheral of LPC1857.
Now it is a task of the software to check if it is an IP packet at all (could also be an IPv6 packet,
which has no IP address in packet, which is longer than 4 -> 16 bytes)
and if the received IP address is matching the IP address which the software in LPC1857 wants to use.
Another example, take the case you want your LPC1857 to react on multiple IP addresses.
When you have only one register, then you can store only 1 IP address.
But if it is done in software, you can even compare against an array of IP addresses.

Best regards,

Martin

0 件の賞賛
返信

1,936件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by saur on Thu Sep 12 02:35:28 MST 2013
If IP address is a setting on TCP/IP level, then when trying to use LPC1857 for ethernet communication, how can I ping it using my computer as server?

Computer can only ping if it can find the IP address for the device it is trying to connect to.

Also I've known that, modules like Wiznet do have registers for IP address.
Without IP I don't know how communication can take place.

Anyone, please help me out with this IP address trouble. I do have an MDK ARM Lite license. Is there a chance that some functions which might be responsible for IP address are not available with this license.

Thanks.
0 件の賞賛
返信

1,936件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bavarian on Thu Sep 05 02:49:24 MST 2013
The examples from KEIL as part of the µVision environment might use their RT library code, so maybe some source code is not accessible.
For learning it's maybe better to work with a totally open code, e.g. the NXP LPCOpen package.
There are quite some ethernet examples for the MCB1857 board included.

Download the 1.03 version here:  http://www.lpcware.com/content/nxpfile/lpcopen-platform

Go to this example:  .\applications\lpc18xx_43xx\examples\lwip\lwip_tcpecho_sa

A more simple example can be found in the older PDL software package: 
http://www.lpcware.com/content/nxpfile/lpc18xx-cmsis-compliant-standard-peripheral-firmware-driver-l...

Look into this folder:  .\lpc18xx\lpc18xx\Examples\EMAC\Emac_EasyWeb


One word to the IP address: this is a setting on TCP/IP level, not on chip hardware level.
So I don't wonder that you can't find a register for it.

Hope this helps.

0 件の賞賛
返信