Handling Large MQTT Payloads (>2MB) on EG915U with STM32Gx Memory Constraints

Current Setup & Success

I have a system where an STM32Gx controller communicates with an EG915U LTE module via UART using DMA. The STM32 uses an AT command set to manage MQTT subscriptions.

The MQTT reception is configured correctly:

  • AT Command: AT+QMTCFG="recv/mode",1,0,1
  • Behavior: The module generates a URC (Unsolicited Result Code) for each incoming message. The URC includes the message length, and the payload is delivered directly after it.
  • Implementation: The STM32’s DMA has an Rx buffer of 4.5 KB. Upon receiving a URC, the firmware parses the header and then reads the payload into this buffer.
  • Status: This logic works perfectly for messages under 4.5 KB.

The Core Challenge

I now need to receive a single MQTT message with a payload of 2 MB. The EG915U module’s documentation suggests it can handle large payloads in URC mode, but my STM32’s DMA buffer is limited to 4.5 KB, creating a fundamental bottleneck.

The central question is: Can the incoming MQTT payload be streamed directly to a larger storage medium (like UFS) or a peripheral (like another UART/SPI) without being fully buffered in the STM32’s RAM?

My primary goal is to find a method that avoids buffering the entire 2 MB payload in the STM32Gx’s RAM.

  • Has anyone successfully implemented direct-to-file storage for large MQTT messages on the Quectel EG91x series?
  • Are there known AT commands or firmware features that enable data streaming to UFS or peripheral redirection?
  • Any feedback on the feasibility of the “Data Pump” or “Hardware Passthrough” strategies would be greatly appreciated.

Thank you for your assistance.

The downlink data received by MQTT cannot be directly saved to UFS. Usually, a host is needed for intermediate transfer. HTTP can directly save to UFS. Can you use HTTP then?