This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello
I was using the C2000ware LWIP-UDP example and simply modifying it into my own code. I just used it to send and receive and communicate with CPU1 by using IPC.
I am wondering how I can modify lwip-udp example or lwip example into TCP. I found that there might be some example between these two examples. I copied code in enet_lwip_udp.c from the enet_lwip_udp example and pasted in enet_lwip.c in the lwip example and built it and failed. Looks like there might be some more difference between these two projects. Are there any file to tell the difference between these two project except the .c file which has the main function? I am new to ethernet function and need to compare these and see how I can go further and modify any of these two into TCP
I found the tcp.c file in the C2000 but have no idea how to use it. I have no idea if I need to do more changes in LWIP exmaple other than just calling functions in TCP.c. There are tons of files in the examples and I have no idea where to start and which file can help me better understand this function
I do believe the LWIP exmaples in C2000 are very useful but maybe some .pdf documentations are needed for us starters to use it. It is stupid to use a SPI2ethernet chip when using 28388 just because we have no idea how to fully use the powerful MCU
Thanks
Hello Yifu,
We have assigned this thread to our expert. He is currently OOO, but will provide a response once back.
Thanks,
Hi Yifu,
For TCP, you can refer the file tcp.c located at <C2000WareInstallDir>\libraries\communications\Ethernet\third_party\lwip\lwip-2.1.2\src\core\tcp.c . The file header of this file provides instructions for TCP implementation.
Best Regards
Siddharth
Hello
I saw this file and looks like I can use it. The problem is, for example, I use tcp_bind function in my file and complied it. Error code is like this. I modified the lwip-udp project. Maybe I need to do some more include<>? or modify other files than enet_lwip_udp.c?
Hi,
If this function (tcp_bind) is added to tcp.c and referenced in enet_lwip_udp.c , then you need to make it extern so that it is visible out of the file.
extern err_t tcp_bind(struct tcp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port);
Pls try to add this line and check if it resolves the issue.
Best Regards
Siddharth
This is originally in tcp.c so no need to add it into there. I added this in tcp.c and enet_lwip_udp.c and neither works. I found there is no extern err_t udp_bind(struct udp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port) in enet_lwip_udp.c and udp.c but it works. Do you have no idea why?
Hi,
In case of UDP, the macro LWIP_UDP is set to 1 which includes the lwip/udp.h which has a declaration for the udp_bind function. Hence it is working fine.
This macro is configured in the lwipopts.h header file .
There is a similar macro for TCP which needs to be enabled
#define LWIP_TCP 1
You can try it out.
Best Regards
Siddharth
Hello
Looks like it works and I can compile it successfully. Thank you for your help. I will try this later to see how to modify it into TCP futher. Will go back to you if there are any questions.
Thank you so much
Yifu