avr-blink/buildandupload.sh

17 lines
449 B
Bash
Executable File

#!/bin/bash
# Cleanup
rm -vf *.o *.elf *.hex
# Compile
/home/jpt/arduino-1.8.8/hardware/tools/avr/bin/avr-gcc -c -mmcu=atmega328p blink.c
# Link
/home/jpt/arduino-1.8.8/hardware/tools/avr/bin/avr-gcc -g -mmcu=atmega328p blink.o -o blink.elf
# Convert hex
/home/jpt/arduino-1.8.8/hardware/tools/avr/bin/avr-objcopy -j .text -j .data -O ihex blink.elf blink.hex
# Upload
avrdude -P /dev/ttyUSB0 -c arduino -p m328p -b 19200 -U flash:w:blink.hex