有给FreeRTOS TCPIP协议栈增加PPP支持的(PPPOS)打算吗?

有给FreeRTOS TCPIP协议栈增加PPP支持的(PPPOS)打算吗?
用来连接4G模组,不使用AT指令,使用PPP。AT指令太慢了,而且不容易处理复杂情况。

Hello @hane_vv, can you rephrase your question into English please?

This is what Google Translate gives -

Any plans to add PPP support (PPPOS) to the FreeRTOS TCPIP stack? Used to connect 4G modules, do not use AT commands, use PPP. AT commands are too slow and not easy to handle complex situations.

@aggarg, good idea, to feed the contents to a translator.

As far as I know there are no plans yet to add PPP support. But it might be possible that someone has developed it and is willing to share that with the community.

Hello @hane_vv. Thanks for posting this question. I asked around and found that we do not currently have plans to add PPP (PPPoS) support to the FreeRTOS TCPIP stack.

I’m not an expert in PPP myself but you might be in luck. It looks like there are several FreeRTOS users over the years who’ve implemented PPP in one form or another (example 1, example 2, example 3). I can’t vouch for how these will work for you. There is also a post on implementing your own, if you’d like.

I am trying to add pppos function to freertos-tcpip.
I set ipconfiguse_ DHCP = 0, when the program starts to run, I give FreeRTOS_ Ipinit() function invalid IP, mask, gateway, DNS, etc.
When I get the IP address through the 4G module, I directly call FreeRTOS_ Setipaddress() function and xnetworkaddressing.ulDNSServerAddress = ppp->ipcp_ Is dns1 OK.
Do I need to stop FreeRTOS TCPIP and reinitialize it?
image

The struct xNetworkAddressing is for internal use only.

It would be correcter to call:

FreeRTOS_SetAddressConfiguration( ppp->ipcp_ip,
                                  NULL,
                                  NULL,
                                  ppp->ipcp_dns1 );

I see a submask of 0, which is problematic. Normally submask will be 255.255.255.0 or 255.255.0.0.

Note that the endianness must be set correctly:

uint32_t ulSubmask = FreeRTOS_htonl( 0xFFFFFF00 );

Changing the MAC address after calling FreeRTOS_IPInit() is problematic: the new MAC-address will have to be programmed into the EMAC peripheral.

At the beginning of the program, I first call the “freertos_ipinit()” function to give fake IP, mask, gateway, DNA, and MAC (MAC is invalid under pppos). After obtaining the IP and DNS through the 4G module, call the “freertos_setaddressconfiguration()” function to update the IP and DNS.
At the same time, modify the ARP part. No matter which IP MAC the protocol stack looks for (except broadcast IP 255.255.255.255), I will return a unused value (MAC is invalid under pppos). After the pppos receives the IP packet, I add the Mac and Ethernet frame types in the front and then send them to the protocol stack. Similarly, MAC and Ethernet frame types are removed during transmission.
Do you think this is OK? Is there anything else to note?