From 131be2e75a14e3df1a4cba9184a6c709dd283fbe Mon Sep 17 00:00:00 2001 From: Manfred Steiner Date: Sat, 12 Oct 2024 15:53:33 +0200 Subject: [PATCH] =?utf8?q?Projektvorlagen=20VSCode/AVR/Level-1:=20Makefile?= =?utf8?q?s=20ge=C3=A4ndert?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- vscode-avr-c-cpp/arduino-nano-1/Makefile | 29 ++++++++++++++++-------- vscode-avr-c-cpp/nano-1284-1/Makefile | 29 ++++++++++++++++-------- vscode-avr-c-cpp/nano-644-1/Makefile | 29 ++++++++++++++++-------- vscode-avr-c-cpp/sure-1/Makefile | 29 ++++++++++++++++-------- 4 files changed, 80 insertions(+), 36 deletions(-) diff --git a/vscode-avr-c-cpp/arduino-nano-1/Makefile b/vscode-avr-c-cpp/arduino-nano-1/Makefile index ca9556d..7e1fa9d 100644 --- a/vscode-avr-c-cpp/arduino-nano-1/Makefile +++ b/vscode-avr-c-cpp/arduino-nano-1/Makefile @@ -3,6 +3,7 @@ NAME=arduino-nano-1_atmega328p DEVICE= atmega328p AVRDUDE_DEVICE= m328p CPU_FREQUENCE= 16000000 +BAUDRATE=38400 # -------------------------------------------------------------------------------- @@ -136,16 +137,26 @@ gdb: sim/$(NAME).elf # 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 @@ -181,16 +192,16 @@ endif # 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 # -------------------------------------------------------- @@ -199,7 +210,7 @@ help: @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" diff --git a/vscode-avr-c-cpp/nano-1284-1/Makefile b/vscode-avr-c-cpp/nano-1284-1/Makefile index ef7c7e3..e95febd 100644 --- a/vscode-avr-c-cpp/nano-1284-1/Makefile +++ b/vscode-avr-c-cpp/nano-1284-1/Makefile @@ -3,6 +3,7 @@ NAME=nano-1284-1_atmega1284p DEVICE= atmega1284p AVRDUDE_DEVICE= m1284p CPU_FREQUENCE= 12000000 +BAUDRATE=115200 # -------------------------------------------------------------------------------- @@ -136,16 +137,26 @@ gdb: sim/$(NAME).elf # 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 @@ -181,16 +192,16 @@ endif # 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 # -------------------------------------------------------- @@ -199,7 +210,7 @@ help: @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" diff --git a/vscode-avr-c-cpp/nano-644-1/Makefile b/vscode-avr-c-cpp/nano-644-1/Makefile index 71232c5..03912d7 100644 --- a/vscode-avr-c-cpp/nano-644-1/Makefile +++ b/vscode-avr-c-cpp/nano-644-1/Makefile @@ -3,6 +3,7 @@ NAME=nano-644-1_atmega644p DEVICE= atmega644p AVRDUDE_DEVICE= m644p CPU_FREQUENCE= 12000000 +BAUDRATE=115200 # -------------------------------------------------------------------------------- @@ -136,16 +137,26 @@ gdb: sim/$(NAME).elf # 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 @@ -181,16 +192,16 @@ endif # 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 # -------------------------------------------------------- @@ -199,7 +210,7 @@ help: @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" diff --git a/vscode-avr-c-cpp/sure-1/Makefile b/vscode-avr-c-cpp/sure-1/Makefile index 5e8b283..cbde53e 100644 --- a/vscode-avr-c-cpp/sure-1/Makefile +++ b/vscode-avr-c-cpp/sure-1/Makefile @@ -3,6 +3,7 @@ NAME=sure-1_atmega16p DEVICE= atmega16 AVRDUDE_DEVICE= m16 CPU_FREQUENCE= 12000000 +BAUDRATE=115200 # -------------------------------------------------------------------------------- @@ -136,16 +137,26 @@ gdb: sim/$(NAME).elf # 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 @@ -181,16 +192,16 @@ endif # 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 # -------------------------------------------------------- @@ -199,7 +210,7 @@ help: @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" -- 2.39.5