From 8b99dd4753b72d25b76213d0ebce4b07d040b971 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 10 Feb 2024 14:37:38 +0100 Subject: [PATCH 1/2] Qemu testing --- README.md | 5 +++++ makefile | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..42fb9ca --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# AVR Playground + +```bash +sudo dnf install avr-binutils avr-libc avr-gcc avr-gcc-c++ avrdude qemu-system-avr +``` diff --git a/makefile b/makefile index 272b3ff..5a7ee9f 100644 --- a/makefile +++ b/makefile @@ -6,6 +6,7 @@ PROGRAMMER = usbasp # MCU MCU = atmega328p +QEMU_MACHINE_NAME = uno # Compiler flags CFLAGS = -std=c99 -Wall -Wno-array-bounds -mmcu=$(MCU) -DF_CPU=16000000UL -O3 @@ -38,6 +39,10 @@ $(TARGET).hex: $(TARGET).elf flash: $(TARGET).hex avrdude -p $(MCU) -c $(PROGRAMMER) -U flash:w:$(TARGET).hex +# Run the program in QEMU +qemu: $(TARGET).elf + qemu-system-avr -machine $(QEMU_MACHINE_NAME) -bios $(TARGET).elf + # Clean clean: rm -f $(OBJS) $(TARGET).elf $(TARGET).hex From 0f6256d9cee192b153582c2346b9f2e252d187a6 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 10 Feb 2024 14:38:21 +0100 Subject: [PATCH 2/2] Docs link --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 42fb9ca..97a4116 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # AVR Playground +[QEMU AVR Docs](https://www.qemu.org/docs/master/system/target-avr.html) + ```bash sudo dnf install avr-binutils avr-libc avr-gcc avr-gcc-c++ avrdude qemu-system-avr ```