From 20a7df0839d159f573a9b22d40fc904bf277b53d Mon Sep 17 00:00:00 2001 From: Manfred Steiner Date: Thu, 5 Sep 2024 12:58:47 +0200 Subject: [PATCH] software/nano-5v/bootloader-arduino (release/2024-09-05_124618) --- .../nano-5v/bootloader-arduino/.gdb_history | 9 + software/nano-5v/bootloader-arduino/.gdbinit | 5 + .../nano-5v/bootloader-arduino/.gitignore | 4 + .../.vscode/c_cpp_properties.json | 26 + .../bootloader-arduino/.vscode/launch.json | 37 ++ .../bootloader-arduino/.vscode/settings.json | 19 + .../bootloader-arduino/.vscode/tasks.json | 23 + software/nano-5v/bootloader-arduino/Makefile | 125 ++++ software/nano-5v/bootloader-arduino/README.md | 59 ++ software/nano-5v/bootloader-arduino/protocol | 323 +++++++++++ .../bootloader-arduino_nano-5v-328p.elf | Bin 0 -> 8608 bytes .../bootloader-arduino_nano-5v-328p.hex | 97 ++++ .../nano-5v/bootloader-arduino/src/main.c | 543 ++++++++++++++++++ 13 files changed, 1270 insertions(+) create mode 100644 software/nano-5v/bootloader-arduino/.gdb_history create mode 100644 software/nano-5v/bootloader-arduino/.gdbinit create mode 100644 software/nano-5v/bootloader-arduino/.gitignore create mode 100644 software/nano-5v/bootloader-arduino/.vscode/c_cpp_properties.json create mode 100644 software/nano-5v/bootloader-arduino/.vscode/launch.json create mode 100644 software/nano-5v/bootloader-arduino/.vscode/settings.json create mode 100644 software/nano-5v/bootloader-arduino/.vscode/tasks.json create mode 100644 software/nano-5v/bootloader-arduino/Makefile create mode 100644 software/nano-5v/bootloader-arduino/README.md create mode 100644 software/nano-5v/bootloader-arduino/protocol create mode 100755 software/nano-5v/bootloader-arduino/release/2024-09-05_124618/bootloader-arduino_nano-5v-328p.elf create mode 100644 software/nano-5v/bootloader-arduino/release/2024-09-05_124618/bootloader-arduino_nano-5v-328p.hex create mode 100644 software/nano-5v/bootloader-arduino/src/main.c diff --git a/software/nano-5v/bootloader-arduino/.gdb_history b/software/nano-5v/bootloader-arduino/.gdb_history new file mode 100644 index 0000000..3339046 --- /dev/null +++ b/software/nano-5v/bootloader-arduino/.gdb_history @@ -0,0 +1,9 @@ +target remote :1234 +layout split +stepi +quit +target remote :1234 +layout split +stepi +b *main+9 +quit diff --git a/software/nano-5v/bootloader-arduino/.gdbinit b/software/nano-5v/bootloader-arduino/.gdbinit new file mode 100644 index 0000000..a8c4b59 --- /dev/null +++ b/software/nano-5v/bootloader-arduino/.gdbinit @@ -0,0 +1,5 @@ +set history save on +set history size 1000 +set history remove-duplicates 2 +set history filename .gdb_history + diff --git a/software/nano-5v/bootloader-arduino/.gitignore b/software/nano-5v/bootloader-arduino/.gitignore new file mode 100644 index 0000000..a959910 --- /dev/null +++ b/software/nano-5v/bootloader-arduino/.gitignore @@ -0,0 +1,4 @@ +.depend +**/build +**/dist +**/sim diff --git a/software/nano-5v/bootloader-arduino/.vscode/c_cpp_properties.json b/software/nano-5v/bootloader-arduino/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..00f3a55 --- /dev/null +++ b/software/nano-5v/bootloader-arduino/.vscode/c_cpp_properties.json @@ -0,0 +1,26 @@ +{ + "configurations": [ + { + "name": "Linux AVR", + "includePath": [ + "/usr/lib/avr/include/**", + "/usr/lib/gcc/avr/**" + ], + "defines": [], + "compilerPath": "/usr/bin/avr-gcc", + "compilerArgs": [ + "-mmcu=atmega328p", + "-Os", + "-DF_CPU=16000000", + "-DBAUD_RATE=115200", + "-DDOUBLE_SPEED", + "-DNUM_LED_FLASHES=4", + "-DMAX_TIME_COUNT=F_CPU>>4" + ], + "cStandard": "gnu11", + "cppStandard": "gnu++11", + "intelliSenseMode": "linux-gcc-x64" + } + ], + "version": 4 +} diff --git a/software/nano-5v/bootloader-arduino/.vscode/launch.json b/software/nano-5v/bootloader-arduino/.vscode/launch.json new file mode 100644 index 0000000..f29cf2e --- /dev/null +++ b/software/nano-5v/bootloader-arduino/.vscode/launch.json @@ -0,0 +1,37 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Build", + // "request": "launch", + "type": "node-terminal", + "preLaunchTask": "build" + },{ + "name": "Flash", + // "request": "launch", + "type": "node-terminal", + "preLaunchTask": "flash" + },{ + "name": "Clean", + // "request": "launch", + "type": "node-terminal", + "preLaunchTask": "clean" + },{ + // es muss mit simuc --board arduino dist/programm.elf der Simulator + // gestartet werden. Dessen gdb-stub öffnet auf localhost:1234 einen Port + "name": "Debug (simuc)", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/sim/atmega328p.elf", + "cwd": "${workspaceFolder}", + "externalConsole": false, + "MIMode": "gdb", + "miDebuggerPath": "/usr/bin/avr-gdb", + "miDebuggerServerAddress": ":1234", + "preLaunchTask": "build" + } + ] +} diff --git a/software/nano-5v/bootloader-arduino/.vscode/settings.json b/software/nano-5v/bootloader-arduino/.vscode/settings.json new file mode 100644 index 0000000..ced9cb9 --- /dev/null +++ b/software/nano-5v/bootloader-arduino/.vscode/settings.json @@ -0,0 +1,19 @@ +{ + "[c]": { + "editor.insertSpaces": true, + "editor.tabSize": 3, + "editor.detectIndentation": false + }, + "[h]": { + "editor.insertSpaces": true, + "editor.tabSize": 3, + "editor.detectIndentation": false + }, + "cSpell.words": [], + "cSpell.ignorePaths": [ + "**/*.json", "**/*.c", "**/*.h", "**/Makefile" + ], + "files.associations": { + "io.h": "c" + } +} diff --git a/software/nano-5v/bootloader-arduino/.vscode/tasks.json b/software/nano-5v/bootloader-arduino/.vscode/tasks.json new file mode 100644 index 0000000..74fb1c7 --- /dev/null +++ b/software/nano-5v/bootloader-arduino/.vscode/tasks.json @@ -0,0 +1,23 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [{ + "label": "build", + "type": "shell", + "command": "make", + "problemMatcher":[ + "$gcc" + ] + },{ + "label": "clean", + "type": "shell", + "command": "make", + "args": [ "clean" ], + },{ + "label": "flash", + "type": "shell", + "command": "make", + "args": [ "flash" ], + }] +} \ No newline at end of file diff --git a/software/nano-5v/bootloader-arduino/Makefile b/software/nano-5v/bootloader-arduino/Makefile new file mode 100644 index 0000000..36b5d75 --- /dev/null +++ b/software/nano-5v/bootloader-arduino/Makefile @@ -0,0 +1,125 @@ +.PHONY: all info flash picocom clean +$(shell mkdir -p dist >/dev/null) +$(shell mkdir -p build >/dev/null) +$(shell mkdir -p sim >/dev/null) +$(shell mkdir -p sim/build >/dev/null) + +NAME="bootloader-arduino_nano-5v-328p" +SRC= $(wildcard src/*.c src/*.cpp src/*/*.c src/*/*.cpp) +HDR= $(wildcard src/*.h src/*.hpp src/*/*.h src/*/*.hpp) +OBJ_CPP = $(SRC:src/%.cpp=build/%.o) +OBJ = $(OBJ_CPP:src/%.c=build/%.o) +OBJ_SIM_CPP = $(SRC:src/%.cpp=sim/build/%.o) +OBJ_SIM = $(OBJ_SIM_CPP:src/%.c=sim/build/%.o) + +DEVICE=atmega328p +DEVICE_ISP=m328p + +CC= avr-g++ +CFLAGS= -Wall -mmcu=$(DEVICE) -Os -DF_CPU=16000000 -DBAUD_RATE=115200 -DDOUBLE_SPEED -DNUM_LED_FLASHES=4 '-DMAX_TIME_COUNT=F_CPU>>4' -c +#LFLAGS= -Wall -mmcu=$(DEVICE) -Os -DF_CPU=12000000 -Wl,-u,vfprintf -lprintf_flt -lm +LFLAGS= -Wall -mmcu=$(DEVICE) -Os -DF_CPU=16000000 -Wl,--section-start=.text=0x7000 + +CFLAGS_SIM= -Wall -mmcu=$(DEVICE) -Og -DF_CPU=16000000 -g -DBAUD_RATE=115200 -DDOUBLE_SPEED -DNUM_LED_FLASHES=4 '-DMAX_TIME_COUNT=F_CPU>>4' -c +#LFLAGS_SIM= -Wall -mmcu=$(DEVICE) -Og -DF_CPU=12000000 -g -Wl,-u,vfprintf -lprintf_flt -lm +LFLAGS_SIM= -Wall -mmcu=$(DEVICE) -Og -DF_CPU=16000000 -g -Wl,--section-start=.text=0x7000 + + +all: dist/$(NAME).elf dist/$(NAME).s dist/$(NAME).hex sim/$(NAME).elf sim/$(NAME).s info + +dbg: + @echo --HDR--------------------------------- + @echo $(HDR) + @echo --SRC--------------------------------- + @echo $(SRC) + @echo --OBJ--------------------------------- + @echo $(OBJ) + @echo --OBJ_CPP----------------------------- + @echo $(OBJ_CPP) + @echo --OBJ--------------------------------- + @echo $(OBJ) + @echo =================================== + @echo + +info: + @avr-size --mcu=$(DEVICE) --format=avr dist/$(NAME).elf + +.depend: $(SRC) $(HDR) + $(CC) -mmcu=$(DEVICE) -MM $(SRC) | sed --regexp-extended 's/^(.*\.o)\: src\/(.*)(\.cpp|\.c) (.*)/build\/\2\.o\: src\/\2\3 \4/g' > .depend + +-include .depend + +# .depend solte auch auf Header Files achten! + +dist/$(NAME).elf: .depend $(OBJ) + $(CC) $(LFLAGS) -o $@ $(OBJ) + +dist/%.s: dist/%.elf + avr-objdump -d $< > $@ + +dist/%.hex: dist/%.elf + #avr-objcopy -j .text -j .data -O ihex $< $@ + avr-objcopy -O ihex $(HEX_FLASH_FLAGS) $< $@ + +sim/$(NAME).elf: .depend $(OBJ_SIM) + $(CC) $(LFLAGS_SIM) -o $@ $(OBJ_SIM) + + +build/%.o: src/%.c + @mkdir -p $(dir $@) + $(CC) $(CFLAGS) -o $@ $< + +build/%.o: src/%.cpp + @mkdir -p $(dir $@) + $(CC) $(CFLAGS) -o $@ $< + +sim/build/%.o: src/%.c + @mkdir -p $(dir $@) + $(CC) $(CFLAGS_SIM) -o $@ $< + +sim/build/%.o: src/%.cpp + @mkdir -p $(dir $@) + $(CC) $(CFLAGS_SIM) -o $@ $< + +sim/%.s: sim/%.elf + avr-objdump -d $< > $@ + +simuc: sim/$(NAME).elf + simuc --board arduino $< + +gdb: sim/$(NAME).elf + avr-gdb $< + +isp-328p: + avrdude -c usbasp -p $(DEVICE_ISP) + +isp-flash-328p: dist/$(NAME).elf all + avrdude -c usbasp -p $(DEVICE_ISP) -e -U flash:w:$< + +isp-flash-328p-latest-release: + avrdude -c usbasp -p $(DEVICE_ISP) -e -U flash:w:release/$(shell ls -A release | tail -n 1)/$(NAME).elf + +isp-read-flash-328p: + avrdude -c usbasp -p $(DEVICE_ISP) -U flash:r:/tmp/flash-nano-1284__$(shell date +"%Y-%m-%d_%H%M%S") + +flash-1284p: dist/$(NAME).elf all + avrdude -c arduino -p $(DEVICE_ISP) -P /dev/ttyUSB0 -b 115200 -e -U flash:w:$< + + +picocom: + # picocom sends CR for ENTER -> convert cr (\r) to lf (\n) + picocom -b 115200 --omap crlf /dev/ttyUSB0 + +isp-erase-328p: + avrdude -c usbasp -p $(DEVICE_ISP) -e + +isp-fuse-328p: + # LFUSE=0xE7 -> startuptime 16K CLOCKS + 4.1ms -> 5.4ms + avrdude -c usbasp -p $(DEVICE_ISP) -U lfuse:w:0xEF:m -U hfuse:w:0xD8:m -U efuse:w:0xFD:m -U lock:w:0xEF:m + +clean: + @rm -r dist + @rm -r build + @rm -r sim + @find . -type f -name ".depend" -exec rm {} \; + @echo "clean done" diff --git a/software/nano-5v/bootloader-arduino/README.md b/software/nano-5v/bootloader-arduino/README.md new file mode 100644 index 0000000..fa71166 --- /dev/null +++ b/software/nano-5v/bootloader-arduino/README.md @@ -0,0 +1,59 @@ +# Arduino-Bootloader (STK500) für Arduino Nano (5V, ATmega328P) + +Dieser Bootloader ermöglicht die Programmierung über das "Arduino-System". Als Kommunikationsprotokoll kommt das [STK500 Protokoll]( https://www.microchip.com/content/dam/mchp/documents/OTH/ApplicationNotes/ApplicationNotes/doc2525.pdf) zur Anwendung (Kommunikationsablauf siehe Datei [protocol](protocol)). + +Beim Bootloader in [src/main.c](src/main.c) handelt es sich um eine Anpassung von [https://github.com/arduino/ArduinoCore-avr/blob/master/bootloaders/atmega/ATmegaBOOT_168.c](https://github.com/arduino/ArduinoCore-avr/blob/master/bootloaders/atmega/ATmegaBOOT_168.c) an die Hardware des Nano-1284 Boards. + +Diese Anpassung der Quelltext-Datei umfasst: +* Microcontroller ATmega328P (mit 32KiB Flash, davon die hinteren 4KiB für den Bootloader) +* Frequenz 16MHz +* 1 LED (rot) +* Assembler-Anweisungen durch Macros aus `avr/boot.h` ersetzt +* Quelltextkorrekturen, damit der Bootloader auch bei einer Page-Size von 256 Byte funktioniert (für Atmega328P nicht erforderlich) + +Der Bootloader kann entweder selbst aus der Quelltextdatei erzeugt werden (siehe [Übersetzung](#%C3%BCbersetzung)), oder es wird eine der bereits fertigen Dateien im Ordner [release](release) verwendet: +* [release/2024-09-05_124618/bootloader-arduino_nano-5v-328p.elf](release/2024-09-05_124618/bootloader-arduino_nano-5v-328p.elf) +* [release/2024-09-05_124618/bootloader-arduino_nano-5v-328p.hex](release/2024-09-05_124618/bootloader-arduino_nano-5v-328p.hex) + +## Übersetzung + +Folgende Tools sind erforderlich: +* avr-gcc +* avrdude + +Auf einem Linux-Debian System müssen daher folgende Pakete installiert sein: +```sh +sudo apt update +sudo apt install gcc-avr avr-libc binutils-avr avrdude +``` + +Die Übersetzung erfolgt dann mit dem Kommando `make`. + +## Download auf den µC + +Die korrekte Programmierung der Fuses sowie der Download des Bootloaders in den Bootloader-Bereich des µC-Flash kann mit Hilfe eines [USBasp-Programmiergeräts](https://www.fischl.de/usbasp/) mit folgenden Kommandos erfolgen: + +```sh +make isp-fuse-328p +make isp-flash-328p +``` + +... oder die aktuellste Version im Unterordner release +```sh +make isp-fuse-328p +make isp-flash-328p-latest-release +``` + +Nach der Programmierung sollte die rote LED in kleinen zeitlichen Abständen 4x blinken. + + +## Download von Programmen mit Hilfe des Bootloaders + +Sobald sich am µC ein Bootloader befindet ist kein Programmiergerät mehr erforderlich. Das Programm wird über die serielle UART-Schnittstelle (via USB-Schnittstelle) in den Flash gespeichert. + +UART-Schnittstelle (Option `-P`) und Name der ELF-Programmdatei (nach `flash:w:`) sind anzupassen... + +```sh +avrdude -c arduino -p m328p -P /dev/ttyUSB0 -b 115200 -e -U flash:w:programm.elf +``` + diff --git a/software/nano-5v/bootloader-arduino/protocol b/software/nano-5v/bootloader-arduino/protocol new file mode 100644 index 0000000..8c0ea61 --- /dev/null +++ b/software/nano-5v/bootloader-arduino/protocol @@ -0,0 +1,323 @@ + 0.552750 --> 2: 3020 + 0.555474 <-- 2: 1410 + 0.803623 --> 2: 3020 + 0.806825 <-- 2: 1410 + 1.054395 --> 2: 3020 + 1.057282 <-- 2: 1410 + + 1.057514 --> 3: 4181 20 + 1.060837 <-- 3: 1401 10 + 1.061061 --> 3: 4182 20 + 1.063819 <-- 3: 1410 10 + 1.064049 --> 22: 4282 0000 0101 0101 03ff ffff ff01 0008 0000 0100 0020 + 1.068274 <-- 2: 1410 + 1.068436 --> 7: 4505 08d7 a000 20 + 1.071346 <-- 2: 1410 + 1.071432 --> 2: 5020 + 1.074021 <-- 2: 1410 + 1.084349 --> 2: 7520 + 1.087176 <-- 5: 141e 960a 10 + 1.087341 --> 6: 5650 0000 0020 + 1.090435 <-- 3: 1400 10 + 1.090608 --> 6: 5650 0000 0020 + 1.093517 <-- 3: 1400 10 + 1.093662 --> 6: 5650 0000 0020 + 1.096678 <-- 3: 1400 10 + 1.096838 --> 6: 5658 0800 0020 + 1.099974 <-- 3: 1400 10 + 1.100216 --> 6: 5658 0800 0020 + 1.103433 <-- 3: 1400 10 + 1.103621 --> 6: 5658 0800 0020 + 1.106596 <-- 3: 1400 10 + 1.106798 --> 6: 5650 0800 0020 + 1.109878 <-- 3: 1400 10 + 1.110108 --> 6: 5650 0800 0020 + 1.113015 <-- 3: 1400 10 + 1.113141 --> 6: 5650 0800 0020 + 1.116120 <-- 3: 1400 10 + 1.116256 --> 6: 56ac 8000 0020 + 1.119179 <-- 3: 1400 10 + 1.174951 --> 3: 4181 20 + 1.177570 <-- 3: 1401 10 + 1.177770 --> 3: 4182 20 + 1.180450 <-- 3: 1410 10 + 1.180666 --> 22: 4282 0000 0101 0101 03ff ffff ff01 0008 0000 0100 0020 + 1.184868 <-- 2: 1410 + 1.185056 --> 7: 4505 08d7 a000 20 + 1.187956 <-- 2: 1410 + 1.188059 --> 2: 5020 + 1.190517 <-- 2: 1410 + + 1.191326 --> 4: 5500 0020 + 1.193964 <-- 2: 1410 + + 1.194133 --> 32: 6401 0046 0c94 3e00 0c94 5b00 0c94 5b00 0c94 5b00 0c94 5b00 0c94 5b00 0c94 5b00 + 1.194154 --> 32: 0c94 5b00 0c94 5b00 0c94 5b00 0c94 5b00 0c94 5b00 0c94 5b00 0c94 ad00 0c94 5b00 + 1.194285 --> 32: 0c94 5b00 0c94 5b00 0c94 5b00 0c94 5b00 0c94 5b00 0c94 7d00 0c94 5b00 0c94 5b00 + 1.194310 --> 32: 0c94 5b00 0c94 5b00 0c94 5b00 0c94 5b00 0c94 5b00 0c94 9c00 0c94 5b00 0c94 5b00 + 1.197469 --> 32: 1124 1fbe cfef d0e1 debf cdbf 11e0 a0e0 b1e0 e8e2 f8e0 02c0 0590 0d92 aa34 b107 + 1.199991 --> 32: d9f7 21e0 aae4 b1e0 01c0 1d92 a235 b207 e1f7 0e94 d100 0c94 1204 0c94 0000 0f93 + 1.202760 --> 32: 1f93 cf93 c82f 8b01 8a30 19f4 8de0 0e94 5d00 8091 c000 85ff fccf 8091 4e01 9091 + 1.205599 --> 32: 4f01 0817 1907 19f4 c093 c600 02c0 c093 ce00 80e0 90e0 cf91 1f91 0f91 0895 1f92 + 1.208326 --> 5: 0f92 0fb6 20 + 1.255493 <-- 2: 1410 + + 1.255743 --> 4: 5580 0020 + 1.258608 <-- 2: 1410 + + 1.258821 --> 32: 6401 0046 0f92 1124 8f93 9f93 ef93 ff93 98b1 88e0 8927 88b9 8091 c600 8093 ce00 + 1.258842 --> 32: e0e0 f1e0 90e2 9083 8483 ff91 ef91 9f91 8f91 0f90 0fbe 0f90 1f90 1895 1f92 0f92 + 1.258964 --> 32: 0fb6 0f92 1124 8f93 8091 ce00 8032 09f4 429a 8f91 0f90 0fbe 0f90 1f90 1895 1f92 + 1.258995 --> 32: 0f92 0fb6 0f92 1124 2f93 8f93 9f93 8091 4a01 9091 4b01 0196 9093 4b01 8093 4a01 + 1.262021 --> 32: 883e 9340 40f0 98b1 80e1 8927 88b9 1092 4b01 1092 4a01 9f91 8f91 2f91 0f90 0fbe + 1.264633 --> 32: 0f90 1f90 1895 8ce1 87b9 8ce3 88b9 8ae0 8093 8100 8ced 95e0 9093 8900 8093 8800 + 1.267379 --> 32: 82e0 8093 6f00 8093 c000 38e9 3093 c100 26e0 2093 c200 1092 c500 9ce0 9093 c400 + 1.270166 --> 32: 8093 c800 3093 c900 2093 ca00 1092 cd00 9093 cc00 84e1 91e0 9093 4f01 8093 4e01 + 1.272904 --> 5: 86e0 91e0 20 + 1.320139 <-- 2: 1410 + + 1.320378 --> 4: 5500 0120 + 1.323002 <-- 2: 1410 + + 1.323205 --> 32: 6401 0046 9093 5101 8093 5001 1092 0001 7894 80e0 90e0 c0e0 d1e0 0ee2 11e0 359b + 1.323226 --> 32: 03c0 28e4 31e0 02c0 22e2 31e0 7c01 4fef e41a f40a 3f93 2f93 df93 cf93 9f93 8f93 + 1.323364 --> 32: 1f93 0f93 0e94 3401 8db7 9eb7 0896 0fb6 f894 9ebf 0fbe 8dbf 359b 4298 8fe2 95e7 + 1.323390 --> 32: 0197 f1f7 00c0 0000 c701 d9cf a0e0 b0e0 eae3 f1e0 0c94 eb03 ae01 4b5f 5f4f fa01 + 1.326221 --> 32: 6191 7191 af01 8091 4e01 9091 4f01 0e94 4a01 e2e0 0c94 0704 abe0 b0e0 e0e5 f1e0 + 1.329091 --> 32: 0c94 db03 6c01 7b01 8a01 fc01 1782 1682 8381 81ff ccc1 ce01 0196 3c01 f601 9381 + 1.331759 --> 32: f701 93fd 8591 93ff 8191 7f01 8823 09f4 bac1 8532 39f4 93fd 8591 93ff 8191 7f01 + 1.334544 --> 32: 8532 29f4 b601 90e0 0e94 4103 e7cf 912c 212c 312c ffe1 f315 d8f0 8b32 79f0 38f4 + 1.337305 --> 5: 8032 79f0 20 + 1.384623 <-- 2: 1410 + + 1.384878 --> 4: 5580 0120 + 1.387608 <-- 2: 1410 + + 1.387773 --> 32: 6401 0046 8332 a1f4 232d 2061 1dc0 8d32 61f0 8033 69f4 232d 2160 16c0 832d 8260 + 1.387789 --> 32: 382e e32d e460 3e2e 2ac0 f32d f860 1dc0 37fc 2dc0 20ed 280f 2a30 40f0 8e32 b9f4 + 1.387862 --> 32: 36fc 81c1 232d 2064 322e 19c0 36fe 06c0 8ae0 989e 200d 1124 922e 11c0 eae0 2e9e + 1.387921 --> 32: 200d 1124 222e f32d f062 3f2e 08c0 8c36 21f4 832d 8068 382e 02c0 8836 41f4 f701 + 1.390834 --> 32: 93fd 8591 93ff 8191 7f01 8111 b3cf 982f 9f7d 9554 9330 28f4 0c5f 1f4f 9fe3 9983 + 1.393604 --> 32: 0dc0 8336 31f0 8337 71f0 8335 09f0 59c0 21c0 f801 8081 8983 0e5f 1f4f 8824 8394 + 1.396338 --> 32: 912c 5301 13c0 2801 f2e0 4f0e 511c f801 a080 b180 36fe 03c0 692d 70e0 02c0 6fef + 1.399072 --> 32: 7fef c501 0e94 3603 4c01 8201 f32d ff77 3f2e 16c0 2801 22e0 420e 511c f801 a080 + 1.401922 --> 5: b180 36fe 20 + 1.448945 <-- 2: 1410 + + 1.449212 --> 4: 5500 0220 + 1.451904 <-- 2: 1410 + + 1.452121 --> 32: 6401 0046 03c0 692d 70e0 02c0 6fef 7fef c501 0e94 2b03 4c01 f32d f068 3f2e 8201 + 1.452143 --> 32: 33fc 1bc0 822d 90e0 8816 9906 b0f4 b601 80e2 90e0 0e94 4103 2a94 f4cf f501 37fc + 1.452282 --> 32: 8591 37fe 8191 5f01 b601 90e0 0e94 4103 2110 2a94 21e0 821a 9108 8114 9104 71f7 + 1.452308 --> 32: e8c0 8436 11f0 8936 41f5 f801 37fe 07c0 6081 7181 8281 9381 0c5f 1f4f 08c0 6081 + 1.455454 --> 32: 7181 072e 000c 880b 990b 0e5f 1f4f f32d ff76 3f2e 97ff 09c0 9095 8095 7095 6195 + 1.457980 --> 32: 7f4f 8f4f 9f4f f068 3f2e 2ae0 30e0 a301 0e94 7d03 882e 8618 45c0 8537 31f4 232d + 1.460725 --> 32: 2f7e b22e 2ae0 30e0 25c0 932d 997f b92e 8f36 c1f0 18f4 8835 79f0 b5c0 8037 19f0 + 1.463464 --> 32: 8837 21f0 b0c0 e92f e061 be2e b4fe 0dc0 fb2d f460 bf2e 09c0 34fe 0ac0 292f 2660 + 1.466235 --> 5: b22e 06c0 20 + 1.513447 <-- 2: 1410 + + 1.513715 --> 4: 5580 0220 + 1.516432 <-- 2: 1410 + + 1.516636 --> 32: 6401 0046 28e0 30e0 05c0 20e1 30e0 02c0 20e1 32e0 f801 b7fe 07c0 6081 7181 8281 + 1.516663 --> 32: 9381 0c5f 1f4f 06c0 6081 7181 80e0 90e0 0e5f 1f4f a301 0e94 7d03 882e 8618 fb2d + 1.516831 --> 32: ff77 3f2e 36fe 0dc0 232d 2e7f a22e 8914 58f4 34fe 0bc0 32fc 09c0 832d 8e7e a82e + 1.516877 --> 32: 05c0 b82c a32c 03c0 b82c 01c0 b92c a4fe 0fc0 fe01 e80d f11d 8081 8033 21f4 9a2d + 1.519644 --> 32: 997e a92e 09c0 a2fe 06c0 b394 b394 04c0 8a2d 8678 09f0 b394 a3fc 11c0 a0fe 06c0 + 1.522490 --> 32: b214 88f4 280c 922c 9b18 0ec0 b214 60f4 b601 80e2 90e0 0e94 4103 b394 f7cf b214 + 1.525257 --> 32: 18f4 2b18 02c0 982c 212c a4fe 10c0 b601 80e3 90e0 0e94 4103 a2fe 17c0 a1fc 03c0 + 1.527986 --> 32: 88e7 90e0 02c0 88e5 90e0 b601 0cc0 8a2d 8678 59f0 a1fe 02c0 8be2 01c0 80e2 a7fc + 1.530784 --> 5: 8de2 b601 20 + 1.577915 <-- 2: 1410 + + 1.578186 --> 4: 5500 0320 + 1.580952 <-- 2: 1410 + + 1.581190 --> 32: 6401 0046 90e0 0e94 4103 8914 38f4 b601 80e3 90e0 0e94 4103 9a94 f7cf 8a94 f301 + 1.581212 --> 32: e80d f11d 8081 b601 90e0 0e94 4103 8110 f5cf 2220 09f4 42ce b601 80e2 90e0 0e94 + 1.581358 --> 32: 4103 2a94 f6cf f601 8681 9781 02c0 8fef 9fef 2b96 e2e1 0c94 f703 fc01 0590 6150 + 1.581385 --> 32: 7040 0110 d8f7 8095 9095 8e0f 9f1f 0895 fc01 6150 7040 0190 0110 d8f7 8095 9095 + 1.584265 --> 32: 8e0f 9f1f 0895 0f93 1f93 cf93 df93 fb01 2381 21fd 03c0 8fef 9fef 2cc0 22ff 16c0 + 1.587011 --> 32: 4681 5781 2481 3581 4217 5307 44f4 a081 b181 9d01 2f5f 3f4f 3183 2083 8c93 2681 + 1.589734 --> 32: 3781 2f5f 3f4f 3783 2683 14c0 8b01 ec01 fb01 0084 f185 e02d 0995 892b e1f6 d801 + 1.592493 --> 32: 1696 8d91 9c91 1797 0196 1796 9c93 8e93 1697 ce01 df91 cf91 1f91 0f91 0895 fa01 + 1.595249 --> 5: aa27 2830 20 + 1.642464 <-- 2: 1410 + + 1.642718 --> 4: 5580 0320 + 1.645473 <-- 2: 1410 + + 1.645679 --> 32: 6401 0046 51f1 2031 81f1 e894 6f93 6e7f 6e5f 7f4f 8f4f 9f4f af4f b1e0 3ed0 b4e0 + 1.645701 --> 32: 3cd0 670f 781f 891f 9a1f a11d 680f 791f 8a1f 911d a11d 6a0f 711d 811d 911d a11d + 1.645848 --> 32: 20d0 09f4 6894 3f91 2ae0 269f 1124 3019 305d 3193 def6 cf01 0895 462f 4770 405d + 1.645887 --> 32: 4193 b3e0 0fd0 c9f7 f6cf 462f 4f70 405d 4a33 18f0 495d 31fd 4052 4193 02d0 a9f7 + 1.648691 --> 32: eacf b4e0 a695 9795 8795 7795 6795 ba95 c9f7 0097 6105 7105 0895 9b01 ac01 0a2e + 1.651486 --> 32: 0694 5795 4795 3795 2795 ba95 c9f7 620f 731f 841f 951f a01d 0895 2f92 3f92 4f92 + 1.654229 --> 32: 5f92 6f92 7f92 8f92 9f92 af92 bf92 cf92 df92 ef92 ff92 0f93 1f93 cf93 df93 cdb7 + 1.657068 --> 32: deb7 ca1b db0b 0fb6 f894 debf 0fbe cdbf 0994 2a88 3988 4888 5f84 6e84 7d84 8c84 + 1.659779 --> 5: 9b84 aa84 20 + 1.706941 <-- 2: 1410 + + 1.707172 --> 4: 5500 0420 + 1.709845 <-- 2: 1410 + + 1.710064 --> 32: 6401 0046 b984 c884 df80 ee80 fd80 0c81 1b81 aa81 b981 ce0f d11d 0fb6 f894 debf + 1.710085 --> 32: 0fbe cdbf ed01 0895 f894 ffcf 202d 3e20 5800 0000 0002 0000 0000 5d00 0000 0000 + 1.710260 --> 32: 0000 0002 0000 0000 5d00 0000 0000 5357 3220 7072 6573 7365 6400 2530 3478 3a20 + 1.710304 --> 32: 4865 6c6c 6f20 776f 726c 6425 7320 2025 3132 730d 0000 ffff ffff ffff ffff ffff + 1.713085 --> 32: ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff + 1.715997 --> 32: ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff + 1.718639 --> 32: ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff + 1.721439 --> 32: ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff + 1.724135 --> 5: ffff ffff 20 + 1.771467 <-- 2: 1410 + + 1.772647 --> 4: 5500 0020 + 1.775440 <-- 2: 1410 + + 1.775659 --> 5: 7401 0046 20 + 1.779386 <-- 32: 140c 943e 000c 945b 000c 945b 000c 945b 000c 945b 000c 945b 000c 945b 000c 945b + 1.781924 <-- 32: 000c 945b 000c 945b 000c 945b 000c 945b 000c 945b 000c 94ad 000c 945b 000c 945b + 1.784614 <-- 32: 000c 945b 000c 945b 000c 945b 000c 945b 000c 947d 000c 945b 000c 945b 000c 945b + 1.787364 <-- 32: 000c 945b 000c 945b 000c 945b 000c 945b 000c 949c 000c 945b 000c 945b 0011 241f + 1.790456 <-- 32: becf efd0 e1de bfcd bf11 e0a0 e0b1 e0e8 e2f8 e002 c005 900d 92aa 34b1 07d9 f721 + 1.792965 <-- 32: e0aa e4b1 e001 c01d 92a2 35b2 07e1 f70e 94d1 000c 9412 040c 9400 000f 931f 93cf + 1.795688 <-- 32: 93c8 2f8b 018a 3019 f48d e00e 945d 0080 91c0 0085 fffc cf80 914e 0190 914f 0108 + 1.798432 <-- 32: 1719 0719 f4c0 93c6 0002 c0c0 93ce 0080 e090 e0cf 911f 910f 9108 951f 920f 920f + 1.800632 <-- 2: b610 + + 1.800878 --> 4: 5580 0020 + 1.803619 <-- 2: 1410 + + 1.803814 --> 5: 7401 0046 20 + 1.807479 <-- 32: 140f 9211 248f 939f 93ef 93ff 9398 b188 e089 2788 b980 91c6 0080 93ce 00e0 e0f1 + 1.809984 <-- 32: e090 e290 8384 83ff 91ef 919f 918f 910f 900f be0f 901f 9018 951f 920f 920f b60f + 1.812844 <-- 32: 9211 248f 9380 91ce 0080 3209 f442 9a8f 910f 900f be0f 901f 9018 951f 920f 920f + 1.815639 <-- 32: b60f 9211 242f 938f 939f 9380 914a 0190 914b 0101 9690 934b 0180 934a 0188 3e93 + 1.818304 <-- 32: 4040 f098 b180 e189 2788 b910 924b 0110 924a 019f 918f 912f 910f 900f be0f 901f + 1.821082 <-- 32: 9018 958c e187 b98c e388 b98a e080 9381 008c ed95 e090 9389 0080 9388 0082 e080 + 1.823911 <-- 32: 936f 0080 93c0 0038 e930 93c1 0026 e020 93c2 0010 92c5 009c e090 93c4 0080 93c8 + 1.826612 <-- 32: 0030 93c9 0020 93ca 0010 92cd 0090 93cc 0084 e191 e090 934f 0180 934e 0186 e091 + 1.828744 <-- 2: e010 + + 1.828876 --> 4: 5500 0120 + 1.831444 <-- 2: 1410 + + 1.831620 --> 5: 7401 0046 20 + 1.835129 <-- 32: 1490 9351 0180 9350 0110 9200 0178 9480 e090 e0c0 e0d1 e00e e211 e035 9b03 c028 + 1.837845 <-- 32: e431 e002 c022 e231 e07c 014f efe4 1af4 0a3f 932f 93df 93cf 939f 938f 931f 930f + 1.840579 <-- 32: 930e 9434 018d b79e b708 960f b6f8 949e bf0f be8d bf35 9b42 988f e295 e701 97f1 + 1.843432 <-- 32: f700 c000 00c7 01d9 cfa0 e0b0 e0ea e3f1 e00c 94eb 03ae 014b 5f5f 4ffa 0161 9171 + 1.846426 <-- 32: 91af 0180 914e 0190 914f 010e 944a 01e2 e00c 9407 04ab e0b0 e0e0 e5f1 e00c 94db + 1.848837 <-- 32: 036c 017b 018a 01fc 0117 8216 8283 8181 ffcc c1ce 0101 963c 01f6 0193 81f7 0193 + 1.851649 <-- 32: fd85 9193 ff81 917f 0188 2309 f4ba c185 3239 f493 fd85 9193 ff81 917f 0185 3229 + 1.854442 <-- 32: f4b6 0190 e00e 9441 03e7 cf91 2c21 2c31 2cff e1f3 15d8 f08b 3279 f038 f480 3279 + 1.856623 <-- 2: f010 + + 1.856748 --> 4: 5580 0120 + 1.859363 <-- 2: 1410 + + 1.859447 --> 5: 7401 0046 20 + 1.862911 <-- 32: 1483 32a1 f423 2d20 611d c08d 3261 f080 3369 f423 2d21 6016 c083 2d82 6038 2ee3 + 1.865610 <-- 32: 2de4 603e 2e2a c0f3 2df8 601d c037 fc2d c020 ed28 0f2a 3040 f08e 32b9 f436 fc81 + 1.868409 <-- 32: c123 2d20 6432 2e19 c036 fe06 c08a e098 9e20 0d11 2492 2e11 c0ea e02e 9e20 0d11 + 1.871210 <-- 32: 2422 2ef3 2df0 623f 2e08 c08c 3621 f483 2d80 6838 2e02 c088 3641 f4f7 0193 fd85 + 1.873963 <-- 32: 9193 ff81 917f 0181 11b3 cf98 2f9f 7d95 5493 3028 f40c 5f1f 4f9f e399 830d c083 + 1.876709 <-- 32: 3631 f083 3771 f083 3509 f059 c021 c0f8 0180 8189 830e 5f1f 4f88 2483 9491 2c53 + 1.879571 <-- 32: 0113 c028 01f2 e04f 0e51 1cf8 01a0 80b1 8036 fe03 c069 2d70 e002 c06f ef7f efc5 + 1.882458 <-- 32: 010e 9436 034c 0182 01f3 2dff 773f 2e16 c028 0122 e042 0e51 1cf8 01a0 80b1 8036 + 1.884340 <-- 2: fe10 + + 1.884567 --> 4: 5500 0220 + 1.887255 <-- 2: 1410 + + 1.887443 --> 5: 7401 0046 20 + 1.890818 <-- 32: 1403 c069 2d70 e002 c06f ef7f efc5 010e 942b 034c 01f3 2df0 683f 2e82 0133 fc1b + 1.893598 <-- 32: c082 2d90 e088 1699 06b0 f4b6 0180 e290 e00e 9441 032a 94f4 cff5 0137 fc85 9137 + 1.896393 <-- 32: fe81 915f 01b6 0190 e00e 9441 0321 102a 9421 e082 1a91 0881 1491 0471 f7e8 c084 + 1.899280 <-- 32: 3611 f089 3641 f5f8 0137 fe07 c060 8171 8182 8193 810c 5f1f 4f08 c060 8171 8107 + 1.902001 <-- 32: 2e00 0c88 0b99 0b0e 5f1f 4ff3 2dff 763f 2e97 ff09 c090 9580 9570 9561 957f 4f8f + 1.904757 <-- 32: 4f9f 4ff0 683f 2e2a e030 e0a3 010e 947d 0388 2e86 1845 c085 3731 f423 2d2f 7eb2 + 1.907577 <-- 32: 2e2a e030 e025 c093 2d99 7fb9 2e8f 36c1 f018 f488 3579 f0b5 c080 3719 f088 3721 + 1.910469 <-- 32: f0b0 c0e9 2fe0 61be 2eb4 fe0d c0fb 2df4 60bf 2e09 c034 fe0a c029 2f26 60b2 2e06 + 1.912524 <-- 2: c010 + + 1.912815 --> 4: 5580 0220 + 1.915611 <-- 2: 1410 + + 1.915811 --> 5: 7401 0046 20 + 1.919244 <-- 32: 1428 e030 e005 c020 e130 e002 c020 e132 e0f8 01b7 fe07 c060 8171 8182 8193 810c + 1.921988 <-- 32: 5f1f 4f06 c060 8171 8180 e090 e00e 5f1f 4fa3 010e 947d 0388 2e86 18fb 2dff 773f + 1.924734 <-- 32: 2e36 fe0d c023 2d2e 7fa2 2e89 1458 f434 fe0b c032 fc09 c083 2d8e 7ea8 2e05 c0b8 + 1.927531 <-- 32: 2ca3 2c03 c0b8 2c01 c0b9 2ca4 fe0f c0fe 01e8 0df1 1d80 8180 3321 f49a 2d99 7ea9 + 1.930309 <-- 32: 2e09 c0a2 fe06 c0b3 94b3 9404 c08a 2d86 7809 f0b3 94a3 fc11 c0a0 fe06 c0b2 1488 + 1.933091 <-- 32: f428 0c92 2c9b 180e c0b2 1460 f4b6 0180 e290 e00e 9441 03b3 94f7 cfb2 1418 f42b + 1.935886 <-- 32: 1802 c098 2c21 2ca4 fe10 c0b6 0180 e390 e00e 9441 03a2 fe17 c0a1 fc03 c088 e790 + 1.938647 <-- 32: e002 c088 e590 e0b6 010c c08a 2d86 7859 f0a1 fe02 c08b e201 c080 e2a7 fc8d e2b6 + 1.940863 <-- 2: 0110 + + 1.941071 --> 4: 5500 0320 + 1.943869 <-- 2: 1410 + + 1.944088 --> 5: 7401 0046 20 + 1.947433 <-- 32: 1490 e00e 9441 0389 1438 f4b6 0180 e390 e00e 9441 039a 94f7 cf8a 94f3 01e8 0df1 + 1.950256 <-- 32: 1d80 81b6 0190 e00e 9441 0381 10f5 cf22 2009 f442 ceb6 0180 e290 e00e 9441 032a + 1.953054 <-- 32: 94f6 cff6 0186 8197 8102 c08f ef9f ef2b 96e2 e10c 94f7 03fc 0105 9061 5070 4001 + 1.955732 <-- 32: 10d8 f780 9590 958e 0f9f 1f08 95fc 0161 5070 4001 9001 10d8 f780 9590 958e 0f9f + 1.958565 <-- 32: 1f08 950f 931f 93cf 93df 93fb 0123 8121 fd03 c08f ef9f ef2c c022 ff16 c046 8157 + 1.961369 <-- 32: 8124 8135 8142 1753 0744 f4a0 81b1 819d 012f 5f3f 4f31 8320 838c 9326 8137 812f + 1.964157 <-- 32: 5f3f 4f37 8326 8314 c08b 01ec 01fb 0100 84f1 85e0 2d09 9589 2be1 f6d8 0116 968d + 1.966902 <-- 32: 919c 9117 9701 9617 969c 938e 9316 97ce 01df 91cf 911f 910f 9108 95fa 01aa 2728 + 1.969047 <-- 2: 3010 + + 1.969248 --> 4: 5580 0320 + 1.972047 <-- 2: 1410 + + 1.972246 --> 5: 7401 0046 20 + 1.975748 <-- 32: 1451 f120 3181 f1e8 946f 936e 7f6e 5f7f 4f8f 4f9f 4faf 4fb1 e03e d0b4 e03c d067 + 1.978498 <-- 32: 0f78 1f89 1f9a 1fa1 1d68 0f79 1f8a 1f91 1da1 1d6a 0f71 1d81 1d91 1da1 1d20 d009 + 1.981514 <-- 32: f468 943f 912a e026 9f11 2430 1930 5d31 93de f6cf 0108 9546 2f47 7040 5d41 93b3 + 1.983891 <-- 32: e00f d0c9 f7f6 cf46 2f4f 7040 5d4a 3318 f049 5d31 fd40 5241 9302 d0a9 f7ea cfb4 + 1.986799 <-- 32: e0a6 9597 9587 9577 9567 95ba 95c9 f700 9761 0571 0508 959b 01ac 010a 2e06 9457 + 1.989512 <-- 32: 9547 9537 9527 95ba 95c9 f762 0f73 1f84 1f95 1fa0 1d08 952f 923f 924f 925f 926f + 1.992260 <-- 32: 927f 928f 929f 92af 92bf 92cf 92df 92ef 92ff 920f 931f 93cf 93df 93cd b7de b7ca + 1.995029 <-- 32: 1bdb 0b0f b6f8 94de bf0f becd bf09 942a 8839 8848 885f 846e 847d 848c 849b 84aa + 1.997163 <-- 2: 8410 + + 1.997338 --> 4: 5500 0420 + 2.000161 <-- 2: 1410 + + 2.000367 --> 5: 7401 0046 20 + 2.003803 <-- 32: 14b9 84c8 84df 80ee 80fd 800c 811b 81aa 81b9 81ce 0fd1 1d0f b6f8 94de bf0f becd + 2.006477 <-- 32: bfed 0108 95f8 94ff cf20 2d3e 2058 0000 0000 0200 0000 005d 0000 0000 0000 0000 + 2.009429 <-- 32: 0200 0000 005d 0000 0000 0053 5732 2070 7265 7373 6564 0025 3034 783a 2048 656c + 2.012149 <-- 32: 6c6f 2077 6f72 6c64 2573 2020 2531 3273 0d00 00ff ffff ffff ffff ffff ffff ffff + 2.014971 <-- 32: ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff + 2.017659 <-- 32: ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff + 2.020387 <-- 32: ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff + 2.023167 <-- 32: ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff + 2.025368 <-- 2: ff10 + + 2.025949 --> 6: 5650 0000 0020 + 2.028775 <-- 3: 1400 10 + 2.028918 --> 6: 5650 0000 0020 + 2.031848 <-- 3: 1400 10 + 2.031977 --> 6: 5650 0000 0020 + 2.034973 <-- 3: 1400 10 + 2.035141 --> 6: 5658 0800 0020 + 2.038215 <-- 3: 1400 10 + 2.038413 --> 6: 5658 0800 0020 + 2.041454 <-- 3: 1400 10 + 2.041646 --> 6: 5658 0800 0020 + 2.044533 <-- 3: 1400 10 + 2.044682 --> 6: 5650 0800 0020 + 2.047749 <-- 3: 1400 10 + 2.047987 --> 6: 5650 0800 0020 + 2.050921 <-- 3: 1400 10 + 2.051154 --> 6: 5650 0800 0020 + 2.054178 <-- 3: 1400 10 + + 2.054415 --> 2: 5120 + 2.056864 <-- 2: 1410 diff --git a/software/nano-5v/bootloader-arduino/release/2024-09-05_124618/bootloader-arduino_nano-5v-328p.elf b/software/nano-5v/bootloader-arduino/release/2024-09-05_124618/bootloader-arduino_nano-5v-328p.elf new file mode 100755 index 0000000000000000000000000000000000000000..edd111b8cd213c3e2f54d08370f99219521d6038 GIT binary patch literal 8608 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 literal 0 HcmV?d00001 diff --git a/software/nano-5v/bootloader-arduino/release/2024-09-05_124618/bootloader-arduino_nano-5v-328p.hex b/software/nano-5v/bootloader-arduino/release/2024-09-05_124618/bootloader-arduino_nano-5v-328p.hex new file mode 100644 index 0000000..db79f9f --- /dev/null +++ b/software/nano-5v/bootloader-arduino/release/2024-09-05_124618/bootloader-arduino_nano-5v-328p.hex @@ -0,0 +1,97 @@ +:107000000C943F380C9451380C9451380C945138EE +:107010000C9451380C9451380C9451380C945138CC +:107020000C9451380C9451380C9451380C945138BC +:107030000C9451380C9451380C9451380C945138AC +:107040000C9451380C9451380C9451380C9451389C +:107050000C9451380C9451380C9451380C9451388C +:107060000C9451380C94513831323A34363A313824 +:107070000053657020203520323032340000112456 +:107080001FBECFEFD8E0DEBFCDBF21E0A0E0B1E072 +:1070900001C01D92AC38B207E1F70E942F390C9461 +:1070A000EF3A0C9400389091C00095FFFCCF80938C +:1070B000C6000895CF93982F8595859585958595DC +:1070C000805D9F709A3014F0C7E501C0C0E3C90F1E +:1070D0000E9453388C2FCF910C945338CF92DF926B +:1070E000EF92FF92C12CD12C76018091C00087FDD8 +:1070F00015C08FEFC81AD80AE80AF80A81E4C81642 +:1071000082E4D8068FE0E806F10478F317B818B8DF +:10711000E0910001F09101010995E7CF8091C6004F +:10712000FF90EF90DF90CF900895CF930E946E383C +:10713000C82F0E945338C13614F089EA03C0C03307 +:107140001CF080ED8C0F01C08C2FCF910895CF9350 +:107150000E949538C82F0E94953890E1C99F800DF4 +:107160001124CF910895CF93C82FCC2321F00E94F2 +:107170006E38C150FACFCF910895CF93C82F0E9497 +:107180006E38803251F484E10E9453388C2F0E9473 +:10719000533880E1CF910C945338809102018F5F76 +:1071A00080930201853041F417B818B8E0910001CE +:1071B000F0910101CF910994CF9108950E946E380A +:1071C000803231F484E10E94533880E10C945338CA +:1071D000809102018F5F80930201853039F417B8E6 +:1071E00018B8E0910001F091010109940895CF933E +:1071F000DF9300D000D0CDB7DEB719821A821B8290 +:107200001C8289819A81AB81BC8181159042A14009 +:10721000B10580F48091C00087FD0CC089819A81FE +:10722000AB81BC810196A11DB11D89839A83AB837B +:10723000BC83E7CF0F900F900F900F90DF91CF910D +:107240000895CF93C82FCC2341F02D9A0E94F73890 +:107250002D980E94F738C150F6CFCF9108950000C5 +:1072600015B8259A82E08093C00080E18093C40025 +:107270001092C50088E18093C10086E08093C2002F +:1072800084E00E94213913E001E0E5E0FE2EF1E107 +:10729000EF2E0E946E38803309F447C0813319F510 +:1072A0000E946E388032B9F484E10E94533881E440 +:1072B0000E94533886E50E94533882E50E94533875 +:1072C00080E20E94533889E40E94533883E50E948B +:1072D000533880E56BC1809102018F5F809302017A +:1072E0008530B9F670C1803439F40E946E38863822 +:1072F000E0F00E946E3819C0813491F40E946E381B +:10730000803811F481EF44C0813811F481E040C02D +:10731000823811F480E13CC08839C9F583E038C077 +:10732000823431F484E10E94B3380E94DE38B1CF58 +:10733000853411F485E0F7CF982F9D7F9035A9F320 +:10734000813599F3853549F40E946E3880938A011E +:107350000E946E3880938B01E8CF8635E1F40E945D +:107360006E38803389F40E946E380E946E38C82FC0 +:107370000E946E38C11102C08EE10AC0C13011F402 +:1073800085E906C08FE004C083E00E94B33880E046 +:107390000E94BD387ECF843609F0A6C00E946E38A8 +:1073A000809389010E946E388093880180918701C3 +:1073B0008E7F809387010E946E38853429F48091F6 +:1073C0008701816080938701C6E0D1E06E01209142 +:1073D000880130918901C601865091408217930738 +:1073E00030F40E946E38F60181936F01F0CF0E9455 +:1073F0006E38803209F0E0C02091870180918A01C7 +:1074000090918B01880F991F90938B0180938A0133 +:1074100020FF23C0E6E0F1E020918801309189014E +:10742000CF01865091408217930708F05BC0F9990D +:10743000FECF80918A0190918B0192BD81BD819197 +:1074400080BDFA9AF99A80918A0190918B010196F8 +:1074500090938B0180938A01DFCF8091880180FF18 +:1074600009C08091880190918901019690938901CA +:1074700080938801F89440918A0150918B01F99989 +:10748000FECF07B600FCFDCF2D9AFA0110935700EE +:10749000E89507B600FCFDCF2D9820E030E0FA011A +:1074A000E20FF31F898190E0982F88276881860F6B +:1074B000911D0C0100935700E89511242E5F3F4F5A +:1074C00022962038310559F73093050120930401A5 +:1074D000FA01F0925700E89507B600FCFDCFE09264 +:1074E0005700E89584E162C0843709F04FC00E94DC +:1074F0006E38809389010E946E3880938801809154 +:107500008A0190918B01880F991F90938B01809332 +:107510008A010E946E3890918701853411F4916040 +:1075200001C09E7F909387010E946E38803209F0DF +:107530003FC084E10E945338C0E0D0E080918801D0 +:1075400090918901C817D90798F58091870180FF2C +:107550000BC0F999FECF80918A0190918B0192BD69 +:1075600081BDF89A80B505C0E0918A01F0918B0148 +:1075700084910E94533880918A0190918B010196E9 +:1075800090938B0180938A012196D8CF853719F586 +:107590000E946E38803281F484E10E9453388EE17B +:1075A0000E94533885E90E9453388FE00E94533877 +:1075B00080E10E9453386DCE809102018F5F8093ED +:1075C0000201853009F417B818B8E0910001F09174 +:1075D000010109955ECE863709F05BCED8CEF894CE +:0275E000FFCFDB +:040000030000700089 +:00000001FF diff --git a/software/nano-5v/bootloader-arduino/src/main.c b/software/nano-5v/bootloader-arduino/src/main.c new file mode 100644 index 0000000..0f542db --- /dev/null +++ b/software/nano-5v/bootloader-arduino/src/main.c @@ -0,0 +1,543 @@ +/*************************************************************************************************/ +/* Serial Bootloader for Atmel megaAVR Controllers */ +/* */ +/* Source-code taken from: */ +/* https://github.com/arduino/ArduinoCore-avr/blob/master/bootloaders/atmega/ATmegaBOOT_168.c */ +/* Branch@hash: master@321fca0b */ +/* */ +/* Licence can be viewed at http://www.fsf.org/licenses/gpl.txt */ +/* */ +/*************************************************************************************************/ + +#include + +#include +#include +#include +#include +#include +// #include + +// #define DEBUG_UART1 +#ifdef DEBUG_UART1 + #include +#endif + +// after this many errors give up and launch application +#define MAX_ERROR_COUNT 5 + +#define HW_VER 0xF1 +#define SW_MAJOR 0x01 +#define SW_MINOR 0x10 + +// onboard LED is used to indicate, that the bootloader was entered +#ifdef __AVR_ATmega328P__ + #define SET_LED_RED (PORTB |= (1 << PB5)) + #define CLR_LED_RED (PORTB &= ~(1 << PB5)) +#endif +#if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) + #define SET_LED_RED (PORTC |= (1 << PC2)) + #define CLR_LED_RED (PORTC &= ~(1 << PC2)) + #define SET_LED_ORANGE (PORTC |= (1 << PC3)) + #define CLR_LED_ORANGE (PORTC &= ~(1 << PC3)) + #define SET_LED_GREEN (PORTC |= (1 << PC4)) + #define CLR_LED_GREEN (PORTC &= ~(1 << PC4)) +#endif + +// function prototypes +void putch(char); +char getch(void); +void getNch(uint8_t); +void byte_response(uint8_t); +void nothing_response(void); +char gethex(void); +void puthex(char); +void flash_led(uint8_t); + +volatile const char DATE [] PROGMEM = __DATE__; +volatile const char TIME [] PROGMEM = __TIME__; + +#ifdef DEBUG_UART1 + int uart_putchar(char c, FILE *stream) { + if (c == '\n') { + uart_putchar('\r', stream); + } + loop_until_bit_is_set(UCSR1A, UDRE1); + UDR1 = c; + return 0; + } + + static FILE mystdout = FDEV_SETUP_STREAM(uart_putchar, NULL, _FDEV_SETUP_WRITE); +#endif + +// some variables +union address_union { + uint16_t word; + uint8_t byte[2]; +} address; + +union length_union { + uint16_t word; + uint8_t byte[2]; +} length; + +struct flags_struct { + unsigned eeprom : 1; + unsigned rampz : 1; +} flags; + +uint8_t buff[SPM_PAGESIZE + 1]; +// uint8_t address_high; +// uint8_t pagesz=0x80; + +uint16_t i; +uint8_t bootuart = 0; + +uint8_t error_count = 0; + +void (*app_start)(void) = 0x0000; + +int main () { + uint8_t ch, ch2; + uint16_t w; + + #ifdef WATCHDOG_MODS + ch = MCUSR; + MCUSR = 0; + + WDTCSR |= _BV(WDCE) | _BV(WDE); + WDTCSR = 0; + + // Check if the WDT was used to reset, in which case we dont bootload and skip straight to the code. woot. + if (! (ch & _BV(EXTRF))) // if its a not an external reset... + app_start(); // skip bootloader + #else + asm volatile("nop\n\t"); + #endif + + // LED ports output and off, ensure that Q1 (battery power) on (PC7) + #ifdef __AVR_ATmega328P__ + PORTB = 0; + DDRB |= (1 << PB5); + #endif + #if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) + PORTC = 0; + DDRC = (1 << PC7) | (1 << PC4) | (1 << PC3) |(1 << PC2); + #endif + + #ifdef DOUBLE_SPEED + UCSR0A = (1 << U2X0); // Double speed mode USART0 + UBRR0L = (uint8_t)(F_CPU / (BAUD_RATE *8L) - 1); + UBRR0H = (F_CPU / (BAUD_RATE * 8L) - 1) >> 8; + #ifdef DEBUG_UART1 + UCSR1A = (1 << U2X1); // Double speed mode USART0 + UBRR1L = (uint8_t)(F_CPU / (BAUD_RATE *8L) - 1); + UBRR1H = (F_CPU / (BAUD_RATE * 8L) - 1) >> 8; + #endif + #else + UBRR0L = (uint8_t)(F_CPU / (BAUD_RATE * 16L) - 1); + UBRR0H = (F_CPU / (BAUD_RATE*16L)-1) >> 8; + #ifdef DEBUG_UART1 + UBRR1L = (uint8_t)(F_CPU / (BAUD_RATE * 16L) - 1); + UBRR1H = (F_CPU / (BAUD_RATE*16L)-1) >> 8; + #endif + #endif + + UCSR0B = (1< 0x85) getch(); + nothing_response(); + + // ***************************** + // AVR ISP/STK500 board requests + // ***************************** + + } else if (ch == 'A') { // 0x41 + ch2 = getch(); + if (ch2 == 0x80) { + byte_response(HW_VER); // Hardware version + } else if (ch2 == 0x81) { + byte_response(SW_MAJOR); // Software major version + } else if(ch2 == 0x82) { + byte_response(SW_MINOR); // Software minor version + } else if(ch2==0x98) { + byte_response(0x03); // Unknown but seems to be required by avr studio 3.56 + } else { + byte_response(0x00); // Covers various unnecessary responses we don't care about + } + + } else if (ch == 'B') { // B: 0x42 + // Device Parameters DON'T CARE, DEVICE IS FIXED + getNch(20); + nothing_response(); + + + } else if (ch == 'E') { // E: 0x45 + // Parallel programming stuff DON'T CARE + getNch(5); + nothing_response(); + + } else if (ch == 'P' || ch == 'R') { // P: 0x50, R: 0x52 + // P: Enter programming mode + // R: Erase device, don't care as we will erase one page at a time anyway. + nothing_response(); + + } else if (ch == 'Q') { // Q: 0x51 + // Leave programming mode + nothing_response(); + #ifdef WATCHDOG_MODS + // autoreset via watchdog (sneaky!) + WDTCSR = _BV(WDE); + while (1); // 16 ms + #endif + + } else if(ch == 'U') { // U: 0x55 + // Set address, little endian. EEPROM in bytes, FLASH in words + // Perhaps extra address bytes may be added in future to support > 128kB FLASH. + // This might explain why little endian was used here, big endian used everywhere else. + address.byte[0] = getch(); + address.byte[1] = getch(); + nothing_response(); + + + } else if (ch == 'V') { // V: 0x56 + // Universal SPI programming command, disabled. Would be used for fuses and lock bits. + if (getch() == 0x30) { + getch(); + ch = getch(); + getch(); + if (ch == 0) { + byte_response(SIGNATURE_0); + } else if (ch == 1) { + byte_response(SIGNATURE_1); + } else { + byte_response(SIGNATURE_2); + } + } else { + getNch(3); + byte_response(0x00); + } + + } else if (ch == 'd') { // d: 0x64 + // Write memory, length is big endian and is in bytes + length.byte[1] = getch(); + length.byte[0] = getch(); + flags.eeprom = 0; + if (getch() == 'E') { + flags.eeprom = 1; + } + for (w = 0; w < length.word; w++) { + // Store data in buffer, can't keep up with serial data stream whilst programming pages + buff[w] = getch(); + } + if (getch() == ' ') { + if (flags.eeprom) { + // Write to EEPROM one byte at a time + address.word <<= 1; + for(w = 0; w < length.word; w++) { + while(EECR & (1< 127) { + //Only possible with m128, m256 will need 3rd address byte. FIXME + RAMPZ = 0x01; + } else { + RAMPZ = 0x00; + } + #endif + + // address * 2 -> byte location + address.word = address.word << 1; + if ((length.byte[0] & 0x01)) { + // Even up an odd number of bytes + length.word++; + } + cli(); + + uint16_t addr = address.word; + #ifdef DEBUG_UART1 + printf("Programming: address=0x%04x length=0x%04x\n", addr, length.word); + printf(" eeprom_busy_wait() ..."); + #endif + eeprom_busy_wait(); + boot_spm_busy_wait(); + #ifdef DEBUG_UART1 + printf("done\n"); + printf(" boot_page_erase(0x%04x)...", address.word); + #endif + SET_LED_RED; + boot_page_erase(addr); + boot_spm_busy_wait (); + CLR_LED_RED; + #ifdef DEBUG_UART1 + printf("done\n"); + printf(" boot_page_fill(0x%04x, ...): ", address.word); + #endif + for (i = 0; i < SPM_PAGESIZE; i += 2) { + uint16_t w = buff[i] + (buff[i + 1] << 8); + #ifdef DEBUG_UART1 + printf("."); + #endif + boot_page_fill(addr + i, w); + } + #ifdef DEBUG_UART1 + printf("\n boot_page_write(0x%04x)...", address.word); + #endif + boot_page_write(addr); + boot_spm_busy_wait(); + #ifdef DEBUG_UART1 + printf("done\n"); + printf(" boot_rww_enable()\n"); + #endif + boot_rww_enable(); + } + putch(0x14); + putch(0x10); + + } else { + if (++error_count == MAX_ERROR_COUNT) + DDRC = 0; PORTC = 0; + app_start(); + } + + } else if (ch == 't') { // t: 0x74 + // Read memory block mode, length is big endian. */ + length.byte[1] = getch(); + length.byte[0] = getch(); + // if (address.word>0x7FFF) flags.rampz = 1; // No go with m256, FIXME + // else flags.rampz = 0; + address.word = address.word << 1; // address * 2 -> byte location + if (getch() == 'E') { + flags.eeprom = 1; + } else { + flags.eeprom = 0; + } + if (getch() == ' ') { + // Command terminator + putch(0x14); + for (w = 0; w < length.word; w++) { + // Can handle odd and even lengths okay + if (flags.eeprom) { // Byte access EEPROM read + while(EECR & (1<= 'a') { + return (a - 'a' + 0x0a); + } else if (a >= '0') { + return (a - '0'); + } + return a; +} + + +char gethex () { + return (gethexnib() << 4) + gethexnib(); +} + + +void puthex (char ch) { + char ah; + + ah = ch >> 4; + if(ah >= 0x0a) { + ah = ah - 0x0a + 'a'; + } else { + ah += '0'; + } + + ch &= 0x0f; + if(ch >= 0x0a) { + ch = ch - 0x0a + 'a'; + } else { + ch += '0'; + } + + putch(ah); + putch(ch); +} + + +void putch (char ch) { + while (!(UCSR0A & _BV(UDRE0))); + UDR0 = ch; +} + + +char getch () { + uint32_t count = 0; + while( !(UCSR0A & _BV(RXC0)) ) { + count++; + if (count > MAX_TIME_COUNT) { + DDRC = 0; PORTC = 0; + app_start(); + } + } + return UDR0; +} + + +void getNch (uint8_t count) { + while(count--) { + getch(); + } +} + + +void byte_response (uint8_t val) { + if (getch() == ' ') { + putch(0x14); + putch(val); + putch(0x10); + } else if (++error_count == MAX_ERROR_COUNT) { + DDRC = 0; PORTC = 0; + app_start(); + } +} + +void nothing_response () { + if (getch() == ' ') { + putch(0x14); + putch(0x10); + } else if (++error_count == MAX_ERROR_COUNT) { + DDRC = 0; PORTC = 0; + app_start(); + } +} + +void delay () { + // app. 200ms + for (volatile uint32_t timer = 0; timer < 0x12000; timer++) { + if (UCSR0A & _BV(RXC0)) { + return; + } + } +} + +void flash_led (uint8_t count) { + #ifdef __AVR_ATmega328P__ + while (count--) { + SET_LED_RED; + delay(); + CLR_LED_RED; + delay(); + } + #endif + + #if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) + SET_LED_RED; + delay(); + SET_LED_ORANGE; + delay(); + PORTC = 0; + + while (count--) { + SET_LED_GREEN; + delay(); + CLR_LED_GREEN; + delay(); + } + #endif +} -- 2.39.5