Skip to content

Baremetal software drivers, their unit tests, and their sequence diagrams built and flashed using CMake for ATMEGA32 mcu.

Notifications You must be signed in to change notification settings

AhmedAlyElGhannam/ITI_Embedded_AVR_Playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ITI_Embedded_AVR_Playground

Compiling, Building, and Flashing

cmake -S . -B build 
cmake --build build
cd build
make flash

Simulating Using SimulAVR && Debugging Using GDB

Open a terminal and execute the following:

simulavr -d atmega32 -f AVR_PROJECT.elf --gdbserver

In another terminal, run:

avr-gdb AVR_PROJECT.elf

In order to begin debugging using GDB, connect it with SimulAVR using the following command. Port 1212 is the default port for SimulAVR; make sure it matches the port returned by SimulAVR upon starting it.

target remote localhost:1212

Symbol Table is read by GDB by default if -g compiler flag was used to add debugging symbols.

Common GDB Commands

  1. To place a breakpoint:

    break LABEL_NAME
  2. To continue executing until breakpoint is reached:

    c
  3. To print a variable's value (if it is a pointer for example):

    print *PTR_NAME
  4. To single step in C code:

    n
  5. To switch code layout from C to Assembly:

    layout asm
  6. To single step in Assembly code:

    stepi
    si
  7. To switch code layout back to C:

    layout src

Simulating Using SimulAVR && Debugging Using GDB Through VSCode

About

Baremetal software drivers, their unit tests, and their sequence diagrams built and flashed using CMake for ATMEGA32 mcu.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published