7 years, 8 months ago.

Out of memory error message during compile time

I am getting an error when I try to compile my code and I are trying to understand what's wrong and if there are anyways of using more ram. This is the error message I am getting:

L6406E " No space in execution regions with .ANY selector matching xcp_prot.c.LPC1768.o(.bss)." in file "/" L6407E " Sections of aggregate size 0x87f8 bytes could not fit into .ANY selector(s)." in file "/"

Does this mean that I am out of RAM? I have read on http://mbed.org/handbook/Memory-Model that I have access to 32KB RAM. Is it somehow possible to get access to the memory dedicated for the peripheral drivers? My application is only going to use Ethernet so it would be great if I could get rid of the RAM dedicated fro USB and CAN. Is the memory dedicated for USB required to flash mbed or is it possible to flash it through Ethernet or through another interface?

I have also read that it should be possible to add external RAM through SPI. Can I then tell the compiler how to access the ram, and tell it how much extra I have added? My first question has to with adding more ram. I have seen that it is possible to add more ram via SPI. Is it then possible to tell the compiler somehow? How would the compiler understand how to access the ram?

1 Answer

7 years, 8 months ago.

You cannot use external RAM for that, well at least not for normal runtime operation. SPI RAM would be way too slow, and the LPC1768 has no external memory bus. You can of course store data there, but you have to manually program it to do that.

Regarding the USB memory, you can search around here for some methods to put it in other memory blocks: http://mbed.org/search/?type=&q=AHBSRAM0. But it is limitted what you can do with it, it is possible though.

Aditionally you should wonder if you cannot simply reduce your RAM usage. For example defining everything that never has to change as 'const', then it is placed in flash instead of ram.