21606

Debugging embedded system with Eclipse - HOW TO PRINT TO A LOGGING FILE?

I'm currently working on a project on STM32F4 and I'm using Eclipse. I've got some problems with the program - it seems to have a random behavior - sometimes it works fine, other times it has some errors. Sometimes when I try do debug with breakpoints I get the beautiful HardFault Handler and it really messes with my brains.

Sorry for the little off-topic paragraph, just wanted to let you know why I decided to use printing to a log file at some key moments in the program so I can see in which states and in which functions does the problem occur. I'm debugging through a JTAG interface with Eclipse (gdb) and I need to know if there is an easy method integrated in Eclipse that may help me use fprintf-like functions inside my program to write to a file on the disk.

If no, any other solutions?

Thanks

Answer1:

I do not like to connect the debug output log to the Jtag communication port because the log will not be available after development.

I usually build an SystemLog library that can send the log messages through any medium that is available (UART, USB, Ethernet or SDCARD). That's what I'd recommend you to do. It will help you through the development, and the support team on the event of any failure on field.

If stdlib is available in your project you should use the snprintf family functions to build your SystemLog.

Also, you can integrate the log output to the eclipse console by calling a serial console communicator (if you use UART) on you makefile, in this case, your makefile will have to flash the target as well.

Recommend

  • Optimize box-cox transform, function cannot be evaluated at initial parameters
  • scheduled PHP script execution without cron
  • how to check if a contour is an ellipse?
  • exceptions.TypeError: src is not a numpy array, neither a scalar
  • Set up the Android-Facebook sdk for Netbeans
  • Calling right overload of the java method from jython
  • Getting a line that has the coordinates defined by the mouse location
  • How can I check the type of the next element?
  • Embedding a Google map
  • How to force Composer to download a local package?
  • Is it possible to send skype chat messages from a linux server without X?
  • UIBarButtonItem's action is not called when in a view with a UIGestureRecognizer
  • C++/CLI Thread synchronization including managed and unmanaged code
  • Retrieving values from a PHP Multi-dimensional Array
  • What is this strange character in chrome's resource css viewer?
  • Lua: Line breaks in strings
  • Python/Javascript: WYSIWYG html editor - Handle large documents fast and/or design theory
  • using System.Speech.Synthesis with Windows10 universal app (XAML-C#)
  • SAVE attribute needed for Fortran variables when only the C_LOC address is returned to a C program?
  • Alternative to overridePendingTransition() - Android
  • Textfile Structure (tables)
  • Limiting recursion to certain level - Duplicate rows
  • Unity3D & Android: Difference between “UnityMain” and “main” threads?
  • Why value captured by reference in lambda is broken? [duplicate]
  • output of program is not same as passed argument
  • Does CUDA 5 support STL or THRUST inside the device code?
  • Can a Chrome extension content script make an jQuery AJAX request for an html file that is itself a
  • Statically linking a C++ library to a C# process using CLI or any other way
  • Upload files with Ajax and Jquery
  • Why winpcap requires both .lib and .dll to run?
  • Calling of Constructors in a Java
  • Run Powershell script from inside other Powershell script with dynamic redirection to file
  • AngularJs get employee from factory
  • Proper way to use connect-multiparty with express.js?
  • Load html files in TinyMce
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • Why joiner is not used after Sequence generator or Update statergy
  • coudnt use logback because of log4j
  • Recursive/Hierarchical Query Using Postgres
  • UserPrincipal.Current returns apppool on IIS