µTasker Forum
µTasker Forum => NXPTM M522XX, KINETIS and i.MX RT => Topic started 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.
#define OUR_HEAP_SIZE (HEAP_REQUIREMENTS)((22*1024)*MEM_FACTOR)
to
#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
-
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