Designing of debugger for microcontrollers

OData support
Dr. Benesóczky Zoltán
Department of Measurement and Information Systems


Most development tools and debuggers are too expensive. Furthermore, some microcontrollers are not supported by our debuggers. Therefore, a platform independent debugger solution is often required. This project describes a complete software debugger solution. The debug procedure realised with additional source code. The source code can be configured to different microcontrollers.


Firstly, the source code files of debugger always are to be compiled and linked into user’s application code. These source code files is written in C. Consequently, the debugger solution can be only used in those projects, which is written in C code. The user can insert some breakpoint macro in his source code, which will stop the running program to read variables in data memory. The functionality of the breakpoint macro is similar to code breakpoint. Firstly, the breakpoint macro prohibits the global interrupt enable bit. Secondly, the breakpoint calls a function, which sends the data of indicated variables to PC. Moreover, all of data memory can be read, while the program is running in breakpoint. The program will step out from breakpoint, if the „continue” command is sent to target. In addition, all the breakpoint can be changed to trace mode. When the program runs into a breakpoint, the PC program sends the "continue" command automatically. We note that the replacement of these breakpoint is only possible before compile time.

If the microcontroller supports the self-programming, the debugger can be used as bootloader. However, the complete developing procedure requires only the debugger, first time we need a programmer tool flashing the bootloader firmware.

Hardware requirements:

Three wire must be connected to the target board: GND, RESET, DATA. We note that the target board can be supplied with +5V, if it necessary. The disadvantage of using one data wire is slow communication speed. If we would have applied more data line, much more GPIO ports have been wasted. These lines is connected directly to debugger hardware. The debugger hardware is connected to PC via USB.

Software requirements:

The program memory requirement of debugger code is approximately 3kB. The bootloader firmware requires less than 2kB in program memory. Both IAR and WinAvr c compiler is supported basically. In case of using another vendor’s toolchain (CodeVision or ImageCraft) the debugger code is easy to configure.


Please sign in to download the files of this thesis.