My AVR programming method is usually as follows:
- compile the source code with
avr-gcc
:
avr-gcc -mmcu=<mirocontroller_id> <source_file>.c -o a.out
- Convert the compiled code into hex with
objcopy
:
objcopy -O ihex a.out a.hex
- Write the hex to the flash of the microcontroller with
avrdude
:
avrdude -c <programmer_id> -p <microcontroller_id> flash:w:a.hex
This works great. Its fast, reliable, and very flexible. Now I want to add onto this toolchain with debugging functionality. I have heard of something called avr-gdb
, but I don't know a whole lot about it. Documentation is difficult to find, and there is little information out there on it. I would love to be able to set breakpoints, and read the state of watched variables in the microcontrollers memory, as well as being able to see a hex dump of the memory.