1
votes

I am using STM32F7 with development board Nucleo-F746ZG. I have activated UART, LWIP middleware and its PPPoS support.

I can make STM32F7 communicate with Telit GL865 GSM modem by using AT commands over UART, (i.e) make the modem establish static IP of its SIM card and checking pings, it is all OK.

However, I want LWiP PPPoS to establish the static IP instead AT commands just after sending ATD*99***1#.

I deeply searched the web and could not find a particular example that contains LWiP PPPoS Server for STM32F to communicate with Telit GL865 GSM. I have seen codes like

sio_fd_t ppp_sio = sio_open(sio_idx);

However, I could not relate them with STM32 cube functions.

I have seen examples that are using pppInit(void), pppOverSerialOpen(PPP_SERIAL_PORT, linkStatusCB, &connected) functions, but I guess those commands are not supported for the current stack.

Did anyone relate the STM CUBE's uart handle with PPPoS of LWiP stack? Do you have any initialization outline or advice to start with and continue to obtain the static IP? (i.e INIT, DISCONNECTING, DISCONNECTED, CONNECTING, CONNECTED, LWIP loop)

Kind Regards

1

1 Answers

1
votes

Sio is the "Serial IO" interface layer, implemented by a specific port (specific platform). Once implemented, the TCP/IP stack handles the rest including PPP negotiation and configuration (LCP/IPCP etc.), which includes obtaining IP addresses (own IP, gateway, netmask, dns1, dns2). Therefore all you need to do is to implement the low-level functions that read and write data over UART. The responsibility for handling PPP is on the TCP/IP stack's end.

While I don't have the exact implementation for STM32, it should be easy enough to implement it yourself. How it's implemented may (or may not) depend on your own configuration, e.g. whether or not you use FreeRTOS and therefore its queues/mutexes to handle UART communication. For overall description of how all components are generally layered in TCP/IP stacks in relation to PPP - I gave an answer some time ago here: STM32 LWIP PPPos implementation.

When it comes to LwIP's sio layer, a quite good documentation can be found under here: http://lwip.wikia.com/wiki/PPP. How the functions should behave is also described quite well in the common lwip/src/include/lwip/sio.h header file.

A sample UNIX implementation, in case you find it useful, can be found here: https://github.com/dreamcat4/lwip/blob/master/contrib/ports/unix/netif/sio.c