Commit 7d3e764a14ae761d215e0d02f79258d9290624d1
receivedThu, 5. Sep 2024, 13:06:25 (by user sx)
Thu, 5 Sep 2024 11:06:25 +0000 (13:06 +0200)
authorManfred Steiner <sx@htl-kaindorf.at>
Thu, 5 Sep 2024 06:22:31 +0000 (08:22 +0200)
committerManfred Steiner <sx@htl-kaindorf.at>
Thu, 5 Sep 2024 06:22:31 +0000 (08:22 +0200)
4 files changed:
software/bootloader-arduino/Makefile
software/bootloader-arduino/release/2024-09-05_075521/bootloader-arduino_nano-644.elf [new file with mode: 0755]
software/bootloader-arduino/release/2024-09-05_075521/bootloader-arduino_nano-644.hex [new file with mode: 0644]
software/bootloader-arduino/src/main.c

index 00872f0f278f82d1e8aa80e934149db3f0cc7226..a82f6c210b1053346e43b760269ac7ec3aa66ecd 100644 (file)
@@ -64,7 +64,7 @@ info:
        @avr-size --mcu=$(DEVICE) --format=avr dist/$(NAME).elf
 
 .depend: $(SRC) $(HDR)
-       $(CC) --mcu=$(DEVICE) -MM $(SRC) | sed --regexp-extended 's/^(.*\.o)\: src\/(.*)(\.cpp|\.c) (.*)/build\/\2\.o\: src\/\2\3 \4/g' > .depend
+       $(CC) -mmcu=$(DEVICE) -MM $(SRC) | sed --regexp-extended 's/^(.*\.o)\: src\/(.*)(\.cpp|\.c) (.*)/build\/\2\.o\: src\/\2\3 \4/g' > .depend
 
 -include .depend
 
@@ -114,6 +114,9 @@ isp-644p:
 isp-flash-644p: dist/$(NAME).elf all
        avrdude -c usbasp -p m644p -e -U flash:w:$<
 
+isp-read-flash-644p:
+       avrdude -c usbasp -p m644p -U flash:r:/tmp/flash-nano-644__$(shell date +"%Y-%m-%d_%H%M%S")
+
 flash-644p: dist/$(NAME).elf all
        avrdude -c arduino -p m644p -P /dev/ttyUSB0 -b 115200 -e -U flash:w:$<
 
diff --git a/software/bootloader-arduino/release/2024-09-05_075521/bootloader-arduino_nano-644.elf b/software/bootloader-arduino/release/2024-09-05_075521/bootloader-arduino_nano-644.elf
new file mode 100755 (executable)
index 0000000..b9ba6f7
Binary files /dev/null and b/software/bootloader-arduino/release/2024-09-05_075521/bootloader-arduino_nano-644.elf differ
diff --git a/software/bootloader-arduino/release/2024-09-05_075521/bootloader-arduino_nano-644.hex b/software/bootloader-arduino/release/2024-09-05_075521/bootloader-arduino_nano-644.hex
new file mode 100644 (file)
index 0000000..1e3ad2b
--- /dev/null
@@ -0,0 +1,99 @@
+:10E000000C9449700C945B700C945B700C945B7076\r
+:10E010000C945B700C945B700C945B700C945B7054\r
+:10E020000C945B700C945B700C945B700C945B7044\r
+:10E030000C945B700C945B700C945B700C945B7034\r
+:10E040000C945B700C945B700C945B700C945B7024\r
+:10E050000C945B700C945B700C945B700C945B7014\r
+:10E060000C945B700C945B700C945B700C945B7004\r
+:10E070000C945B700C945B700C945B7030373A3589\r
+:10E08000353A323100536570202035203230323439\r
+:10E09000000011241FBECFEFD0E1DEBFCDBF22E0D4\r
+:10E0A000A0E0B1E001C01D92AC30B207E1F70E94E0\r
+:10E0B00040710C9405730C9400709091C00095FF12\r
+:10E0C000FCCF8093C6000895CF93982F85958595B2\r
+:10E0D00085958595805D9F709A3014F0C7E501C0E5\r
+:10E0E000C0E3C90F0E945D708C2FCF910C945D70BE\r
+:10E0F000CF92DF92EF92FF92C12CD12C76018091CA\r
+:10E10000C00087FD15C08FEFC81AD80AE80AF80AC0\r
+:10E1100081EBC81681E7D8068BE0E806F10478F3B6\r
+:10E1200017B818B8E0910001F09101010995E7CF07\r
+:10E130008091C600FF90EF90DF90CF900895CF932D\r
+:10E140000E947870C82F0E945D70C13614F089EA71\r
+:10E1500003C0C0331CF080ED8C0F01C08C2FCF9119\r
+:10E160000895CF930E949F70C82F0E949F7090E1E6\r
+:10E17000C99F800D1124CF910895CF93C82FCC2330\r
+:10E1800021F00E947870C150FACFCF910895CF93BB\r
+:10E19000C82F0E947870803251F484E10E945D7033\r
+:10E1A0008C2F0E945D7080E1CF910C945D70809106\r
+:10E1B00002018F5F80930201853041F417B818B8CF\r
+:10E1C000E0910001F0910101CF910994CF91089560\r
+:10E1D0000E947870803231F484E10E945D7080E1A9\r
+:10E1E0000C945D70809102018F5F809302018530F5\r
+:10E1F00039F417B818B8E0910001F09101010994C1\r
+:10E200000895CF93DF9300D000D0CDB7DEB7198249\r
+:10E210001A821B821C8289819A81AB81BC81811503\r
+:10E220009042A140B10580F48091C00087FD0CC0F0\r
+:10E2300089819A81AB81BC810196A11DB11D898321\r
+:10E240009A83AB83BC83E7CF0F900F900F900F9012\r
+:10E25000DF91CF910895CF93C82F429A0E94017108\r
+:10E26000439A0E94017118B8CC2341F0449A0E944D\r
+:10E27000017144980E940171C150F6CFCF91089569\r
+:10E28000000018B88CE987B982E08093C0008CE068\r
+:10E290008093C4001092C50088E18093C10086E09D\r
+:10E2A0008093C20098E09093C9008093CA0084E0F4\r
+:10E2B0000E942B7113E001E0E5E0FE2EF1E1EF2E6C\r
+:10E2C0000E947870803309F447C0813319F50E94A9\r
+:10E2D00078708032B9F484E10E945D7081E40E941C\r
+:10E2E0005D7086E50E945D7082E50E945D7080E24F\r
+:10E2F0000E945D7089E40E945D7083E50E945D70FC\r
+:10E3000080E56AC1809102018F5F809302018530B0\r
+:10E31000B9F66FC1803439F40E9478708638E0F025\r
+:10E320000E94787019C0813491F40E94787080380E\r
+:10E3300011F481EF44C0813811F481E040C082388B\r
+:10E3400011F480E13CC08839C9F583E038C08234DB\r
+:10E3500031F484E10E94BD700E94E870B1CF853431\r
+:10E3600011F485E0F7CF982F9D7F9035A9F3813583\r
+:10E3700099F3853549F40E94787080930A020E94CF\r
+:10E38000787080930B02E8CF8635E1F40E947870B4\r
+:10E39000803389F40E9478700E947870C82F0E94A0\r
+:10E3A0007870C11102C08EE10AC0C13011F486E953\r
+:10E3B00006C08AE004C083E00E94BD7080E00E9435\r
+:10E3C000C7707ECF843609F0A5C00E947870809314\r
+:10E3D00009020E94787080930802809107028E7F64\r
+:10E3E000809307020E947870853429F48091070297\r
+:10E3F000816080930702C6E0D1E06E01209108029F\r
+:10E4000030910902C601865091408217930730F47B\r
+:10E410000E947870F60181936F01F0CF0E947870AE\r
+:10E42000803209F0DFC02091070280910A029091AA\r
+:10E430000B02880F991F90930B0280930A0220FF12\r
+:10E4400023C0E6E0F1E02091080230910902CF01FB\r
+:10E45000865091408217930708F05AC0F999FECF71\r
+:10E4600080910A0290910B0292BD81BD819180BD85\r
+:10E47000FA9AF99A80910A0290910B020196909370\r
+:10E480000B0280930A02DFCF8091080280FF09C04F\r
+:10E49000809108029091090201969093090280935D\r
+:10E4A0000802F89440910A0250910B02F999FECFAC\r
+:10E4B00007B600FCFDCFFA0110935700E89507B6A8\r
+:10E4C00000FCFDCF20E030E0FA01E20FF31F89816C\r
+:10E4D00090E0982F88276881860F911D0C0100938A\r
+:10E4E0005700E89511242E5F3F4F22962115F1E049\r
+:10E4F0003F0751F73093050120930401FA01F09290\r
+:10E500005700E89507B600FCFDCFE0925700E8956C\r
+:10E5100084E162C0843709F04FC00E947870809314\r
+:10E5200009020E9478708093080280910A029091FB\r
+:10E530000B02880F991F90930B0280930A020E948E\r
+:10E54000787090910702853411F4916001C09E7F2C\r
+:10E55000909307020E947870803209F03FC084E1F6\r
+:10E560000E945D70C0E0D0E08091080290910902A5\r
+:10E57000C817D90798F58091070280FF0BC0F99959\r
+:10E58000FECF80910A0290910B0292BD81BDF89A54\r
+:10E5900080B505C0E0910A02F0910B0284910E94BF\r
+:10E5A0005D7080910A0290910B02019690930B028C\r
+:10E5B00080930A022196D8CF853719F50E9478708A\r
+:10E5C000803281F484E10E945D708EE10E945D7072\r
+:10E5D00086E90E945D708AE00E945D7080E10E9481\r
+:10E5E0005D706ECE809102018F5F80930201853055\r
+:10E5F00009F417B818B8E0910001F09101010995EC\r
+:0EE600005FCE863709F05CCED9CEF894FFCFFE\r
+:040000030000E00019\r
+:00000001FF\r
index 3ca14b395f0fcb7aae5a138d5d081f528f1e1831..ff7c2ef18b2ad68e55639696c0a20a0e299cb6fd 100644 (file)
@@ -55,6 +55,9 @@ 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') {
@@ -287,12 +290,14 @@ int main () {
                                        }                       
                                } else {
                                        // Write to FLASH one page at a time
-                                       if (address.byte[1] > 127) {
-                                               //Only possible with m128, m256 will need 3rd address byte. FIXME
-                                               // RAMPZ = 0x01;
-                                       } else {
-                                               // RAMPZ = 0x00;
-                                       }
+                                       #ifdef RAMPZ
+                  if (address.byte[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;               
@@ -372,10 +377,15 @@ int main () {
                                                address.word++;
                                        }
                                        else {
-                                               if (!flags.rampz) {
-                                                       putch(pgm_read_byte_near(address.word));
-                                                       // putch(pgm_read_byte_far(address.word + 0x10000));
-                                               }
+                  #ifdef RAMPZ
+                     if (!flags.rampz) {
+                        putch(pgm_read_byte_near(address.word));
+                     } else {
+                        putch(pgm_read_byte_far(address.word + 0x10000));
+                     }
+                  #else
+                     putch(pgm_read_byte_near(address.word));
+                  #endif
                                                address.word++;
                                        }
                                }