Embedded Systems Design: An Introduction to Processes, Tools, and Techniques

Host-Based Debugging

Although you can do a certain amount of testing on your desktop PC, unless you are lucky enough to be programming for an embedded PC, eventually differences between the desktop hardware and the target hardware will force you to move the testing to the target.

If you write your applications in C or C++, you should be able to debug an algorithm on the host (as long as you watch out for a few minor differences that tend to cause major bugs that I ll discuss shortly). Even if you write in assembly (or have inherited a library of legacy code in assembly), you can execute the code on your desktop system using an Instruction Set Simulator (ISS) until you need to test the real-time interaction of the code and the target system s special hardware.

Aside from the availability of real working peripherals, the greatest source of problems for host-based debugging derives from two architectural characteristics: word size and byte order.

Word Size

Obviously, if your embedded processor has a 16-bit wide architecture and your host-based compiler is expecting a 32-bit data path, you can have problems. An integer data type on a PC can have a range of approximately 2 billion, whereas an integer in your target might have a range of approximately 32 thousand. Numbers bigger than the targeted range will cause bugs that you ll never see on the PC.

Byte Order

Another problem is the Little Endian, Big Endian problem, which is legendary for...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Embedded Systems Software
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.