Hi Hein,
GitHub has been delivering this issue as email, and I have been answering those messages. I guess GitHub was requoting the previous response, which is why the earlier notes quoted the thread. I have created an account on the FreeRTOS forum so that I can post the follow-ups here, as you asked.
These are the points already answered on 14 October:
- Azure IoT Hub does not answer ICMP, so a ping of `iot-prod1.azure-devices.net` does not produce a result.
- There is one MQTT client (azure-iot-sdk-c 1.3.8). A new TCP port is opened only after the previous socket is already dead.
- Local MSS stays 1160 (`ipconfigNETWORK_MTU` 1200). `MSS change 1160 → 1460` is the value Azure advertises.
- `ipconfigTCP_KEEP_ALIVE` is 1, interval 20 seconds.
- `shutdown_socket()` from your 10 October note is already in both the application and the bootloader. It checks the socket before `FreeRTOS_shutdown()`, then calls `FreeRTOS_closesocket()`.
These are the new questions:
- The CPU is a Microchip ATSAME70Q21B (Cortex-M7), on our own board, using the GMAC.
- `vPrintResourceStats()` was not being called. The MAC task will call it on each wake. `ipconfigCHECK_IP_QUEUE_SPACE` is 1.
- There is no hub in the path.
This is a failure at a client site whose network is running poorly. Capturing logs from that site is not possible. The slow network in the lab is how I reproduce the failure I am seeing there. It is the reproduction of the field problem, and it is the reason I am running it.
These are the changes going into the next run. I will send you the failure log from it:
- TCP lines will be prefixed with `xTaskGetTickCount()`.
- `shutdown_socket()` will use your later copy: `xSocketValid()`, the `shutdown_socket: start` and `shutdown_socket: done` lines, a wait of up to 5 seconds, then `FreeRTOS_closesocket()`.
- The MAC task will call `vPrintResourceStats()`.
The call that does not return is `FreeRTOS_send`. The log shows `FreeRTOS_send: … no space`, then the hub RST, then `eESTABLISHED → eCLOSED`, and the caller does not come back.
Steve