I have RT1170 EVK and I want to add ethernet application to my code. Can anyone please point me to the SDK application/driver in MCUXpresso SDK which I can use to add ethernet stack and a sample application to test it. My application needs UDP packet to send and receive payload.
Hello and welcome to the FreeRTOS forums! There are a couple of ways you can go with this.
The first way, and probably the most common at this point in time, is to use LWIP for your boards IP stack. This is demonstrated in our NXP RT1060 reference repository. The MCUXpresso software should be the simplest way to set this up - at least that’s what our reference integration used for the IDE.
The second way, and a bit more experimental, would be to modify the RT1060 driver recently added to the FreeRTOS+TCP repository for your board. Per the RT1170 EVK user guide, your 10/100M Ethernet interface is the exact same as the RT1060 so minimal modification would be necessary to get it working. This driver would not work however on your 10/100M/1G ethernet port. It also won’t easily support using both network interfaces as our current +TCP main branch only supports IPv4.
I suspect LWIP will be the way to go for now. This NXP page describes several RT1170 demos, at least one of which uses LWIP. I’d start from that demo and copy/modify the code for your use case.
Thank you for the response. What is the difference between LWIP. I understand that it is light weight but apart from that how much it differs from second way? Using LWIP, Will performance has any impact ?
For a comparison between LWIP and FreeRTOS+TCP see this thread which I realize is quite old but gets to some of the fundamental design choices between the two.
The ‘light weight’ naming is due to the small overall code size which is intended to be used on MCUs.
There shouldn’t be any fundamental differences in what you can achieve with either LWIP or +TCP. FreeRTOS+TCP was introduced to follow a familiar interface (Berkeley sockets) so and has a couple nice-to-haves baked in - zero copy for example.
Thanks for writing to the forum.
Just wanted to add a few more things.
FreeRTOS-Plus-TCP is a scalable, open source and thread safe TCP/IP stack for FreeRTOS maintained by Amazon Web Services.
The stack is misra compliant, unit tested, CBMC proofed and Protocol Tested for IPv4 using the Maxwell Pro Tester.
You can refer to a similar discussion in this thread FreeRTOS-plus-tcp-vs-lwip
We do have a driver for NXP1060. You can use this as reference for 1170 driver and we will be more than happy to guide you in the same.
It will be great to get some help in up and running the TCP/IP stack on 1170. I will look into the pointers you & Kody provided. If you have any additional information, please share with me.
Hello iBond, do you plan to use both network interfaces on the board?
I would like to do daisy chain of both the network to other modules, is that possible? So one will be connected to the Host PC and the other will be connected as daisy chain to other 1170 module. But to start with I would like to have one interface up and running. Any guide on how to port the TCP to 1170 and then run an application will be very helpful.
RT1170 and RT1060 seems to differ in the way that RT1170 has 2 10/100M ENET ports and RT1060 has only 1 of them. So, the RT1060 driver should be a very good reference , just that 2 ports will have to be initialized in case of RT1170.
I found a good guide online from NXP Semiconductors describing the porting from RT1060 to RT1170 at https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwib3bTtgI7-AhWBhFwKHaWuCOQQFnoECBQQAw&url=https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN13106.pdf&usg=AOvVaw1hR8Qx-0VkQBQD2zOeQP7C
Thanks again, so where should I start? Shall I start with NXP1060 driver? How to download the files from “FreeRTOS/FreeRTOS-Plus-TCP/pull/801/files”? After downloading what am I suppose to do?
Or shall I clone the below repo:
"on github FreeRTOS/FreeRTOS-Plus-TCP "?
After cloning what are the steps to add TCP to my own project? Do you have any step-by-step guide which I can follow?
Yes, please clone the repo.
The following tutorial should be useful - TCP networking tutorial
Thanks, will these repo and tutorial work for Windows environment ?
Yes they will!
Also, if you would like to build a (very crude) demo for NXP1060, you can find it on my fork in this folder. I know it says that the folder name is ‘defender’ but that is just the existing demo I modified.
If you face any problems building it, let us know and we will help you out.
P.S. I’ll try and clean up the demo and the folder of the demo that I posted above.
I can see that the repo shared by Aniruddha submodule mcux-sdk from NXP. I see that the file
fsl_phy.h exists in the components/phy folder of mcux-sdk which is in the included in the search path here - iot-reference-nxp-rt1060/.cproject at AddTCPDemo · AniruddhaKanhere/iot-reference-nxp-rt1060 · GitHub
Did you clone the above repo with submodules?
As Gaurav pointed out above, you should clone with all the submodules.
I suggest doing
git clone https://github.com/AniruddhaKanhere/iot-reference-nxp-rt1060.git <YOUR_PATH> cd <YOUR_PATH> git checkout AddTCPDemo git submodule update --init --checkout --recursive