Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What simple method can I use to debug an embedded processor without serial port or video?

We have a small embedded system without any video or serial ports (i.e. we can't output text via printf).
We would like to track the progress of our code through the initialization sequence.
Is there some simple things we can do to help with this.
It is not running any OS, and the hardware platform is somewhat customizable.

like image 968
Benoit Avatar asked Sep 16 '08 04:09

Benoit


People also ask

What are the 3 debugging tools in an embedded systems?

There are three requirements for debugging an embedded or real-time system. They are Run control, Memory substitution and real time analysis. I. Run control is the ability to start, stop, peek, and poke the processor and memory.

Why do we need the serial communication interface in embedded processor?

A serial port connection can be used for inter-processor communication within a system or for communication with different parts of a system. The serial port provides the physical connection between the equipment but a communication protocol has to used to ensure a reliable, error-free data path.


2 Answers

The simplest most scalable solution are state LEDs. Toggle LEDs based on actions, either in binary form or when certain actions occur if you can narrow your focus.

The most powerful will be a hardware JTAG device. You don't even need to set breakpoints - simply being able to stop the application and inspect the state of memory may be enough. Note that some hardware platforms do not support "fancy" options such as memory watches or hardware breakpoints. The former is usually worked around with constantly stopping the processor and reading memory (turns your 10MHz system into a 1kHz system), while the latter is sometimes performed using code replacement (replace the targeted instruction with a different jump), which sometimes masks other problems. Be aware of these issues and which embedded processors they apply to.

like image 116
Yann Ramin Avatar answered Sep 26 '22 20:09

Yann Ramin


There are a few strategies you can employ to help with debugging:

If you have Output Pins available, you can hook them up to LEDs (or an oscilloscope) and toggle the output pins high/low to indicate that certain points have been reached in the code.
For example, 1 blink might be program loaded, 2 blink is foozbar initialized, 3 blink is accepting inputs...

If you have multiple output lines available, you can use a 7 segment LED to convey more information (numbers/letters instead of blinks).

If you have the capabilities to read memory and have some RAM available, you can use the sprint function to do printf-like debugging, but instead of going to a screen/serial port, it is written in memory.

like image 29
Benoit Avatar answered Sep 26 '22 20:09

Benoit