From 4f44d2893a506ee3924785c91a5f8983c013150c Mon Sep 17 00:00:00 2001 From: WestfW Date: Fri, 10 Jun 2011 16:17:13 -0700 Subject: This is a relatively significant edit that brings the Arduino copy of optiboot up-to-date with the optiboot source repository as of Jun-2011 (the last changes made in the optiboot repository were in Oct-2010) This adds support for several plaforms, fixes the "30k bug", and refactors the source to have separate stk500.h, boot.h, and pin_defs.h These are the arduino opticode issues fixed: http://code.google.com/p/arduino/issues/detail?id=380 optiboot has problems upload sketches bigger than 30 KB http://code.google.com/p/arduino/issues/detail?id=556 update optiboot to the point of the latest optiboot project sources. These are issues that had been solved in the optiboot source aready: http://code.google.com/p/arduino/issues/detail?id=364 optiboot leaves timer1 configured when starting app, breaks PWM on pin 9 and 10. (fixed with a workaround in arduino core.) aka http://code.google.com/p/optiboot/source/detail?r=c778fbe72df6ac13ef730c25283358c3c970f73e Support for ATmega8 and mega88. Fix fuse settings for mega168 _ISP targets Additional new platforms (mega, sanguino) http://code.google.com/p/optiboot/issues/detail?id=26 Set R1 to 0 (already in arduino code) http://code.google.com/p/optiboot/issues/detail?id=36&can=1 Fails to build correctly for mega88 After this commit, the only differences between the Arduino optiboot.c and the optiboot repository optiboot.c are cosmetic. --- bootloaders/optiboot/optiboot_diecimila.hex | 63 +++++++++++++++-------------- 1 file changed, 32 insertions(+), 31 deletions(-) (limited to 'bootloaders/optiboot/optiboot_diecimila.hex') diff --git a/bootloaders/optiboot/optiboot_diecimila.hex b/bootloaders/optiboot/optiboot_diecimila.hex index 1e93414..2b4a582 100644 --- a/bootloaders/optiboot/optiboot_diecimila.hex +++ b/bootloaders/optiboot/optiboot_diecimila.hex @@ -1,33 +1,34 @@ -:103E000085E08093810082E08093C00088E1809308 -:103E1000C10086E08093C20080E18093C40084B733 -:103E200014BE81FFD0D08DE0C8D0259A86E020E373 -:103E30003CEF91E0309385002093840096BBB09BCB -:103E4000FECF1D9AA8958150A9F7DD24D394A5E053 -:103E5000EA2EF1E1FF2EA4D0813421F481E0BED01E -:103E600083E024C0823411F484E103C0853419F462 -:103E700085E0B4D08AC08535A1F492D0082F10E037 -:103E800010930102009300028BD090E0982F8827B6 -:103E9000802B912B880F991F909301028093000231 -:103EA00073C0863529F484E099D080E071D06DC06C -:103EB000843609F043C07CD0E0910002F091010209 -:103EC00083E080935700E895C0E0D1E069D0899302 -:103ED000809102028150809302028823B9F778D042 -:103EE00007B600FCFDCF4091000250910102A0E016 -:103EF000B1E02C9130E011968C91119790E0982FC1 -:103F00008827822B932B1296FA010C01D09257002E -:103F1000E89511244E5F5F4FF1E0A038BF0749F7E5 -:103F2000E0910002F0910102E0925700E89507B697 -:103F300000FCFDCFF0925700E89527C08437B9F414 -:103F400037D046D0E0910002F09101023196F09313 -:103F50000102E09300023197E4918E2F19D08091F5 -:103F60000202815080930202882361F70EC08537D8 -:103F700039F42ED08EE10CD084E90AD086E096CFB9 -:103F8000813511F488E019D023D080E101D063CFCE -:103F9000982F8091C00085FFFCCF9093C6000895B4 -:103FA000A8958091C00087FFFCCF8091C60008953E -:103FB000F7DFF6DF80930202F3CFE0E6F0E098E16E -:103FC00090838083089580E0F8DFEE27FF2709942F -:103FD000E7DF803209F0F7DF84E1DACF1F93182F93 -:0C3FE000DFDF1150E9F7F4DF1F910895B6 +:103E0000112484B714BE81FFE6D085E08093810041 +:103E100082E08093C00088E18093C10086E08093B7 +:103E2000C20080E18093C4008EE0CFD0259A86E066 +:103E300020E33CEF91E0309385002093840096BB13 +:103E4000B09BFECF1D9AA8958150A9F7DD24D3948D +:103E5000A5E0EA2EF1E1FF2EABD0813421F481E020 +:103E6000C5D083E020C0823411F484E103C08534DE +:103E700019F485E0BBD091C0853581F499D0082F25 +:103E800010E096D090E0982F8827802B912B880FF8 +:103E9000991F90930102809300027EC0863529F419 +:103EA00084E0A4D080E07CD078C0843609F04EC095 +:103EB00087D0E0910002F091010288E3E030F8073A +:103EC00018F483E087BFE895C0E0D1E071D0899312 +:103ED000809102028150809302028823B9F7E09119 +:103EE0000002F091010288E3E030F80718F083E067 +:103EF00087BFE89575D007B600FCFDCF4091000262 +:103F000050910102A0E0B1E02C9130E011968C912B +:103F1000119790E0982F8827822B932B1296FA0105 +:103F20000C01D7BEE89511244E5F5F4FF1E0A03839 +:103F3000BF0751F7E0910002F0910102E7BEE8955A +:103F400007B600FCFDCFF7BEE89527C08437B9F46B +:103F500037D046D0E0910002F09101023196F09303 +:103F60000102E09300023197E4918E2F19D08091E5 +:103F70000202815080930202882361F70EC08537C8 +:103F800039F42ED08EE10CD084E90AD086E08BCFB4 +:103F9000813511F488E019D023D080E101D05CCFC5 +:103FA000982F8091C00085FFFCCF9093C6000895A4 +:103FB000A8958091C00087FFFCCF8091C60008952E +:103FC000F7DFF6DF80930202F3CFE0E6F0E098E15E +:103FD00090838083089580E0F8DFEE27FF2709941F +:103FE000E7DF803209F0F7DF84E1DACF1F93182F83 +:0C3FF000DFDF1150E9F7F4DF1F910895A6 :0400000300003E00BB :00000001FF -- cgit v1.2.3-18-g5258 From 2a83ee55b38c81df04d7d3b83d6bf68ed72936e4 Mon Sep 17 00:00:00 2001 From: WestfW Date: Fri, 10 Jun 2011 17:47:47 -0700 Subject: Add a version number to the optiboot source and binary. http://code.google.com/p/arduino/issues/detail?id=554 end of flash memory where they can be read (at least in theory) by device programmers, hex-file examination, or application programs. This is done by putting the version number in a separate section (".version"), and using linker/objcopy magic to locate that section as appropriate for the target chip. (See http://lists.gnu.org/archive/html/avr-gcc-list/2011-02/msg00016.html for some discussion on the details.) Start the version at 4.1 (the last "packaged" version of optiboot was called version 3, so the "top of source" would be 4.0, and adding the version number makes 4.1) Refactor LDSECTION in the Makefile to LDSECTIONS so that multiple section start addresses can be defined. Change the _isp makefile definitions to make the bootloader section readable (but not writable) by the application section. (This would need to be done elsewhere as well to handle all bootloader programming techniques. Notably Arduino's boards.txt Note that this change does not change the "code" portion of optiboot at all. The only diffs in the .hex files are the added version word at the end of flash memory. --- bootloaders/optiboot/optiboot_diecimila.hex | 1 + 1 file changed, 1 insertion(+) (limited to 'bootloaders/optiboot/optiboot_diecimila.hex') diff --git a/bootloaders/optiboot/optiboot_diecimila.hex b/bootloaders/optiboot/optiboot_diecimila.hex index 2b4a582..3ac0de2 100644 --- a/bootloaders/optiboot/optiboot_diecimila.hex +++ b/bootloaders/optiboot/optiboot_diecimila.hex @@ -30,5 +30,6 @@ :103FD00090838083089580E0F8DFEE27FF2709941F :103FE000E7DF803209F0F7DF84E1DACF1F93182F83 :0C3FF000DFDF1150E9F7F4DF1F910895A6 +:023FFE000104BC :0400000300003E00BB :00000001FF -- cgit v1.2.3-18-g5258 From a78553bd13fb9cbb03b574b363c8f68a7289dc11 Mon Sep 17 00:00:00 2001 From: WestfW Date: Fri, 10 Jun 2011 23:02:25 -0700 Subject: Shrink code by using registers for variables "length" and "address" http://code.google.com/p/optiboot/issues/detail?id=33 Fix high-value watchdog timeouts on ATmega8 http://code.google.com/p/optiboot/issues/detail?id=38 Change "start app on bad commands" code to start the app via the watchdog timer, so that the app is always started with the chip in fully reset state. http://code.google.com/p/optiboot/issues/detail?id=37 --- bootloaders/optiboot/optiboot_diecimila.hex | 58 ++++++++++++++--------------- 1 file changed, 28 insertions(+), 30 deletions(-) (limited to 'bootloaders/optiboot/optiboot_diecimila.hex') diff --git a/bootloaders/optiboot/optiboot_diecimila.hex b/bootloaders/optiboot/optiboot_diecimila.hex index 3ac0de2..733a139 100644 --- a/bootloaders/optiboot/optiboot_diecimila.hex +++ b/bootloaders/optiboot/optiboot_diecimila.hex @@ -1,35 +1,33 @@ -:103E0000112484B714BE81FFE6D085E08093810041 +:103E0000112484B714BE81FFE3D085E08093810044 :103E100082E08093C00088E18093C10086E08093B7 -:103E2000C20080E18093C4008EE0CFD0259A86E066 +:103E2000C20080E18093C4008EE0BCD0259A86E079 :103E300020E33CEF91E0309385002093840096BB13 -:103E4000B09BFECF1D9AA8958150A9F7DD24D3948D -:103E5000A5E0EA2EF1E1FF2EABD0813421F481E020 -:103E6000C5D083E020C0823411F484E103C08534DE -:103E700019F485E0BBD091C0853581F499D0082F25 -:103E800010E096D090E0982F8827802B912B880FF8 -:103E9000991F90930102809300027EC0863529F419 -:103EA00084E0A4D080E07CD078C0843609F04EC095 -:103EB00087D0E0910002F091010288E3E030F8073A -:103EC00018F483E087BFE895C0E0D1E071D0899312 -:103ED000809102028150809302028823B9F7E09119 -:103EE0000002F091010288E3E030F80718F083E067 -:103EF00087BFE89575D007B600FCFDCF4091000262 -:103F000050910102A0E0B1E02C9130E011968C912B -:103F1000119790E0982F8827822B932B1296FA0105 -:103F20000C01D7BEE89511244E5F5F4FF1E0A03839 -:103F3000BF0751F7E0910002F0910102E7BEE8955A -:103F400007B600FCFDCFF7BEE89527C08437B9F46B -:103F500037D046D0E0910002F09101023196F09303 -:103F60000102E09300023197E4918E2F19D08091E5 -:103F70000202815080930202882361F70EC08537C8 -:103F800039F42ED08EE10CD084E90AD086E08BCFB4 -:103F9000813511F488E019D023D080E101D05CCFC5 -:103FA000982F8091C00085FFFCCF9093C6000895A4 -:103FB000A8958091C00087FFFCCF8091C60008952E -:103FC000F7DFF6DF80930202F3CFE0E6F0E098E15E -:103FD00090838083089580E0F8DFEE27FF2709941F -:103FE000E7DF803209F0F7DF84E1DACF1F93182F83 -:0C3FF000DFDF1150E9F7F4DF1F910895A6 +:103E4000B09BFECF1D9AA8958150A9F79924939411 +:103E5000A5E0AA2EF1E1BF2E9DD0813421F481E0AE +:103E6000AFD083E01FC0823411F484E103C08534F5 +:103E700019F485E0A5D083C0853579F48BD0E82E80 +:103E8000FF2488D0082F10E0102F00270E291F29AB +:103E9000000F111F8DD0680172C0863529F484E0AF +:103EA0008FD080E06FD06BC0843609F042C072D0F2 +:103EB00071D0082F6FD080E0C81688E3D80620F4B0 +:103EC00083E0F60187BFE895C0E0D1E063D0899335 +:103ED0000C17E1F7F0E0CF16F8E3DF0620F083E0FF +:103EE000F60187BFE89564D007B600FCFDCFA601B8 +:103EF000A0E0B1E02C9130E011968C91119790E008 +:103F0000982F8827822B932B1296FA010C0197BECB +:103F1000E89511244E5F5F4FF1E0A038BF0751F7DD +:103F2000F601A7BEE89507B600FCFDCFB7BEE89541 +:103F300026C08437B1F42ED02DD0F82E2BD038D017 +:103F4000F601EF2C8F010F5F1F4F84911BD0EA9475 +:103F5000F801C1F70894C11CD11CFA94CF0CD11CF4 +:103F60000EC0853739F424D08EE10CD084E90AD014 +:103F700086E098CF813511F488E014D019D080E123 +:103F800001D06ACF982F8091C00085FFFCCF90931D +:103F9000C6000895A8958091C00087FFFCCF80914E +:103FA000C6000895E0E6F0E098E1908380830895EC +:103FB000F1DF803219F088E0F5DFFFCF84E1E2CF56 +:103FC0001F93182FE7DF1150E9F7F2DF1F910895D3 +:0A3FD00080E0E8DFEE27FF270994E8 :023FFE000104BC :0400000300003E00BB :00000001FF -- cgit v1.2.3-18-g5258 From 738e5ca709769e6b42d0ae93285435aeaa459a56 Mon Sep 17 00:00:00 2001 From: WestfW Date: Sat, 11 Jun 2011 03:15:33 -0700 Subject: Fix errors in LDSECTIONS refactoring (found during atmega8 testing.) --- bootloaders/optiboot/optiboot_diecimila.hex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bootloaders/optiboot/optiboot_diecimila.hex') diff --git a/bootloaders/optiboot/optiboot_diecimila.hex b/bootloaders/optiboot/optiboot_diecimila.hex index 733a139..26bbd4c 100644 --- a/bootloaders/optiboot/optiboot_diecimila.hex +++ b/bootloaders/optiboot/optiboot_diecimila.hex @@ -28,6 +28,6 @@ :103FB000F1DF803219F088E0F5DFFFCF84E1E2CF56 :103FC0001F93182FE7DF1150E9F7F2DF1F910895D3 :0A3FD00080E0E8DFEE27FF270994E8 -:023FFE000104BC +:023FFE000204BB :0400000300003E00BB :00000001FF -- cgit v1.2.3-18-g5258 From a0d00b4d86cfbd5cb508eda69997175fab39e725 Mon Sep 17 00:00:00 2001 From: WestfW Date: Mon, 13 Jun 2011 19:07:07 -0700 Subject: http://code.google.com/p/arduino/issues/detail?id=368 Optiboot does not support ArduinoasISP programmer. When avrdude runs and talks to an arduino running ArduinoISP, it needs the optiboot (entered due to auto-reset) to abort and start the ArduinoISP "application" when it sees communications at the wrong serial speed. Unfortunately, optiboot treats all unrecognized command characters as "no-ops" and responds/loops for more commands, leading to a nice loop that never gets to the sketch. This patch causes characters received with Framing errors (the most likely error for speed mis-matches) to NOT reset the watchdog timer (normally done in getch()), which will cause the application to start if it continues for "a while." (tested. Works! Running ArduinoISP at speeds as high as 57600 still causes the bootloader to start the sketch (although it fails later on for other reasons.)) --- bootloaders/optiboot/optiboot_diecimila.hex | 33 +++++++++++++++-------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'bootloaders/optiboot/optiboot_diecimila.hex') diff --git a/bootloaders/optiboot/optiboot_diecimila.hex b/bootloaders/optiboot/optiboot_diecimila.hex index 26bbd4c..b685a4e 100644 --- a/bootloaders/optiboot/optiboot_diecimila.hex +++ b/bootloaders/optiboot/optiboot_diecimila.hex @@ -1,33 +1,34 @@ -:103E0000112484B714BE81FFE3D085E08093810044 +:103E0000112484B714BE81FFE7D085E08093810040 :103E100082E08093C00088E18093C10086E08093B7 -:103E2000C20080E18093C4008EE0BCD0259A86E079 +:103E2000C20080E18093C4008EE0C0D0259A86E075 :103E300020E33CEF91E0309385002093840096BB13 :103E4000B09BFECF1D9AA8958150A9F79924939411 :103E5000A5E0AA2EF1E1BF2E9DD0813421F481E0AE -:103E6000AFD083E01FC0823411F484E103C08534F5 -:103E700019F485E0A5D083C0853579F48BD0E82E80 +:103E6000B3D083E01FC0823411F484E103C08534F1 +:103E700019F485E0A9D083C0853579F48BD0E82E7C :103E8000FF2488D0082F10E0102F00270E291F29AB -:103E9000000F111F8DD0680172C0863529F484E0AF -:103EA0008FD080E06FD06BC0843609F042C072D0F2 +:103E9000000F111F91D0680172C0863529F484E0AB +:103EA00093D080E06FD06BC0843609F042C072D0EE :103EB00071D0082F6FD080E0C81688E3D80620F4B0 :103EC00083E0F60187BFE895C0E0D1E063D0899335 :103ED0000C17E1F7F0E0CF16F8E3DF0620F083E0FF -:103EE000F60187BFE89564D007B600FCFDCFA601B8 +:103EE000F60187BFE89568D007B600FCFDCFA601B4 :103EF000A0E0B1E02C9130E011968C91119790E008 :103F0000982F8827822B932B1296FA010C0197BECB :103F1000E89511244E5F5F4FF1E0A038BF0751F7DD :103F2000F601A7BEE89507B600FCFDCFB7BEE89541 -:103F300026C08437B1F42ED02DD0F82E2BD038D017 +:103F300026C08437B1F42ED02DD0F82E2BD03CD013 :103F4000F601EF2C8F010F5F1F4F84911BD0EA9475 :103F5000F801C1F70894C11CD11CFA94CF0CD11CF4 -:103F60000EC0853739F424D08EE10CD084E90AD014 -:103F700086E098CF813511F488E014D019D080E123 +:103F60000EC0853739F428D08EE10CD084E90AD010 +:103F700086E098CF813511F488E018D01DD080E11B :103F800001D06ACF982F8091C00085FFFCCF90931D -:103F9000C6000895A8958091C00087FFFCCF80914E -:103FA000C6000895E0E6F0E098E1908380830895EC -:103FB000F1DF803219F088E0F5DFFFCF84E1E2CF56 -:103FC0001F93182FE7DF1150E9F7F2DF1F910895D3 -:0A3FD00080E0E8DFEE27FF270994E8 -:023FFE000204BB +:103F9000C60008958091C00087FFFCCF8091C000CB +:103FA00084FD01C0A8958091C6000895E0E6F0E088 +:103FB00098E1908380830895EDDF803219F088E0E6 +:103FC000F5DFFFCF84E1DECF1F93182FE3DF115021 +:103FD000E9F7F2DF1F91089580E0E8DFEE27FF2781 +:023FE000099442 +:023FFE000304BA :0400000300003E00BB :00000001FF -- cgit v1.2.3-18-g5258 From 1f01799bbfd17eb04ec6322a123d6d26b21b09a0 Mon Sep 17 00:00:00 2001 From: WestfW Date: Tue, 14 Jun 2011 10:24:27 -0700 Subject: Allow the READ PARAMETER command to return our version number. (significant size impact: 14 bytes!) Initialized "address" to eliminate compiler warning (4 bytes!) Add "atmega168" as a more accurate target name than "diecimila" (keep diecimila as well for backward compatibility) Reduce the .hex and .lst targets that are stored in source control to the three basics: atmega8, atmega168, atmega328. The other targets remain in the makefile and makeall, but will need to be built from source if wanted. Which should be less of a problem now that the source is buildable without installing crosspack. --- bootloaders/optiboot/optiboot_diecimila.hex | 34 ----------------------------- 1 file changed, 34 deletions(-) delete mode 100644 bootloaders/optiboot/optiboot_diecimila.hex (limited to 'bootloaders/optiboot/optiboot_diecimila.hex') diff --git a/bootloaders/optiboot/optiboot_diecimila.hex b/bootloaders/optiboot/optiboot_diecimila.hex deleted file mode 100644 index b685a4e..0000000 --- a/bootloaders/optiboot/optiboot_diecimila.hex +++ /dev/null @@ -1,34 +0,0 @@ -:103E0000112484B714BE81FFE7D085E08093810040 -:103E100082E08093C00088E18093C10086E08093B7 -:103E2000C20080E18093C4008EE0C0D0259A86E075 -:103E300020E33CEF91E0309385002093840096BB13 -:103E4000B09BFECF1D9AA8958150A9F79924939411 -:103E5000A5E0AA2EF1E1BF2E9DD0813421F481E0AE -:103E6000B3D083E01FC0823411F484E103C08534F1 -:103E700019F485E0A9D083C0853579F48BD0E82E7C -:103E8000FF2488D0082F10E0102F00270E291F29AB -:103E9000000F111F91D0680172C0863529F484E0AB -:103EA00093D080E06FD06BC0843609F042C072D0EE -:103EB00071D0082F6FD080E0C81688E3D80620F4B0 -:103EC00083E0F60187BFE895C0E0D1E063D0899335 -:103ED0000C17E1F7F0E0CF16F8E3DF0620F083E0FF -:103EE000F60187BFE89568D007B600FCFDCFA601B4 -:103EF000A0E0B1E02C9130E011968C91119790E008 -:103F0000982F8827822B932B1296FA010C0197BECB -:103F1000E89511244E5F5F4FF1E0A038BF0751F7DD -:103F2000F601A7BEE89507B600FCFDCFB7BEE89541 -:103F300026C08437B1F42ED02DD0F82E2BD03CD013 -:103F4000F601EF2C8F010F5F1F4F84911BD0EA9475 -:103F5000F801C1F70894C11CD11CFA94CF0CD11CF4 -:103F60000EC0853739F428D08EE10CD084E90AD010 -:103F700086E098CF813511F488E018D01DD080E11B -:103F800001D06ACF982F8091C00085FFFCCF90931D -:103F9000C60008958091C00087FFFCCF8091C000CB -:103FA00084FD01C0A8958091C6000895E0E6F0E088 -:103FB00098E1908380830895EDDF803219F088E0E6 -:103FC000F5DFFFCF84E1DECF1F93182FE3DF115021 -:103FD000E9F7F2DF1F91089580E0E8DFEE27FF2781 -:023FE000099442 -:023FFE000304BA -:0400000300003E00BB -:00000001FF -- cgit v1.2.3-18-g5258