Qemu testing

This commit is contained in:
Imbus 2024-02-10 14:37:38 +01:00
parent a6ab36790f
commit 8b99dd4753
2 changed files with 10 additions and 0 deletions

View file

@ -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