Can I use ethernet on K64F without MQX or another RTOS?

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

Can I use ethernet on K64F without MQX or another RTOS?

Jump to solution
2,796 Views
alessiopaolucci
Contributor III

Hi, in all examples or questions I read the use of ethernet with MQX, so my question is...

Can I use ethernet on K64F without MQX or another RTOS?

Exists some examples or suggest for use it without an OS?

Best Regards!

Alessio

Tags (3)
1 Solution
1,917 Views
butok
NXP Employee
NXP Employee

You can also look at FNET embedded TCP/IP stack: http://fnet.sf.net

It supports K64.

View solution in original post

17 Replies
1,918 Views
butok
NXP Employee
NXP Employee

You can also look at FNET embedded TCP/IP stack: http://fnet.sf.net

It supports K64.

1,917 Views
vysakh
Contributor I

Hai Andrey Butok,

I am also looking for the same but using K60. Actually my application is to develop a deterministic Ethernet switch. I want to receive each Ethernet frame and check the type of frame then pass that frame or Discard according to the type of frame field in that frame..I Will not be dealing with Upper layer protocols..So I think, For me also MQX RTOS is not required. One more thing is, I need more speed for processing the frames and passing it(at least 100mb/s)..So I Worried that if I am using MQX I will not be able to get maximum utilization of controller since MQX also will be running some threads in back-end..Can i utilize the codes which you mentioned above for for K60) also..Please tell me if you have any example code for this application..

0 Kudos
1,917 Views
butok
NXP Employee
NXP Employee

>Can i utilize the codes which you mentioned above for for K60) also..

Yes. All Kinetis MCUs use the same Ethernet module, so they share the same driver


>I want to receive each Ethernet frame and check the type of frame then pass that frame or Discard according to the type of frame field in that frame.

You may put your "filter" code to the Ethernet-driver input function:https://sourceforge.net/p/fnet/gitcode/ci/master/tree/fnet_stack/cpu/common/fnet_fec.c#l453

0 Kudos
1,917 Views
vysakh
Contributor I

Dear Andrey,

While compiling my project with fnet stack, A File is giving lots of errors (fnet_ucosIII_isr.s) How to resolve this?

I am using TWRK60N512 and Code warrior 10.4 for development.

net_stack / os / ucosIII / fnet_ucosIII_isr.s

0 Kudos
1,917 Views
butok
NXP Employee
NXP Employee

This file is covered by:

     #if FNET_CFG_OS && FNET_CFG_OS_UCOSIII && FNET_MCF && FNET_CFG_OS_ISR

These all parameters are 0 by default. It look like you have a mess.

Anyway you may remove OS-specific files from you project.

BTW:

Please upgrade to CW10.6 and use the project from \fnet\fnet_demos\mk60n512\shell\cw10.6 as a reference to save time.

FNET is not supported by Freescale, so better to use the FNET dedicated forum:FNET - Embedded TCP/IP Stack / FNET User Forum / Discussion

0 Kudos
1,917 Views
alessiopaolucci
Contributor III

Hi Andrey, Thanks very much!

If I understand I need to initialize the ethernet and the timer module for fnet. Right?

There are some examples of initialization of ethernet module on k64?

0 Kudos
1,917 Views
butok
NXP Employee
NXP Employee

1. You can look inside Ethernet module initialization here:

FNET - Embedded TCP/IP Stack / Code / [19205a] /fnet_stack/cpu/common/fnet_fec.c

2.There is one more source for you - KSDK: http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=KDS_IDE

1,917 Views
alessiopaolucci
Contributor III

Hi Andrey,

I want to add fnet stack in my project. Wich are the configuration of fnet_user_config.h to set for kds and mk64fn1m?

The how to guide for the other parts is equal to CW?

Best Regards!

Alessio

0 Kudos
1,917 Views
butok
NXP Employee
NXP Employee

Hi Alessio,

Use configuration parameters from existing examples for KDS, for example fnet\fnet_demos\mk64fn1m\shell\kds2.0:

#define FNET_CFG_COMP_GNUC       (1)

#define FNET_CFG_CPU_MK64FN1        (1)

If some issues, you have always the reference.

Best regards,

Andrey

0 Kudos
1,917 Views
alessiopaolucci
Contributor III

If I use the frdm and so I do a flash build with openSDA I have to activate interrupt? Which peripheral use the stack in mk64 for timer? wich other interrupt I have to activate? I have to add this on startup_MK64FN...S?

Sorry for the questions but I have to undertand how work the stack

Best regards,

Alessio

0 Kudos
1,917 Views
butok
NXP Employee
NXP Employee

>Which peripheral use the stack in mk64 for timer?

PIT

>wich other interrupt I have to activate?

FNET uses Timer and ENET RX interrupts.

> I have to add this on startup_MK64FN...S?

Not needed. It is done by FNET ENET and Timer drivers during initialization.

You should have general startup and clock initialization (may reuse from FNET examples).



0 Kudos
1,917 Views
alessiopaolucci
Contributor III

Thanks Andrey, I have two errors while build the stack:

DescriptionResourcePathLocationType
make: *** [K64-ETH.elf] Error 1K64-ETHC/C++ Problem
undefined reference to `__VECTOR_RAM'fnet_mk_isr_inst.c/K64-ETH/Sources/fnet_stack/cpu/mkline 58C/C++ Problem
undefined reference to `fnet_mk_irq_enable'fnet_mk.c/K64-ETH/Sources/fnet_stack/cpu/mkline 75C/C++ Problem

how can I solve it?

0 Kudos
1,917 Views
butok
NXP Employee
NXP Employee

Set FNET_CFG_CPU_VECTOR_TABLE to your vector table address.

fnet_mk_irq_enable is defined in fnet_mk_low.s

0 Kudos
1,917 Views
alessiopaolucci
Contributor III

Sorry for the continuous questions but now I have this problems:

DescriptionResourcePathLocationType
stray '\' in programfnet_comp_asm.h/K64-ETH/Sources/fnet_stack/compilerline 266C/C++ Problem
stray '\' in programfnet_comp_asm.h/K64-ETH/Sources/fnet_stack/compilerline 256C/C++ Problem
stray '\' in programfnet_comp_asm.h/K64-ETH/Sources/fnet_stack/compilerline 261C/C++ Problem
stray '\' in programfnet_comp_asm.h/K64-ETH/Sources/fnet_stack/compilerline 251C/C++ Problem
make: *** [Sources/fnet_stack/cpu/mk/fnet_mk.o] Error 1K64-ETHC/C++ Problem
stray '\' in programfnet_comp_asm.h/K64-ETH/Sources/fnet_stack/compilerline 246C/C++ Problem
stray '\' in programfnet_comp_asm.h/K64-ETH/Sources/fnet_stack/compilerline 241C/C++ Problem
expected identifier or '(' before '.' tokenfnet_comp_asm.h/K64-ETH/Sources/fnet_stack/compilerline 240C/C++ Problem

how can I solve it?

0 Kudos
1,917 Views
ChrisTango
Contributor IV

Hi Andrey,

Thanks for the link to the FNET project! This seems to be the piece of code which I'm looking for a long while. :smileyhappy:

-Chris

0 Kudos
1,917 Views
alessiopaolucci
Contributor III

Thanks Mark for your answer! I began to observe and study the OpenTCP files, so I need some time to understan it. In future if you can help me, I write here again.

Regards

Alessio

0 Kudos
1,917 Views
mjbcswitzerland
Specialist V

Hi

If you configure the Ethernet controller and send data using its buffer descriptors you don't need to use any OS.

You can take existing initialisation code (also from projects using OS) as base since it has nothing to do with the OS itself.

Depending on what type of data you want to send you may need to develop a number of protocols to go on top of it though, which may take a month or two of work to achieve some basic operations to be compatible in a network. For a reasonable level of Internet protocol compatibility you may need to plan for 6 months to a year or two. During the work you may however decide to use an OS to simplify the management of the tasks and achieve reliability.

If you need just fairly simple TCP/IP you can take something like OpenTCP which doesn't include any OS or file system support: http://sourceforge.net/projects/opentcp/

You can also take LwIP without MQX and add your own scheduling and file system (if needed).

Regards

Mark