FNET - TCP/IP Stack

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

FNET - TCP/IP Stack

44,792 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

874 Views
butok
NXP Employee
NXP Employee

Hi Marcus,

I have never tried or tested empty SSI,  always with some amount of data.

It should be OK even if it is empty, otherwise it is defect.

0 Kudos

874 Views
IRTrans
Contributor III

Hi Andrey,

I have already traced the SSI issue down a bit.

The problem is in "int fnet_http_get_send(struct fnet_http_if * http)".

In case the file_send count is == 0 fnet_http_get_send returns FNET_ERR and the html page is not processed any further.

Marcus

0 Kudos

874 Views
butok
NXP Employee
NXP Employee

Hi Marcus,

In this case, this is  behavior  by  design. If it returns 0, it marks that there is no data for sending anymore and the request is completed. It is possible to handle your case (for example to use -1 mark instead 0), but it will require more changes/testing.

I will put it to my task list as your case makes sense to use SSI not for SSI but for function call only.

Thanks,

Andrey

0 Kudos

873 Views
spiderman
Contributor III

Hello Andrey,

I think there is a bug in fnet_mk_timer.c within fnet_cpu_timer_release:

fnet_isr_vector_release(FNET_CFG_CPU_TIMER_NUMBER);

should be replaced with:

fnet_isr_vector_release(FNET_CFG_CPU_TIMER_VECTOR_NUMBER);

Not having trouble about it, but just came across it.

0 Kudos

874 Views
butok
NXP Employee
NXP Employee

Thanks Spiderman.

You are right.

The fix will be available in the next version.

BTW:

     You may submit FNET bug reports here: https://sourceforge.net/tracker/?group_id=253892&atid=1126920

Thanks,

Andrey Butok

0 Kudos

873 Views
maxmax
Contributor I

Hi evererybody,

I am trying to compile FNET 2.3.0 under GCC, is there any topic or help that I can get about it?

Thanks in advance.

BR

0 Kudos

873 Views
butok
NXP Employee
NXP Employee

Hi,

Official FNET is not tested with GCC.

But based on the “FNET Network Stack for LPC176x“ blog: http://bionicmessage.net/node/8:

    “The FNET port is compiled with the Code Red LPCXpresso IDE v5.0.10 which uses GCC 4.6.2.

BTW:

     Any contribution is welcome.

Thanks,

Andrey Butok

FNET Community

0 Kudos

873 Views
maxmax
Contributor I

thanks for your answer,

Actually I have already tried this version but somes files are missing ( cr_section_macros.h, NXP/crp.h ). Using modified GCC (code sourcery) and if I set CW as compiler (but GCC is really used) and MCF52235 as CPU, I can compile FNET stack 2.3.0 except "fnet_mcf_flash.c" but linking fail. I would like to implement FNET on Cortex M4 using FreeRTOs as OS and I have to use codesourcery.

Do you think I will have to develop  every files such as "fnet_mcf_timer.c", ethernet driver etc...  for specific CPU in source code but for my Cortex M4?


Thanks

0 Kudos

873 Views
butok
NXP Employee
NXP Employee

Hi,

All platform specific code is in the fnet\fnet_stack\cpu directory => Add here your platform. Most close for you should be ARM Cortex-M4  MK60N512 (TWR-K60N512), which is in the fnet\fnet_stack\cpu\mk.

Compiler specific definitions are in: fnet\fnet_stack\compiler => Add here GCC-specific definitions.

Good luck,

Andrey Butok

0 Kudos

873 Views
maxmax
Contributor I

Hi,

Thanks you for your answers, I have a last question, what is the theoretical memory footprint of the FNET stack? I know it depend on features selected but just to have an idea.

BR

0 Kudos

873 Views
butok
NXP Employee
NXP Employee

Hi,

You are right - it highly depends on application features, platform and used compiler. So I am not going to do any "synthetic" footprint measurements.

But to have an idea: FNET TFP Bootloader (UDP/IP Stack, Shell, DHCP, TFTP Client and Server, Flash driver etc.)+ FNET Shell application (TCP/IP stack, Shell, DHCP, Telnet, Ping, DNS, HTTP Sever+ File system + Web pages, Flash driver etc.) runs on Lasco MK60N512, which has 24KB RAM and 128KB of FLASH.

Best regards,

Andrey Butok

0 Kudos

873 Views
butok
NXP Employee
NXP Employee

FNET 2.3.0 released (http://fnet.sourceforge.net):

- Passed the "IPv6 Ready Logo" Phase-2 IPv6 Core Protocols Conformance Tests, for host: IPv6 Ready Logo Phase-1/Phase-2 Self-Test Report
- Added the Path MTU Discovery for IPv6, which is disabled /enabled by FNET_CFG_IP6_PMTU_DISCOVERY.
- Other minor changes.

FNET 2.2.1 released:

- Fixed data corruption bug, that can occur using UDP services (e.g. DHCP) with enabled both IP4 and IPv6.
- Updated FreeRTOS specific code. Thanks to Christophe Graulle.
- Added basic BOOTP protocol support, as special mode of DHCP client service. Thanks to Peter Baertschi.
- New configuration parameters:
    - FNET_CFG_DHCP_BOOTP defines DHCP or BOOTP protocol to be used.
    - FNET_CFG_DHCP_PORT_CLIENT defines DHCP client port number.
    - FNET_CFG_DHCP_PORT_SERVER defines DHCP server port number.

Best regards,
Andrey Butok

FNET Community

0 Kudos

873 Views
albertolubeiro
Contributor III

Hi Andrey,

I am using phy DP83848C and kinetis K60

I have the clock out by the PTC3 pin.

The comunication with PHY via MDIO and MDC signals is OK. The problem appears  when i try to conect with a terminal like Hercules. It fails when the PIN 34 of phy is sourced by PTC3 and is always fine when is sourced by the oscilator signal.

Can you help me?

Best regards.

Thanks!


0 Kudos

873 Views
butok
NXP Employee
NXP Employee

FNET 2.2.0 released (http://fnet.sourceforge.net):

- Added support of the Qorivva Power Architecture:

    - Added support of MPC5668G.

    - Added support of CodeWarrior Development Studio for MPC55xx/MPC56xx Ver. 2.10.

    - Added Shell and Benchmark demo-applications for MPC5668GKIT. Without on-chip flash driver.

- Other minor changes.

FNET 2.1.1 released:
- Improved IPv6 support. Passed 80% of the "IPv6 Ready Logo" Phase-2 (Golden) Tests.
- Fixed wrong IPv4 group address mapping to Ethernet multicast address, for little-endian platform (Kinetis).


Merry Christmas and Happy New Year,
Andrey Butok

FNET Community

0 Kudos

873 Views
albertolubeiro
Contributor III

Hi Andrey,

Does FNET 2.1.1 work with CW 10.3?

Thanks!

0 Kudos

873 Views
butok
NXP Employee
NXP Employee

Hi Alberto,

The FNET was tested with CW10.2 only.

Going to check it with CW10.3 (for next versions of FNET).

Thanks,

Andrey Butok

0 Kudos

873 Views
albertolubeiro
Contributor III

Hi andrey,

Now I´m trying to implement FNET into my application. I´ve made a copy of vector table from Flash to RAM so i have VTOR to the new copy of the vector table.

Once this is done I think the next step is to configure the FEC registers. I´m using DP83848C. The cuestion is ¿all that i need to modify is in fnet_fec.h file?

Also i don´t understand why the following defines have that value.

#define FNET_FEC_MII_REG_ICR     (0x0010)   /* Interrupt Control Register */
#define FNET_FEC_MII_REG_PSR     (0x0011)   /* Proprietary Status Register */
#define FNET_FEC_MII_REG_PCR     (0x0012)   /* Proprietary Control Register */

looking at the datasheet of KSZ8041NL, I think they should be

#define FNET_FEC_MII_REG_ICR     (0x001B)   /* Interrupt Control Register */
#define FNET_FEC_MII_REG_PSR     (0x001E)   /* Proprietary Status Register */
#define FNET_FEC_MII_REG_PCR     (0x001F)   /* Proprietary Control Register */

Any help will be apreciated.


Thanks and best regards.

Alberto

0 Kudos

873 Views
butok
NXP Employee
NXP Employee

Hi Alberto,

1)  If you are using DP83848C. The documentation is here http://www.wvshare.com/datasheet/NS_PDF/DP83848C.PDF. See page 38.

2) Basic PHY registers (from 0x00 till 0x07) are the same for all PHYs I know. And they are the same for DP83848C.

3) Other registers are “Extended registers”. They are PHY-specific and can be different by meaning, number and value. These registers are not used by FNET FEC driver (can be printed for debugging needs only). Your mentioned registers are from this scope, – so you may change their definitions as you want.

Best regards,

Andrey

0 Kudos

873 Views
albertolubeiro
Contributor III

Hi Andrey,

Thanks for your response.

I´m a little lost, it seems the registers used are from 0x00 till 0x07 so if they are the same for all PHYs, ¿is the code also valid with DP8384C?

Thanks again and best regards

Alberto

0 Kudos

873 Views
spiderman
Contributor III

Hello Andrey,

I think there is a mismatch between FNET_IP4_ADDR_IS_MULTICAST macro and FNET_ETH_MULTICAST_IP4_TO_MAC macros, at least when FNET_CFG_CPU_LITTLE_ENDIAN = 1, as in our case, since we are working with K60 (fnet_mk60n512_config.h).

Let's say we have a multicast address = 224.1.120.121 = E0,01,78,79

if we make this call to setsockopt:

mreq.imr_multiaddr.s_addr = FNET_IP4_ADDR_INIT(224, 1, 120, 121);

mreq.imr_interface.s_addr = FNET_HTONL(INADDR_ANY);

setsockopt(socket, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *) &mreq, sizeof(mreq));

then it will be successful, but afterwards nothing received by fnet_ip_input_low because FNET_ETH_MULTICAST_IP4_TO_MAC reverses the bits.

if we reverse bytes and change the code into:

mreq.imr_multiaddr.s_addr = FNET_HTONL(FNET_IP4_ADDR_INIT(224, 1, 120, 121));

mreq.imr_interface.s_addr = FNET_HTONL(INADDR_ANY);

setsockopt(socket, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *) &mreq, sizeof(mreq));

then the call will fail because of FNET_IP4_ADDR_IS_MULTICAST.

The workaround that we have found is to change the FNET_ETH_MULTICAST_IP4_TO_MAC call:

from: FNET_ETH_MULTICAST_IP4_TO_MAC(multicast_addr, mac_addr);

into: FNET_ETH_MULTICAST_IP4_TO_MAC(FNET_NTOHL(multicast_addr), mac_addr);

what am I doing wrong?

What would be a clean solution to the problem?

Thank you!

0 Kudos

873 Views
butok
NXP Employee
NXP Employee

Hi Spiderman,

The fixed fnet\fnet_stack\stack\fnet_eth.c file is attached.

Tested on both little and big endian platforms.

This fix will be applied to the next FNET release.

BTW:

For future, please submit FNET bug reports here (to be sure that it will not be lost or missed) :

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

Thank you very much,

Andrey Butok

FNET Community

0 Kudos