cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle asynchronous (data size of 240000 bytes) data from MQTT in STM32

dsalv.1
Associate II

I am using STM32L475 dev board and SIM7600 4g module. I have implemented MQTT communication in this project. I can successfully connect to MQTT broker and also able to receive the data. But the problem is size of data is large (240000 bytes ie 234.375KB).RAM available in this Dev board is 128 KiloBytes. I WANT TO STORE THIS DATA IN EXTERNAL FLASH MEMORY.

I am using UART with DMA. So whenever I get data on UART from SIM7600 module, MCU goes interrupt routine and there I can copy the content of rx_buffer into any other buffer for further processing.

I can see in debugger window, the "next_size" variable which counts the incoming data showing me size 244824 ie 240000 bytes plus the MQTT headers.

But when I call the functions of QSPI to store this data in External flash memory, MCU does not download the packets after first 512 bytes.MCU takes time(I assume) and It misses the other data. I can see "next_size" does not increase.

screenshot attached for reference0693W00000NsA2RQAV.jpg0693W00000NsA2CQAV.jpg

0 REPLIES 0