Error=HTTPInsufficientMemory

Hello FreeRTOS friends,

I need some guidance with the following:

I have implemented a project with coreHTTP and mbedTLS that makes requests correctly.

The problem is the following: I need to capture a response that weighs 6.08 KB.

But it throws HTTPInsufficientMemory:

imagen

Any suggestions?

Thanks!

The error message is “Failed to send HTTP POST request to … :Error=HTTPInsufficientMemory”. That means you are running out of memory and the buffer is not large enough. Please try increasing the size of request and response buffer -

Thanks.

2 Likes

Hello @aggarg

thank you for the advice; changing this value allows me to make the request. Changing this value in the demo_config.h file:

#define democonfigUSER_BUFFER_LENGTH (7166)

imagen

But it doesn’t always work correctly:
imagen

Many times, even if the request is made, the sequence dies, losing the ping.

I am making adjustments in the memory because this could be the reason.

A thousand thanks.

edit: debug mode finish in void HardFault_Handler(void) when crash the app.

Did you increase both the request and response buffer?

Can you try to find what is leading to hard fault?

Also, instead of pasting images of logs, please paste the text as the images are hard to read.

Hi again @aggarg

It seems that I’ve identified where the issue is, in the logs. I always use LogInfo because LogDebug doesn’t print correctly for me. If I use this combination, the program doesn’t fail, although I can’t see headers, status code, or body on the screen.

However, if I use LogInfo for all of them, sometimes it works, and other times it triggers a hard fault.

notes: breakpoint in Status Code.

How can i fix?

thk

Everything points to the fact that the request, which is a JSON, doesn’t appear complete. This leads me to think that these variables need to be defined:

xResponse.bodyLen, xResponse.pBody

I do not think there should be any difference in LogInfo and LogDebug - the problem must be elsewhere.

We need to figure out the cause of the hard fault.

Are you receiving the complete buffer and it is getting truncated while printing OR are you not getting the complete buffer? Can you examine these values in debugger?