[En-Nut-Discussion] how to use the NutTrace ?

Brett Abbott Brett.Abbott at digital-telemetry.com
Sat Jan 20 22:18:56 CET 2007


Ive used the NutTrace functions with some success, hopefully the 
following is the right way....

1. re-compile the required library with the appropriate DEBUG line 
enabled/uncommented. - I use a full recompile using NutConfigurator.
2. Fully relink your application (in ICCAVR use shift f9)

if you dont compile the library, fully recompile using configurator, and 
fully relink your app, you can sometimes get strange, intermittent 
issues due to memory structures changing slightly in location.

3. In your main app, call the NutTrace function which enables the trace 
function after the desired target stream is initialised.  This sets the 
local trace flag in the library in question.  see example below for 
chat.c  You should pass the stream/device pointer to this function - you 
can send debug to uarts or (i think) any stream.

4. remember, when removing the debug option, recompile the library, 
recompile all libraries (nut configurator), and then fully relink your 

// tell your application about the NutTraceXXX function
void NutTraceChat(FILE * stream, u_char flags);

// Tell the trace function to send trace data to the uart  (uart must be 
already opened/initialised)
NutTraceChat(uart1, (u_char)1);

Good luck

Michael Gong wrote:
> Any advices on how to use nuttrace are welcomed !
> Thanks.
> Mike
> ----- Original Message ----- 
> From: "Michael Gong" <mwgong at cs.toronto.edu>
> To: "Ethernut User Chat (English)" <en-nut-discussion at egnite.de>
> Sent: Thursday, January 18, 2007 10:45 AM
> Subject: [En-Nut-Discussion] how to use the NutTrace ?
>> Hi,
>> The "NUTTRACER" macro is supposed to , I think, enable the trace
>> capability of Nut/OS. So how to use it ? If I build a Nut/OS with that
>> macro defined,  will it print message to the console when an 
>> application
>> is running ?
>> Thanks.
>> Mike
>> _______________________________________________
>> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion

Brett Abbott, Managing Director, Digital Telemetry Limited
Email: Brett.Abbott at digital-telemetry.com
PO Box 24 036 Manners Street, Wellington, New Zealand
Phone +64 (4) 462-3439  Mobile +64 (21) 656-144
------------------- Commercial in confidence --------------------

More information about the En-Nut-Discussion mailing list