LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

target has run out of memory on LM3s8962

I'm using the LM3s8962 evaluation kit to record data from the ADC's.  I have the system set up so that I use the elemental nodes of the four adc's in a while loop, and replace the values in four different arrays.  The arrays are initialize (1x1000 elements) before entering the loop.  This works fine.

 

THE PROBLEM:  When I try to make the arrays larger (i.e. initial arrays larger than 1000 points, 4 individual arrays), I get the following error:

 

Error: Memory allocation failed. The target has run out of memory. [C:\Program Files (x86)\National Instruments\LabVIEW 2011\CCodeGen\libsrc\blockdiagram\CCGArrSupport2.c at line 253: 2 3

 

OR

 

Error: Memory allocation failed. The target has run out of memory. [C:\Program Files (x86)\National Instruments\LabVIEW 2011\CCodeGen\libsrc\blockdiagram\CCGArrSupport2.c at line 173: 2 3

]

 

Any suggestions?

0 Kudos
Message 1 of 4
(6,092 Views)

It looks like you're filling up the flash memory on the LM3S8962 with all of these array initializations.  According to page 263 of the LM3S8962 datasheet, that microcontroller has 256 KB of flash memory which you can use to fill up with your code.  In addition to your array initializations, some of this space is taken up by the LabVIEW Embedded Module-specific code as well.  What datatype are you using in these arrays?  Does this error occur upon building or running your code?  Thanks for any additional information you can provide!  

0 Kudos
Message 2 of 4
(6,088 Views)

@Th0r wrote:

It looks like you're filling up the flash memory on the LM3S8962 with all of these array initializations.  According to page 263 of the LM3S8962 datasheet, that microcontroller has 256 KB of flash memory which you can use to fill up with your code.  In addition to your array initializations, some of this space is taken up by the LabVIEW Embedded Module-specific code as well.  What datatype are you using in these arrays?  Does this error occur upon building or running your code?  Thanks for any additional information you can provide!  


That's probably it.  The error occurs when building the code, before it's actually able to run.  If reduce the array size, I'm able to run the code no problem.  At the moment,  I'm using a long 32 bit integer, which I know realize I can reduce significantly, as my ADC only reads at 10 bits.  Do you know if there's a way that I can preallocate the array to a place other than flash?

 

I've found a fix around it since I last posted, in which I set up a buffer (smaller) and then save the buffer values on the SD card.  This works well and I can sample for long periods of time, but it does slow down my overall sampling rate, so I'd like to fix the above problem nonetheless. 

0 Kudos
Message 3 of 4
(6,081 Views)

Unfortunately, I'm not aware of any way to load your program on anything other than the onboard flash memory.  I think the way to get around this would be some programming to avoid large array allocations.  The method you mentioned, involving offloading storage to an SD card, seems like a good way around this.  Hopefully it's a workable fix for the kind of acquision you're doing!

0 Kudos
Message 4 of 4
(6,073 Views)