DEVICE= atmega328p
AVRDUDE_DEVICE= m328p
CPU_FREQUENCE= 16000000
+BAUDRATE=38400
# --------------------------------------------------------------------------------
# flash to target with arduino bootloader in bootloader-section
flash: dist/$(NAME).elf all
- avrdude -c arduino -P /dev/ttyUSB0 -b 115200 -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
+ avrdude -c arduino -P /dev/ttyUSB0 -b $(BAUDRATE) -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
flash0: dist/$(NAME).elf all
- avrdude -c arduino -P /dev/ttyUSB0 -b 115200 -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
+ avrdude -c arduino -P /dev/ttyUSB0 -b $(BAUDRATE) -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
flash1: dist/$(NAME).elf all
- avrdude -c arduino -P /dev/ttyUSB1 -b 115200 -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
+ avrdude -c arduino -P /dev/ttyUSB1 -b $(BAUDRATE) -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
flash2: dist/$(NAME).elf all
- avrdude -c arduino -P /dev/ttyUSB2 -b 115200 -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
+ avrdude -c arduino -P /dev/ttyUSB2 -b $(BAUDRATE) -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
+
+flash-read:
+ avrdude -c arduino -P /dev/ttyUSB0 -b $(BAUDRATE) -p $(AVRDUDE_DEVICE) -U flash:r:/tmp/flash.bin
+
+flash-disassemble: flash-read
+ avr-objdump -b binary -D -m avr5 /tmp/flash.bin > /tmp/flash.s
+ less /tmp/flash.s
+
+flash-hexdump: flash-read
+ hexdump -C /tmp/flash.bin | less
# ----------------------------------------------
# flash to target with fischl programming device
# picocom sends CR for ENTER -> convert cr (\r) to lf (\n)
picocom:
- picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB0
+ picocom -b $(BAUDRATE) --omap crlf --raise-dtr /dev/ttyUSB0
picocom0:
- picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB0
+ picocom -b $(BAUDRATE) --omap crlf --raise-dtr /dev/ttyUSB0
picocom1:
- picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB1
+ picocom -b $(BAUDRATE) --omap crlf --raise-dtr /dev/ttyUSB1
picocom2:
- picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB2
+ picocom -b $(BAUDRATE) --omap crlf --raise-dtr /dev/ttyUSB2
# --------------------------------------------------------
@echo "Possible targets are:"
@echo " clean"
@echo " all help info"
- @echo " flash flash0 flash1 flash2"
+ @echo " flash flash0 flash1 flash2 flash-read flash-disassemble flash-hexdump"
@echo " isp-$(AVRDUDE_DEVICE) isp-flash-$(AVRDUDE_DEVICE) isp-fuse-$(AVRDUDE_DEVICE)"
@echo " picocom picocom0 picocom1 picocom2"
@echo " gdb simuc"
DEVICE= atmega1284p
AVRDUDE_DEVICE= m1284p
CPU_FREQUENCE= 12000000
+BAUDRATE=115200
# --------------------------------------------------------------------------------
# flash to target with arduino bootloader in bootloader-section
flash: dist/$(NAME).elf all
- avrdude -c arduino -P /dev/ttyUSB0 -b 115200 -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
+ avrdude -c arduino -P /dev/ttyUSB0 -b $(BAUDRATE) -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
flash0: dist/$(NAME).elf all
- avrdude -c arduino -P /dev/ttyUSB0 -b 115200 -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
+ avrdude -c arduino -P /dev/ttyUSB0 -b $(BAUDRATE) -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
flash1: dist/$(NAME).elf all
- avrdude -c arduino -P /dev/ttyUSB1 -b 115200 -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
+ avrdude -c arduino -P /dev/ttyUSB1 -b $(BAUDRATE) -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
flash2: dist/$(NAME).elf all
- avrdude -c arduino -P /dev/ttyUSB2 -b 115200 -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
+ avrdude -c arduino -P /dev/ttyUSB2 -b $(BAUDRATE) -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
+
+flash-read:
+ avrdude -c arduino -P /dev/ttyUSB0 -b $(BAUDRATE) -p $(AVRDUDE_DEVICE) -U flash:r:/tmp/flash.bin
+
+flash-disassemble: flash-read
+ avr-objdump -b binary -D -m avr5 /tmp/flash.bin > /tmp/flash.s
+ less /tmp/flash.s
+
+flash-hexdump: flash-read
+ hexdump -C /tmp/flash.bin | less
# ----------------------------------------------
# flash to target with fischl programming device
# picocom sends CR for ENTER -> convert cr (\r) to lf (\n)
picocom:
- picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB0
+ picocom -b $(BAUDRATE) --omap crlf --raise-dtr /dev/ttyUSB0
picocom0:
- picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB0
+ picocom -b $(BAUDRATE) --omap crlf --raise-dtr /dev/ttyUSB0
picocom1:
- picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB1
+ picocom -b $(BAUDRATE) --omap crlf --raise-dtr /dev/ttyUSB1
picocom2:
- picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB2
+ picocom -b $(BAUDRATE) --omap crlf --raise-dtr /dev/ttyUSB2
# --------------------------------------------------------
@echo "Possible targets are:"
@echo " clean"
@echo " all help info"
- @echo " flash flash0 flash1 flash2"
+ @echo " flash flash0 flash1 flash2 flash-read flash-disassemble flash-hexdump"
@echo " isp-$(AVRDUDE_DEVICE) isp-flash-$(AVRDUDE_DEVICE) isp-fuse-$(AVRDUDE_DEVICE)"
@echo " picocom picocom0 picocom1 picocom2"
@echo " gdb simuc"
DEVICE= atmega644p
AVRDUDE_DEVICE= m644p
CPU_FREQUENCE= 12000000
+BAUDRATE=115200
# --------------------------------------------------------------------------------
# flash to target with arduino bootloader in bootloader-section
flash: dist/$(NAME).elf all
- avrdude -c arduino -P /dev/ttyUSB0 -b 115200 -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
+ avrdude -c arduino -P /dev/ttyUSB0 -b $(BAUDRATE) -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
flash0: dist/$(NAME).elf all
- avrdude -c arduino -P /dev/ttyUSB0 -b 115200 -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
+ avrdude -c arduino -P /dev/ttyUSB0 -b $(BAUDRATE) -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
flash1: dist/$(NAME).elf all
- avrdude -c arduino -P /dev/ttyUSB1 -b 115200 -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
+ avrdude -c arduino -P /dev/ttyUSB1 -b $(BAUDRATE) -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
flash2: dist/$(NAME).elf all
- avrdude -c arduino -P /dev/ttyUSB2 -b 115200 -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
+ avrdude -c arduino -P /dev/ttyUSB2 -b $(BAUDRATE) -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
+
+flash-read:
+ avrdude -c arduino -P /dev/ttyUSB0 -b $(BAUDRATE) -p $(AVRDUDE_DEVICE) -U flash:r:/tmp/flash.bin
+
+flash-disassemble: flash-read
+ avr-objdump -b binary -D -m avr5 /tmp/flash.bin > /tmp/flash.s
+ less /tmp/flash.s
+
+flash-hexdump: flash-read
+ hexdump -C /tmp/flash.bin | less
# ----------------------------------------------
# flash to target with fischl programming device
# picocom sends CR for ENTER -> convert cr (\r) to lf (\n)
picocom:
- picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB0
+ picocom -b $(BAUDRATE) --omap crlf --raise-dtr /dev/ttyUSB0
picocom0:
- picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB0
+ picocom -b $(BAUDRATE) --omap crlf --raise-dtr /dev/ttyUSB0
picocom1:
- picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB1
+ picocom -b $(BAUDRATE) --omap crlf --raise-dtr /dev/ttyUSB1
picocom2:
- picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB2
+ picocom -b $(BAUDRATE) --omap crlf --raise-dtr /dev/ttyUSB2
# --------------------------------------------------------
@echo "Possible targets are:"
@echo " clean"
@echo " all help info"
- @echo " flash flash0 flash1 flash2"
+ @echo " flash flash0 flash1 flash2 flash-read flash-disassemble flash-hexdump"
@echo " isp-$(AVRDUDE_DEVICE) isp-flash-$(AVRDUDE_DEVICE) isp-fuse-$(AVRDUDE_DEVICE)"
@echo " picocom picocom0 picocom1 picocom2"
@echo " gdb simuc"
DEVICE= atmega16
AVRDUDE_DEVICE= m16
CPU_FREQUENCE= 12000000
+BAUDRATE=115200
# --------------------------------------------------------------------------------
# flash to target with arduino bootloader in bootloader-section
flash: dist/$(NAME).elf all
- avrdude -c arduino -P /dev/ttyUSB0 -b 115200 -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
+ avrdude -c arduino -P /dev/ttyUSB0 -b $(BAUDRATE) -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
flash0: dist/$(NAME).elf all
- avrdude -c arduino -P /dev/ttyUSB0 -b 115200 -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
+ avrdude -c arduino -P /dev/ttyUSB0 -b $(BAUDRATE) -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
flash1: dist/$(NAME).elf all
- avrdude -c arduino -P /dev/ttyUSB1 -b 115200 -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
+ avrdude -c arduino -P /dev/ttyUSB1 -b $(BAUDRATE) -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
flash2: dist/$(NAME).elf all
- avrdude -c arduino -P /dev/ttyUSB2 -b 115200 -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
+ avrdude -c arduino -P /dev/ttyUSB2 -b $(BAUDRATE) -p $(AVRDUDE_DEVICE) -e -U flash:w:$<
+
+flash-read:
+ avrdude -c arduino -P /dev/ttyUSB0 -b $(BAUDRATE) -p $(AVRDUDE_DEVICE) -U flash:r:/tmp/flash.bin
+
+flash-disassemble: flash-read
+ avr-objdump -b binary -D -m avr5 /tmp/flash.bin > /tmp/flash.s
+ less /tmp/flash.s
+
+flash-hexdump: flash-read
+ hexdump -C /tmp/flash.bin | less
# ----------------------------------------------
# flash to target with fischl programming device
# picocom sends CR for ENTER -> convert cr (\r) to lf (\n)
picocom:
- picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB0
+ picocom -b $(BAUDRATE) --omap crlf --raise-dtr /dev/ttyUSB0
picocom0:
- picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB0
+ picocom -b $(BAUDRATE) --omap crlf --raise-dtr /dev/ttyUSB0
picocom1:
- picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB1
+ picocom -b $(BAUDRATE) --omap crlf --raise-dtr /dev/ttyUSB1
picocom2:
- picocom -b 115200 --omap crlf --raise-dtr /dev/ttyUSB2
+ picocom -b $(BAUDRATE) --omap crlf --raise-dtr /dev/ttyUSB2
# --------------------------------------------------------
@echo "Possible targets are:"
@echo " clean"
@echo " all help info"
- @echo " flash flash0 flash1 flash2"
+ @echo " flash flash0 flash1 flash2 flash-read flash-disassemble flash-hexdump"
@echo " isp-$(AVRDUDE_DEVICE) isp-flash-$(AVRDUDE_DEVICE) isp-fuse-$(AVRDUDE_DEVICE)"
@echo " picocom picocom0 picocom1 picocom2"
@echo " gdb simuc"