10 years, 5 months ago.

FRDM-K64F- Ethernet / Webserver

Hi,

has anyone got some code running for the FRDM-K64F using Ethernet/ TCP-IP or a web server. I tries several available in mbed, but non compiled correctly.

Klemens

Can you share which one you have tried? Which did not even compile? That should be reported.

posted by Martin Kojtal 19 Jun 2014

I tried for example: WebsocketEthernet_HelloWorld;

Compile error:

Error: Cannot open source input file "cmsis_os.h": No such file or directory in "EthernetInterface/lwip/lwipopts.h", Line: 28, Col: 22

Not clear which librayr to add.

Klemens

posted by Klemens Waldhör 19 Jun 2014

I tried also HTTPServer_echoback running with the FRDM-K64F board. It does not compile because of Error: #error directive: The Ethernet Interface library is supported only on the mbed NXP LPC1768 in "EthernetInterface/EthernetInterface.h", Line: 24, Col: 2

posted by Klemens Waldhör 19 Jun 2014

3 Answers

10 years, 1 month ago.

Did you ever get anywhere in getting a working Ethernet library on the K64F?

no

posted by Klemens Waldhör 24 Sep 2014

I know of others having fully functional enet on the K64F, after some intiial issues. For sure that last problem above is from not updating libraries.

posted by Erik - 24 Sep 2014

@labmanuser, what is not working ?

posted by Martin Kojtal 24 Sep 2014
10 years, 1 month ago.

I managed to create a webserver on K64F, and it is working fine, here are some of the steps you need to take: 1)import EthernetInterface library, and update it to latest version (it has the K64F compatibility) 2)import mbed-rtos library as well 3)import mbed-src library. 4) delete mbed library from your program.

then try the following piece of code

EthernetInterface eth;

   eth.init();
    eth.connect();

         printf(" IP address: %s \r\n",eth.getIPAddress());;

in order to make a webserver you need to bind a tcp port as well like

TCPSocketServer server;
server.bind(port); //where port is 80
    if(server.listen() != 0);

 int32_t status = server.accept(client);

if (status>=0)
{//
webpage here
}

Thanks for sharing. Just a side note, mbed lib should work as well. It used to be true (to use mbed-src) when mbed library did not include either an important bugfix for K64F enet or ethernet support.

posted by Martin Kojtal 24 Sep 2014