Hi,
(MQX3.5.1, CW7.1.2, 52259evb)
I am having stack overflow problems when I add a new task, or, increase the stack on an exsisting task (by looking at the TAD stack usage), I assume this means I am out of RAM, or, the task stack space is limited.
The application ram usage (approx):
14KB of normal RAM usage
16KB worth of task stack (14 tasks in total)
I run RTCS (UDP only), ittya, ittyb, ittyc, GPIO, RTC, 6 Analogue pins, FlashX, and the SPI.
Does this sound like it would use all the availlable RAM?
I cannot see anything in the TAD or the MQXUG that details how to check the memory limits for your custom BSP.
Is there any hints or points as to how to check the RAM limits (other than task stack)?
Hi Carl,
I haven't tried the following so if you do please let us know the results:
The mqx/source/tad sources are compiled in PSP library already. The customer may enable "tad" shell command to execute Shell_tad function (of the shell library). So far, this only supports lightweight memory dumps and stack usage - but they can extend it by-example to suit what they need.
The quick code-based way how to display at least the high-watermark of RAM usage is
_mem_get_highwater() /* for full memory allocator */
or _lwmem_get_highwater() /* for lightweight allocator */
Regards,
David
I wrote some simple code that runs from my main task (highest priority) every 1mS
#ifdef MEM_DEBUG MEM_HIGH_WATER_BUFFER = _mem_get_highwater(); if(MEM_HIGH_WATER_BUFFER > MEM_HIGH_WATER) { MEM_HIGH_WATER = MEM_HIGH_WATER_BUFFER; printf("HIGH WATER = %X\n", MEM_HIGH_WATER); }#endif
Everything seems to go well until the high water goes over 0x2000F000.