Recently I had to raise PPP again on STM32.
The first part .
The task was complicated by the requirement to use TLS 1.2 and send data on the MQTT.
')
Recall that MQTT and TLS are above TCP (
google osi) .
A quick search gave meager results table
Amazon FreeRTOSvery similar implementation from STIn the first version, there were about 10 different architectural platforms. As often happens, the chip has already been selected and sealed to the board (STM32F429).
His closest relative on the list was L475, under stm32l475_discovery, respectively
On this distinction did not end, WI-FI ISM43362-M3G-L44 is used in discovery, it added difficulties in understanding the work.
A few days of stupor in the monitor. Practically not a single line of code. When the project was ported, TCP did not work as expected. I saw getting the ip from the hostname, establishing a connection, a few ack and a server side break.

A simple replacement of the API from WI-FI to the implementation of lwIp sockets was not enough
Obviously MbedTls didn't work.

At some point I got confused and decided to look at the
second option .
This idea turned out to be more successful.
The starting point was chosen
B-L475E-IOT01 .
And then it went!
The code was much clearer.
The project is logically divided into two parts:
- controller level (wifi, HAL, gpio, etc.)
- AWS (Projects / Common / AWS)
Removed all unnecessary.
Added my part from GSM and PPP.
I started a PPP session.
Read the readme in git of lwip itself, everything is pretty chewed up there .
The latest version of lwIP (2.1.2) shows improvements in terms of PPP.
The whole point is to create a pcb, set the authentication and call something like this:
ppp = pppos_create (& ppp_netif, output_cb, status_cb, ctx_cb_callback);
.
In the ctx_cb_callback callback, you should get the latest PPP status to know when the connection is established and you can turn on the top level, or when a break has occurred.
Then I turned on the output of mbedTls logs and it turned out like this:

This of course is more interesting, but the cycle hung endlessly on the handsheets. Some googling led to a tip to update the latest version of mbedTls.
After that I got what I wanted:

And of course, I was very pleased with the data that came in the aws admin panel:
TotalTLS 1.2 on the microcontroller is real!

It is useful to use fresh versions of libraries. Never give up, look for other directions if you are at a dead end :)