Hello, I have modified Erich Stygers Tutorial: lwip with FreeRTOS and the Freescale FRDM-K64F Board | MCU on Eclipse
to implement a Tcp_echo server, as a start, to eventually end up with a Modbus TCP slave.
I am using KDS3.2 and KSDK1.3 with FreeRtos and Processor Expert.
It compiles without errors but seems to hang at the blocking statement:
err = netconn_accept(conn, &newconn);
Using "Advanced IP Scanner" It identifies the server address 192.168.2.102 as "dead" and of course does not ping.
Has anyone succeeded In doing this type of project?
I have attached the project file with much appreciation for any advice.
Original Attachment has been moved to: LwipRtosPEecho.zip
So far we have been testing the attached project on our hardware without success. Then we realized a stupid mistake...
We are using a K64 in the 144 pin LQFP package instead of the 100pin as per the project settings.
We had not tested this project version on the FRDM-64F board.
Surprise, it works on the FRDM so it was not a software issue.
Now, after changing the CPU settings for the 144pin version, it is not working yet.
There are a few areas of uncertainty:
1) Is the KSZ8081 interrupt pin actually used and if so which CPU pin should it be tied to?
2) Is it necessary to set the MII pins in the pins settings table, in addition to the RMII pins?
3) The KSZ8081 documentation shows the RX & TX magjack center taps bypassed to ground with 0.1uF caps and not tied together. But in the FRDM, the center taps for TX and RX signals are both tied to +3.3 volts. Does it make any difference?
Thanks for your support
Yeah, there are two versions of FRDM-K64F out there (one with cap and one with not, confusing me), so I have the same three questions above as you. Have anyone answered it yet? I've put the 0.1uF cap and the 49.9R resistors (although KSZ8081 datasheet says it's not necessary) and tied it to 3.3V through a 0R resistor. Ping does not work. Remove 0R resistor and got the same thing. But I can say it “probably” is working because when I insert the Ethernet plug into RJ45 jack, LED link turns on.
Here is the setup that works for me:
1-- Do not use 49.9 ohm resistors
2-- Center taps are not connected anywhere
3-- The 0.1uF cap is not necessary
4-- I use a type Si-46014-F Magjack
The Tcp_echo finally worked with Freertos using processor expert.
Hope this helps...
I use a RB1RB1-125BAG1A type (FRDM-K64F original). Slightly different from yours (one center tap), but I´ll give it a try.
In a couple of days I´ll have the time to test it and I´ll let you know.
Thank you in advanced.
I´m using your project in my tests, by the way, thank you.
I´ve removed 49.9 resistors and 0.1uF caps, unfortunately ping does not work, but now all RJ45 jack leds turns on and yellow led blinks, even though my dos windows ping is closed. IP number is within the range of my network and is unique.
Other than that, I noticed a drop in current consumption (~30 mA).
I assume you schematic mimics what´s on FRDM-K64F as mine does?
Your clock source is 50 MHz, PEE, PLL and core 120 MHz, bus 60 MHz, external bus 40 MHz and flash 24 MHz.
Flash clock above 20 MHz freezes my MCU,I don´t know why.
Onother clue? My PHY is KSZ8081MLXIA, whats is yours?
I am using the KSZ8081RNAIA-TR chip which has the RMII interface. Your chip has the MII interface, but that should not matter. One good tool to see what is on your network is this:
I am using the K64 in the 144 pin package. The attached project uses Processor expert and FreeRTOS:
It is not the most elegant code but it was just a test. Perhaps you can compare the settings in PE.
I have tested it with Advanced IP Scanner. Nothing happens. There must be a hardware problem. In this project Ethernet is not a needed feature anyway. I will do further study and redesign it in the future weeks.
In the SDK1.3, we use the RTCS architacture to implement the ethernet protocol. In SDK2.x, we use LWIP to implement the ethernet protocol, the LWIP is straightforward.
Pls download SDK2.x based on FREERTOS and FRDM-K64F from the link:
after unzipping the package, you can refer to the directory for the TCP echo example:
Hope it can help you
Yes, I have tested the SDK2.0 and we will start using it when the Processor Expert replacement is available, for future projects.
But we have spent the past year developing our product with KDSK1.3 and Processor Expert.
The product includes 50 Sigma-Delta ADC channels, Two I2C, a Modbus TCP wifi and 3 SPI links, with multiple tasks under Freertos.
It will take months to rewrite everything. We cannot ship because the Ethernet link does not work.
So if there are obvious errors in the attached project I would really appreciate any help available.