I am using RIVERDI 7’inch display with STM32H7 microcontroller. I also have enabled LwIP and developed MQTT client which is working correctly. At that time I need to read a large JSON string in order to extract some data from it. For this action, I went to the mqtt_opts.h file in order to increase the incoming payload buffer size, which is: MQTT_VAR_HEADER_BUFFER_LEN and I set it from 350 to 1271 because thats the size I need to set, based on the recommendation "
/**
* Number of bytes in receive buffer, must be at least the size of the longest incoming topic + 8
* If one wants to avoid fragmented incoming publish, set length to max incoming topic length + max payload length + 8
*/
My payload length is 1215. When I did that it opens the function which I have create in order to extract the data and after the execution of the first line it crashes and leads me to that line of code, which I cannot understand why, because I don’t use my queue when this operation is occured:
/* Check this really is a semaphore, in which case the item size will be
0. */
configASSERT( pxQueue->uxItemSize == 0 );
The function that handles the extraction of data uses jsmn.h library and I have test it that it works correctly. Although, when I have the buffer size in the mqtt_opts.h file into 350 it doesn’t crash but it cant read all the message just a part from that. Am I missing something else? Do I need to increase also another parameter in order to work? What should I check in the debugging mode in order to figure it out?
I am subscribing to 6 different topics, could this lead to a problem with task size? I have set it to 9000*4. Manipulating that number of subscription could be difficult to handle a task in FreeRTOS?
I am running LwIP in linkerscript like this:
.lwip_sec (NOLOAD) :
{
. = ABSOLUTE(0x30000000);
*(.RxDecripSection)
. = ABSOLUTE(0x30000200);
*(.TxDecripSection)
. = ABSOLUTE(0x30000400);
*(.RxPool)
} >RAM_D2
The DMA Descriptors starts at the address 0x30000000, and together they occupy 608 bytes, i.e. 0x200 + 4×24. The Heap size is set to 14KB and the Heap pointer is set to address 0x30004000. I also configured this in the MPU_Region. My ETH_RX_BUFFER_SIZE is equal to 1536.
I don’t know what else to do. I would appreciate any response! Thank you in advance!