µTasker Forum

µTasker Forum => NXPTM M522XX, KINETIS and i.MX RT => Topic started by: alager on July 12, 2010, 10:00:07 PM

Title: OUR_HEAP_SIZE increments
Post by: alager on July 12, 2010, 10:00:07 PM
Mark,

My project has run to the limits of the chip I'm using, and I ran out of stack space.  After a lot of squeezing here and there, I changed the OUR_HEAP_SIZE define.
Code: [Select]
#define OUR_HEAP_SIZE (HEAP_REQUIREMENTS)((22*1024)*MEM_FACTOR)
to
Code: [Select]
#define OUR_HEAP_SIZE (HEAP_REQUIREMENTS)((43*512)*MEM_FACTOR)

I don't know enough about the memory structure to know if this is an issue or not.  Things seem to be working for now.
HEAP   Free 0x0194 from 0x5600
STACK   Unused 0x00d7
Prior to the heap change, I had no stack left. 

What are your thoughts on changing from 1024 to 512? 
Thanks,
Aaron
Title: Re: OUR_HEAP_SIZE increments
Post by: mark on July 13, 2010, 02:23:22 AM
Hi Aaron

You are certainly quite close to the RAM limits (from the results you have 404 free bytes on heap which may be able to be given for stack use).

(43 * 512) is the same as (21.5 * 1024). The * 1024 is used so that the first figure represents kBytes - also (21.423 * 1024), etc.  would be OK if you prefer to think in kBytes. The value is first calculated by the compiler as a float value and then rounded to nearest integer.

Regards

Mark