Qemu testing
This commit is contained in:
parent
a6ab36790f
commit
8b99dd4753
2 changed files with 10 additions and 0 deletions
5
README.md
Normal file
5
README.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
# AVR Playground
|
||||
|
||||
```bash
|
||||
sudo dnf install avr-binutils avr-libc avr-gcc avr-gcc-c++ avrdude qemu-system-avr
|
||||
```
|
5
makefile
5
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
|
||||
|
|
Loading…
Reference in a new issue