FNET - TCP/IP Stack

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FNET - TCP/IP Stack

56,736 Views
butok
NXP Employee
NXP Employee

FNET TCP/IP stack: Version 0.5.0 released. 
 

FNET Home page: http://fnet.sourceforge.net/

    Please, submit your feature requests and feedbacks here:

    http://sourceforge.net/tracker/?group_id=253892&atid=1126921 

    Please, submit your bug reports here:

    http://sourceforge.net/tracker/?group_id=253892&atid=1126920

 

FNET brief information:
The FNET is a free, open source software project (under GNU GPLv3) for building embedded communication software using the Freescale processors.

 

The stack provides following protocols and services:
  * Supported platforms:
     - Reindeer - MCF5282 (M5282EVB).
     - Kirin2 - MCF52235 (M2235EVB).
     - Kirin3 - MCF52259 (M2259EVB).
     - Lasko - MCF51CN128 (TWR-MCF51CN).
     - Other Freescale platforms to be supported soon.
  * Available as:
     - Stand-alone version. No underlying RTOS is required, although it can be used with it.
  * Supported Compilers:
     - Freescale CodeWarrior for ColdFire Version 7.1.
     - Freescale CodeWarrior for Microcontrollers Version 6.2.
  * BSD-style Socket layer API
  * Protocols:
     - User Datagram Protocol (UDP).
     - Transmission Control Protocol (TCP).
     - Internet Protocol (IPv4).
     - Internet Control Message Protocol (ICMP).
     - Address Resolution Protocol (ARP).
  * Network Interfaces:
     - Ethernet interface.
     - Loopback interface.
  * Services:
     - HTTP/0.9 server. Both SSI and CGI are supported.
     - DHCP client.
     - TFTP client.
     - Static File System.
     - CFM Flash driver.
  * Tools:
     - GUI File System Generation Tool.
  * Applications:
     - TFTP Bootloader.
     - Shell Application.
  * Doxygen User Documentation.

 

 Changes in 0.5.0 (since last public version):
 - Added TFTP client.
 - Added Coldfire Flash Module (CFM) driver.
 - Added FNET TFTP Bootloader.
 - Fixed DHCP client.
 - Updated Shell Demo application. Application parameters are saved in the flash.
 - Improved Shell library. Added blocking-command and multi-word parameter features.
 - A lot of other changes and fixes.

 

Best regards,

Andrey Butok

Labels (1)
Tags (2)
225 Replies

2,301 Views
butok
NXP Employee
NXP Employee

FNET Version 0.6.0 released:

 - Added GNU Lesser GPL v3 license.

 - Added Telnet server service.

 - Added M52259DEMO board support.

 - Added Shell service.

 - Added Serial I/O library.

 - Added TCP options to control TCP keep-alive parameters: TCP_KEEPCNT, TCP_KEEPINTVL, TCP_KEEPIDLE.

 - Added new socket error code FNET_ERR_CONNCLOSED (connection closed by peer) used by the TCP receive function.

 - Deleted obsolete Lite HTTP server.

 - Fixed some issues in the TCP module.

 - Fixed memory management.

 - A lot of other changes and fixes.

 

Best regards,

Andrey Butok

Message Edited by butok on 2009-11-04 02:09 PM
0 Kudos
Reply

2,301 Views
butok
NXP Employee
NXP Employee

FNET Version 0.6.3 released (http://fnet.sourceforge.net):
 - Added TFTP write request support to the TFTP client service.
 - Added firmware-upload (through TFTP) command to the FNET Bootloader. It can be used for the firmware backup, for later system restore.
 - Minor fixes.

 

Best regards,

Andrey Butok

0 Kudos
Reply

2,292 Views
satinderKhera
Contributor I

Hi,

 

I am using the Fnet stack and my board will be in client mode means I am using the DHCP client and once I will add my board in the local network the only mode of communication available will be through ethernet only. For this I need to have known the Dynamic IP address of my board. How can I know the IP address assigned by server to my board while using this FNET Stack?

Please Suggest.

 

Regards,

Satinder Singh

0 Kudos
Reply

2,292 Views
butok
NXP Employee
NXP Employee

Hi Satinder Singh,

 

>> How can I know the IP address assigned by server to my board while using this FNET Stack?

To get know the assigned IP address, you can use the fnet_netif_get_address() function.

http://fnet.sourceforge.net/manual/group__fnet__netif_ga136a199dfa9f0ebe0a2ed49ec55f593d.html#ga136a...

To determine if the IP address parameters were obtained automatically (through DHCP server) or manually you can use the fnet_netif_address_automatic() function.

http://fnet.sourceforge.net/manual/group__fnet__netif_ga335311b7441aefff0fb7a9010f074dbb.html#ga3353...

 

 As the reference of the source code DHCP usage I suggest to use the FNET Shell demo.

http://fnet.svn.sourceforge.net/viewvc/fnet/fnet_demos/source/fnet_application/fapp_dhcp.c?revision=...

 

Best regards,

Andrey Butok

0 Kudos
Reply

2,292 Views
satinderKhera
Contributor I

Hi Andrey,

Thanks for your reply, but I feel there is slight misunderstanding about the question I asked.

Once my board will be connected over the LAN, IP address will be assigned dynamically. Now, I want to ping my board but I don't know the assigned IP address. Is there any way to know the IP address either by using MAC address or by some other means.

By using fnet_netif_get_address( ) function my firmware my know the IP address, but how can I tell it to the external world first time(please note that I can communicate only through ethernet)?

 

Regards,

Satinder Singh

0 Kudos
Reply

2,292 Views
ChrisJohns
Contributor I

The most common solution which maybe a standard these days is DDNS or dynamic DNS. All DHCP server worth using should support some form of dynamic DNS updating. You also need a DHCP client that provides a host name in the DHCP request (or ack or where ever) that is used as the DNS name. This method is proven and scalable.

 

This of course requires your board has been given a name and so some way of being specifically configured. This is not a protocol issue, rather a system one and may change the design in other ways.

0 Kudos
Reply

2,292 Views
Kopone
Contributor IV

Hi Satinder,

 

that is not an FNET specific problem but rather a problem common to all embedded TCP/IP applications. There are several common approaches depending on which way you want to communicate with the unit at all.

E.g. if you are using a dedicated protocol and you have a client app on the PC to talk to the unit, you can simply do a UDP broadcast on your protocol port and see where the replies come from.

If you want standard services like http, you may still add a private UDP protocol just to find the IP (you'll need to write a small client software to make use of that). You may also scan the network for open 80 ports or, as you said, you can use the MAC address by just looking up the assigned IP in the list of your DHCP server. If applicable you could also add a small LCD to the device. Since in a class C network you'd only need to know the last IP byte anyway, a 3 digit LCD for about $1.50 would suffice already. I'm sure other people found other solutions, maybe also try google.

 

Regards,

 Sven

0 Kudos
Reply

2,292 Views
mjbcswitzerland
Specialist V

Hi

 

If FNET supports NetBios you can give each device a unique name and then ping it with "ping DEVICE_NAME" (for example).

If this is not supported, it works using UDP broadcast on port 137 and is in fact quite trival to add.

 

Regards

 

Mark

 

0 Kudos
Reply

2,292 Views
butok
NXP Employee
NXP Employee

 

 

 FNET Version 0.7.0 released (http://fnet.sourceforge.net):
 - Added TFTP-server service. Both read and write requests are supported.
 - Added TFTP Firmware server to the FNET Bootloader. It allows to update or backup the firmware from a remote TFTP client running on host PC without the serial-console command line interface.
 - Updated to the latest CodeWarrior compiler:
     - Freescale CodeWarrior for ColdFire version 7.2.
     - Freescale CodeWarrior for Microcontrollers Version 6.3.
 - Minor changes and fixes.

 

 

Best regards,

Andrey Butok

0 Kudos
Reply

2,292 Views
LightElf
Contributor I

Hi Andrey!

 

What are primary advantages of FNET compared to NicheLite or lwIP? Both seems very solid and functional. So what are the reasons to use FNET? And what are the reasons  to develop just a "new one TCP stack"?

0 Kudos
Reply

2,292 Views
butok
NXP Employee
NXP Employee

Hi,

 

>>So what are the reasons to use FNET?

Nobody push you to use the (LGPL license) FNET stack.

If you are happy with NicheLite or lwIP - use it.

You should decide yourself what is the best for your application, I do not help you.

 

>> And what are the reasons to develop just a "new one TCP stack"?

It looks new, but its history is started in 2003 as internal project and reused in some public projects.

It became fully public only in 2009.

 

 BTW: I am planning to add throughput TCP/UDP benchmark tools in one of the future FNET version (was postponed cause of higher priority tasks), so everybody will be able to do test it.

 

Best regards,

Andrey

0 Kudos
Reply

2,292 Views
butok
NXP Employee
NXP Employee

 FNET minor version 0.7.1 released (http://fnet.sourceforge.net):
 - Added TWR-MCF52259 board support to the demo applications.
 - Fixed PHY initialization for MCF52259 and MCF52235.
 - Added serial-port initialization function.
 - Minor changes and fixes.

 

Best regards,

Andrey Butok

0 Kudos
Reply

2,292 Views
ReySinTrono
Contributor I

How to add HTTP Firmware Server to the FNET Bootloader?

Is there any example about that?

Thanks.

.

0 Kudos
Reply

2,292 Views
butok
NXP Employee
NXP Employee

Hi,

Look at the “shell” demo application.

Main difference is in the configuration files (do merge):

    fnet_user_config.h

    fapp_user_config.h

 

Best regards,

Andrey Butok

0 Kudos
Reply

2,292 Views
ReySinTrono
Contributor I

Hello Butok,

 

My idea is to create an application for update coldfire firmware from embedded web server (FNET Web Server), using post  method of htlm form  to transmit the firmware update and then self-programming  (FNET Bootloader).

 

The HTML example code could be:

 

<html><head> <title>Update my  MCF52259 Firmware </title></head>
 <body>

<FORM action="http://192.168.0.4/update.cgi"  enctype="multipart/form-data"   method="post"> 
 <P> SREC File <INPUT type="file" name="fupdate"></P>
 <INPUT type="submit" value="Ok"></INPUT>

</FORM>
</body>
</html>

 

possible to do this with FNET ( FNET HTTP BOOTLOADER :smileyhappy: )?

 

Thank you very much.

 


 

 

0 Kudos
Reply

2,292 Views
butok
NXP Employee
NXP Employee

Good idea.

But current version of the HTTP server does not have support of the POST request.

You should implement it by yourself.

 Best regards,

Andrey Butok

0 Kudos
Reply

2,292 Views
mjbcswitzerland
Specialist V

Hi

 

Note that the uTasker project for single chip V2 parts includes HTTP POST support for passing parameters or files. It also includes HTTP POST upload support (optionally encrypted); this can be used as a dedicated boot loader, occupying about 25k of FLASH (that is a boot loader including web server and a dedicated upload page) or as a 'bare-minimum' boot loader occupying 2k or 4k of FLASH - in this case it uses intermediate storage in either internal FLASH or external SPI FLASH to receive the code and then installs the new application in a manner that can't be distrupted, even due to power failure etc. during the process.

 

Regards

 

Mark

 

http://www.utasker.com/kirin3.html

http://www.utasker.com/docs/uTasker/BM-Booloader_for_M5223X.PDF

 

0 Kudos
Reply

2,301 Views
NeuroSolutions
Contributor I

Hi Andrey I wanna move a servo-motor via ethernet and I just download the Fnet 0.6.3 but looking in the demo code the size of the code is bigger than my licence code size, and I dont need all the features that Fnet provides me, can you help me with a little example of a basic http request or just a ping with the target.

 

Thanks a lot!

0 Kudos
Reply

2,301 Views
butok
NXP Employee
NXP Employee

Hi NeuroSolutions,

I suggest you to buy normal CW license.

You can try to add the FNET to your project http://fnet.sourceforge.net/manual/how_to_add_fnet.html and/or play with configuration parameters http://fnet.sourceforge.net/manual/group__fnet__config.html , after FNET initialization you should be able to ping the board. If it does not help you should obtain normal compiler license.

 

0 Kudos
Reply

2,301 Views
NeuroSolutions
Contributor I
Ok, it will be the ideal but its a little project for the research group in the University and I dont have the money to buy it. The idea its only to send via ethernet a command that indicates the number of degrees that a servomotor has to move. If you can help me with a little code that do that, send a variable from a pc to the micro, I would be very grateful... I dont need the telnet module, or ftp... I know that it will be a lot of modules that I can be deleted.
0 Kudos
Reply

2,301 Views
PaoloRenzo
Contributor V

Hi

 

Have you considered uIP tcp/ip stack for v1 architecture? xMAP indicates is around 32KB including a web page which will fit with your 64KB limited CW license.

 

I will try to get details about gcc open source tools if this is available for v1 architecture

 

Demo is here:

 

http://www.freertos.org/index.html?http://www.freertos.org/a00090.html#FREESCALE

 

Anyway find attached example code

 

Does this help?

0 Kudos
Reply