False "Out of memory" on 5441x

Discussion to talk about software related topics only.
Post Reply
lslarry86
Posts: 24
Joined: Tue Jul 18, 2017 12:28 pm

False "Out of memory" on 5441x

Post by lslarry86 »

Yesterday I was running along developing on my 5441x system, IDE 2.8.7, and I started getting false "Out of Memory" errors on code load. The first time it happened, I was going from a Run build to a Debug session with no source changes. My build uses less than 5% of memory, see screenshot. I powered down the development system and PC overnight. This morning, same story. It won't even load the Run build.

Any hints? What causes this?

Image
User avatar
pbreed
Posts: 1080
Joined: Thu Apr 24, 2008 3:58 pm

Re: False "Out of memory" on 5441x

Post by pbreed »

The out of memory error on Load has nothing to do with staticly allocated memory.
(Whets reported in the build)

It has to do with memory that is malloced or newed.

When you run autoupdate it attempts to malloc a buffer to hold the image.
If this fails you get that error.

To figure out how much free memory you have at run time call:

@include <bsp.h>

DWORD spaceleft();
lslarry86
Posts: 24
Joined: Tue Jul 18, 2017 12:28 pm

Re: False "Out of memory" on 5441x

Post by lslarry86 »

That's good info. My application uses opensll as a library, so some dynamic allocation may be in play. But this happens right after boot, before any openssl lib functions are called.

Based on what you wrote, I rebooted to the boot loader and then sent the factory test image from the IDE. Back in business.

Thanks,
Larry
User avatar
pbreed
Posts: 1080
Joined: Thu Apr 24, 2008 3:58 pm

Re: False "Out of memory" on 5441x

Post by pbreed »

The MOD5441X has 64M of memory, so I can't imagine why its out of memory?

Whya are you are using openssl rather than the Netburner SSL implementation?
A whole lot better performance, and a lot less memory?
lslarry86
Posts: 24
Joined: Tue Jul 18, 2017 12:28 pm

Re: False "Out of memory" on 5441x

Post by lslarry86 »

> Why are you are using openssl rather than the Netburner SSL implementation?

I needed ECDSA for a project, which is not provided by NB, and decided to go all the way and port openssl to NB. That decision enabled the current project to quickly bring in standard des, 3des and MAC libraries.

The memory problem seems to be associated with Debug mode. I put a loop counter in main() that prints on UART0 every few seconds. As long as I stay in Run mode, the counter prints on schedule and code load always works. As soon as I load a Debug build, the counter fails, indicating that the main loop is not executing. I also get false positives on dataavail(). UART0 is unresponsive to commands and new code load fails until I drop out to the bootloader. So it's back to printf debugging for a while.

I ported openssl in 2018, and this problem is new, so that is not the problem here.
User avatar
pbreed
Posts: 1080
Joined: Thu Apr 24, 2008 3:58 pm

Re: False "Out of memory" on 5441x

Post by pbreed »

The current netburner SSL release supports ECDSA.
Post Reply