[En-Nut-Discussion] Thread Stack High-Tide Monitor
Jared Broad
jared.broad at infact.co.nz
Tue Oct 2 21:48:08 CEST 2007
Hello List (apologies for repost, original didn't attach source files),
Following up on my earlier post regarding monitoring the thread stack I
thought I would post our solution. The following code is a high-tide
mark tester which fills the buffer with 0xFEEDABBA and then when the
stack check routine is called it counts the instances of this code and
displays a percentage used.
Application.c
=> This routine needs to be included in your application
=> TRACE() is our RS232 comm's routine, you can delete/replace with your
own.
=>This function counts the number of FEEDABBA's
=> Our application will use this routine to return true if stack is OK.
Nut\arch\avr\os\ context_gcc.c
=> Insert new file, rebuild NutOS.
=> Provides global for stack test to access number of threads
=> Generates initial 0xFEEDABBA buffer
-----------------------------------------------------------
FILES HOSTED: http://www.jaredbroad.com/Stack-High-Tide-App.rar
-----------------------------------------------------------
Courtesy of Dave Marshall & Jared Broad =)
Regards,
Jared
Jared Broad
Embedded Design Engineer
More information about the En-Nut-Discussion
mailing list