cancel
Showing results for 
Search instead for 
Did you mean: 

PPPos Lwip Issue

RPC
Associate II

Hello everyone,

Today I'm writing to you because I'm trying to implement a PPPoS connection over the USB CDC Host of a STM32H745. The modem I'm trying to connect to is a SIM7500 of SimCom.
I managed to establish the connection between the modem and the mcu because I can see in the status callback the case PPPERR_NONE.

The problem is that even after establishing the connection, when I try to ping the ip that the SIM has assigned I cannot get a response. I tried to debug and I am able to see the ping received on the MCU side. It tries to respond and it but it never reaches te computer from which I sent the ping. If I'm not in PPP mode and I set up the PDP context I can ping the modem without any problem, so the ip is reachable.

Any ideas how should I proceed to debug that?

Thank you very much in advance

 

 

<!!!UPDATE!!!>

Seems like I haven't enabled the checksum generation and checksum control for lwip and I was sending packages with a 0x0 checksum.


For me worked enabling it with those 2 defines:

#define LWIP_CHECKSUM_CTRL_PER_NETIF 1

#define CHECKSUM_GEN_IP 1

Now I'm trying to open a tcp connection but seems like I have a problem with the routing. If anyone have an idea about how can I solve that I would appreciate.

Cheers

3 REPLIES 3
RPC
Associate II

UPDATE

I managed to make it work.

First I had to define LWIP_HOOK_IP4_ROUTE function because I'm using 2 interfaces and the pppos is not the default one.

And second I had to add 2 defines for checksum check tcp and for checksum generate tcp.
#define CHECKSUM_CHECK_TCP 1
#define CHECKSUM_GEN_TCP 1

Now everything is working fine.

Hope this helps if you have the same problem I had!

Cheers!

RPC
Associate II

Does anyobody knows why I can process the tcp requests but not the http requests and half of the messages are dropped due to bad FCS?
Also, I can send pings of 16 bytes or less, but pings bigger than that are again being dropped.

Did anybody had this problem? Any ideas of how to solve that?

Thanks in advance!

RPC
Associate II

Hello again, I managed to solve the issue mentioned before:

Seems like the USB_CDC_Class if its FS(Full Speed) the maximum size that can receive at once is 64 bytes, so bigger frames than that were coming fragmented.
The solution was to detect the begin of a PPP message and wait for the end among the incoming frames.
The begin is a 0x7e and the end is the same.


Hope this helps if you encounter the same problem.

Cheers!