From c0a9e827c12565c375eb1992478eb005851c0053 Mon Sep 17 00:00:00 2001 From: Zach Eveland Date: Wed, 26 Oct 2011 16:51:42 -0400 Subject: working bootloader. had to move interrupts back to application section. NOTE: need to have sketch CDC jump to appropriate place for bootloader - 4k from end instead of 2k --- bootloaders/nuevo_diskloader/DiskLoader.elf.hex | 262 ++++++++++++------------ bootloaders/nuevo_diskloader/DiskLoader.hex | 262 ++++++++++++------------ bootloaders/nuevo_diskloader/src/DiskLoader.cpp | 240 ++++++++++++---------- bootloaders/nuevo_diskloader/src/USBCore.cpp | 4 +- 4 files changed, 400 insertions(+), 368 deletions(-) diff --git a/bootloaders/nuevo_diskloader/DiskLoader.elf.hex b/bootloaders/nuevo_diskloader/DiskLoader.elf.hex index 28e3e81..df5f1da 100644 --- a/bootloaders/nuevo_diskloader/DiskLoader.elf.hex +++ b/bootloaders/nuevo_diskloader/DiskLoader.elf.hex @@ -1,6 +1,6 @@ :10700000BDC00000E0C00000DEC00000DCC0000029 :10701000DAC00000D8C00000D6C00000D4C0000014 -:10702000D2C00000D0C000006CC30000DEC300006E +:10702000D2C00000D0C000008AC30000FCC3000032 :10703000CAC00000C8C00000C6C00000C4C0000034 :10704000C2C00000C0C00000BEC00000BCC0000044 :10705000BAC00000B8C00000B6C00000B4C0000054 @@ -21,21 +21,21 @@ :107140006400750069006E006F0020004C004C0068 :1071500043001201000200000040412389000001A9 :1071600001020001120100020200004041238900D7 -:1071700000010102000100C18081E53B11241FBE16 -:10718000CFEFDAE0DEBFCDBF11E0A0E0B1E0E6E492 +:1071700000010102000100C18081033C11241FBEF7 +:10718000CFEFDAE0DEBFCDBF11E0A0E0B1E0E2E892 :10719000FAE702C005900D92A830B107D9F711E0C7 :1071A000A8E0B1E001C01D92A539B107E1F711E7F0 -:1071B000CCE7D1E703C02297FE013FD4CA37D107FD -:1071C000D1F772D03EC41CCFFC0180818E5F8083DA -:1071D00080E86AEB70E742E450E045C2FC0181813F +:1071B000CCE7D1E703C02297FE015DD4CA37D107DF +:1071C000D1F772D05CC41CCFFC0180818E5F8083BC +:1071D00080E86AEB70E742E450E063C2FC01818121 :1071E0009081913A49F48132C1F480E060E071E02D -:1071F00047E050E038D20FC0913279F4803231F458 -:1072000080E091E067E070E06AD205C0823229F444 +:1071F00047E050E056D20FC0913279F4803231F43A +:1072000080E091E067E070E088D205C0823229F426 :1072100082818093070181E0089580E00895FF92C4 :107220000F931F93CF93DF93982F8B01FF2480E759 :107230006030780738F4FF24F39483E0FB018093F7 :107240005700E895C42FD0E0892F68E071E0AE01C7 -:10725000FCD0FF2019F107B600FCFDCFD595C795EE +:107250001AD1FF2019F107B600FCFDCFD595C795CF :107260004C2FF801A8E0B1E020E031E009C08D9199 :107270009D910C0130935700E895112432962F5FB1 :107280002417A8F385E0F80180935700E89507B626 @@ -44,125 +44,129 @@ :1072B0006000109260000FBE3F9A209A6E9A90E88C :1072C000909361001092610081E885BF95BF01E055 :1072D00005BF02E005BF769A289A479884E991E0B5 -:1072E0005ED2789484E18093880180E18093890163 -:1072F000CC24DD2482E0A0D08823E1F382E0FAD020 -:10730000E82E8CEF90E7FC0124913196029644918F -:107310002E1511F02223B9F710928B0110928A01D9 -:1073200050E082E068E071E090D0F1E4EF1679F48B -:10733000609108016058633028F0683111F064E012 -:1073400001C063E0C62FD0E0C15FDE4810C026E573 -:10735000E21681F480910801803319F0FF24F39440 -:1073600028C080910A01C82FD0E0C45FDE48FF2406 -:10737000F39427C085E7E81629F423E0F22ECCE049 -:10738000D1E71FC0E5E5EE1639F4C0900801D090B2 -:107390000901CC0CDD1C0CC0F4E6EF1631F482E0E0 -:1073A000B601409109013BDF03C024E7E21621F05A -:1073B000FF24C3E1D1E705C0F0900901E601CF0C3D -:1073C000D11C08E813E1015010400930110501F10A -:1073D00082E032D08823E1F4F6CF809709F088CF9D -:1073E00083E068E871E041E050E0ACD0FF2029F094 -:1073F0004F2D50E083E8BE01A5D083E469E871E039 -:1074000041E050E09FD081E5E81609F073CF70CFDE -:1074100082E070D0EFEF8F3F9E07F9F6E1CFFC01DD -:1074200004C08091F100819361506623D1F72898C0 -:1074300084E680938D0108959FB7F89487708093B8 -:10744000E9008091F2009FBF0895FB019FB7F89477 -:1074500087708093E90034E62BE610C08091E80045 -:1074600085FFFCCF289830938D018091F1008193A6 -:107470008091E80085FD02C02093E8004150504013 -:107480008FEF4F3F580751F79FBF0895282F8091E6 -:107490008E018823C1F057FF1AC015C02898909319 -:1074A0008D018091F1008193E217F307B9F741153F -:1074B000510539F08091F200882319F48BE680930E -:1074C000E800AFBF02C04FEF5FEFCA010895AFB74A -:1074D000F89427702093E9008091F200282F30E083 -:1074E000241735070CF4A901FB019B01240F311D62 -:1074F00094E6DACFDF93CF930F92CDB7DEB7BE011C -:107500006F5F7F4F41E050E0C1DF019719F08FEFCF -:107510009FEF02C0898190E00F90CF91DF91089595 -:107520002FB7F89487708093E9008091E80085FD7B -:1075300002C090E004C08091F20090E4981B2FBF3D -:10754000892F08955F926F927F928F929F92AF9250 -:10755000BF92CF92DF92EF92FF920F931F93CF9340 -:10756000DF93F82E6A0180918E01882319F44FEF82 -:107570005FEF68C08B01EA0157E0E52EEF208F2D09 -:1075800090E040E2842E912C882299223AE3532EF7 -:1075900020E4A22EB12CA822B92280EA682E8FE026 -:1075A000782E43C08F2DBCDF282F882321F4C30100 -:1075B0000197F1F73AC090E0C817D9070CF42C2FC7 -:1075C000C21BD1094FB7F894E092E90081149104ED -:1075D00021F406C01092F10021502223D9F719C0DE -:1075E000F7FC03C0F801922F10C0C801322F06C06B -:1075F000FC010196E491E093F10031503323C1F78F -:1076000006C081918093F10091509923D1F7020F28 -:10761000111D8091E80085FF05C0209729F4A11471 -:10762000B10411F05092E8004FBF209709F0BACF93 -:10763000F6FE03C08AE38093E800769884E68093A0 -:107640008C01A601CA01DF91CF911F910F91FF908C -:10765000EF90DF90CF90BF90AF909F908F907F90F2 -:107660006F905F9008950F931F93182FFB01A091C7 -:107670009101B0919201BA010EEF2AC017FF02C02A -:10768000949101C0908120918F01309190012A172F -:107690003B07ACF48091E8008570E1F38091E8004D -:1076A00082FF03C04FEF5FEF16C09093F100C90156 -:1076B00001968F739070892B11F40093E8002F5F6F -:1076C0003F4F3093900120938F016150704031966D -:1076D0006115710599F6CA011F910F910895CF9315 -:1076E000DF939C01EB018091E80082FFFCCFC90190 -:1076F0006C2F95DE8BEF8093E800CE01DF91CF9168 -:1077000008951F920F920FB60F9211242F933F935B -:107710008F938091E1001092E100282F83FF0FC02A -:107720001092E90081E08093EB001092EC0082E37C -:107730008093ED0010928E0188E08093F00022FF8C -:1077400026C083E08093E9008091F200882319F03D -:107750008AE38093E80080918C01882351F0809126 -:107760008C01815080938C0180918C01882309F4D5 -:10777000769A80918D01882351F080918D018150FE -:1077800080938D0180918D01882309F4289A8F912F -:107790003F912F910F900FBE0F901F901895109250 -:1077A0008E0181E08093D70080EA8093D80082E147 -:1077B00089BD09B400FEFDCF80E98093D8008CE03C -:1077C0008093E2001092E00008950895DF93CF9334 -:1077D0000F92CDB7DEB71982CE010196F5DC898113 -:1077E00090E00F90CF91DF9108951F920F920FB606 -:1077F0000F921124EF92FF921F932F933F934F9379 -:107800005F936F937F938F939F93AF93BF93EF9308 -:10781000FF93DF93CF93CDB7DEB76197DEBFCDBFC8 -:107820001092E9008091E80083FFECC0CE01019640 -:1078300068E0F5DD82EF8093E800998197FF05C04D -:107840008091E80080FFFCCF03C08EEF8093E800BA -:10785000292F30E0C90180769070892B09F0B3C0E0 -:107860008A81882329F41092F1001092F100BFC0A0 -:10787000813009F4BCC0833009F4B9C0853049F4C3 -:107880008091E80080FFFCCF8B8180688093E300CB -:10789000AEC0863009F06DC01C81EF80F8841230D4 -:1078A000A9F51092E9001092900110928F011092A8 -:1078B0009201109291018ADF99E0FE013996DF0171 -:1078C000292F1D922A95E9F799871A8791E09E87BB -:1078D00090E8988B9AEF998B20918F0130919001CD -:1078E000275F3F4F3C872B878D871092E9001092CE -:1078F000900110928F01F0929201E092910180E04C -:10790000BF0149E050E0AFDE61DF71C01092E900D5 -:107910001092900110928F01F0929201E0929101E9 -:10792000113071F488E0E816F10411F4109393011A -:1079300080919301882309F062C0E2E5F1E713C06A -:10794000133009F058C08B81882319F4E4E1F1E782 -:107950000AC0823019F4E8E1F1E705C0813009F08E -:107960004AC0EAE3F1E7449150E080E8BF017BDEE2 -:107970003EC0873009F43FC0883021F481E0809315 -:10798000F10035C0893099F523703070232B99F5BB -:10799000E7E7F1E791E031E026E39093E9003093E7 -:1079A000EB0084918093EC002093ED009F5F319673 -:1079B000943099F78EE78093EA001092EA008B8169 -:1079C00080938E0114C08F8198851092E9001092E7 -:1079D000900110928F0190939201809391018D817B -:1079E000882349F4CE010196F9DB882321F08EEF3C -:1079F0008093E80007C081E28093EB0003C0E4E6D7 -:107A0000F1E7B1CF6196DEBFCDBFCF91DF91FF919E -:107A1000EF91BF91AF919F918F917F916F915F9106 -:107A20004F913F912F911F91FF90EF900F900FBEBC -:107A30000F901F901895EE0FFF1F0590F491E02D09 -:067A40000994F894FFCF49 -:087A460000E100000000000057 +:1072E0007CD2789484E18093880180E18093890145 +:1072F000CC24DD2430E9A32E31E0B32E99249394DD +:1073000002C0CC24DD2482E0B5D08823E1F382E002 +:107310000FD1E82E8CEF90E7FC0124913196029674 +:1073200044912E1511F02223B9F710928B0110927F +:107330008A0150E082E068E071E0A5D0F1E4EF1648 +:1073400079F4609108016058633028F0683111F0D9 +:1073500064E001C063E0C62FD0E0C15FDE4810C02A +:1073600026E5E21681F480910801803319F0FF24AC +:10737000F39428C080910A01C82FD0E0C45FDE4892 +:10738000FF24F39427C085E7E81629F423E0F22EC2 +:10739000CCE0D1E71FC0E5E5EE1639F4C090080156 +:1073A000D0900901CC0CDD1C0CC0F4E6EF1631F4D2 +:1073B00082E0B6014091090132DF03C024E7E21602 +:1073C00021F0FF24C3E1D1E705C0F0900901E601F7 +:1073D000CF0CD11C08E813E1015010400930110511 +:1073E00009F433C082E046D0882309F02EC0F4CFE0 +:1073F000809709F086CF83E068E871E041E050E0D3 +:10740000BFD0FF2029F04F2D50E083E8BE01B8D057 +:1074100083E469E871E041E050E0B2D081E5E8162C +:1074200009F071CF88EE93E0F5013197F1F70197FC +:10743000D9F701E005BF00E005BF9092E00010928F +:10744000E200EE27FF2709945ECF82E071D0EFEFD4 +:107450008F3F9E0709F0CCCFCECFFC0104C08091B6 +:10746000F100819361506623D1F7289884E68093D8 +:107470008D0108959FB7F89487708093E9008091FB +:10748000F2009FBF0895FB019FB7F8948770809327 +:10749000E90034E62BE610C08091E80085FFFCCFC0 +:1074A000289830938D018091F10081938091E800BC +:1074B00085FD02C02093E800415050408FEF4F3FC0 +:1074C000580751F79FBF0895282F80918E01882378 +:1074D000C1F057FF1AC015C0289890938D01809174 +:1074E000F1008193E217F307B9F74115510539F01F +:1074F0008091F200882319F48BE68093E800AFBFF7 +:1075000002C04FEF5FEFCA010895AFB7F89427703C +:107510002093E9008091F200282F30E024173507EE +:107520000CF4A901FB019B01240F311D94E6DACF75 +:10753000DF93CF930F92CDB7DEB7BE016F5F7F4F62 +:1075400041E050E0C1DF019719F08FEF9FEF02C0DB +:10755000898190E00F90CF91DF9108952FB7F89433 +:1075600087708093E9008091E80085FD02C090E07B +:1075700004C08091F20090E4981B2FBF892F0895DA +:107580005F926F927F928F929F92AF92BF92CF92B3 +:10759000DF92EF92FF920F931F93CF93DF93F82E1A +:1075A0006A0180918E01882319F44FEF5FEF68C064 +:1075B0008B01EA0157E0E52EEF208F2D90E040E2AD +:1075C000842E912C882299223AE3532E20E4A22E75 +:1075D000B12CA822B92280EA682E8FE0782E43C011 +:1075E0008F2DBCDF282F882321F4C3010197F1F7E9 +:1075F0003AC090E0C817D9070CF42C2FC21BD10950 +:107600004FB7F894E092E9008114910421F406C088 +:107610001092F10021502223D9F719C0F7FC03C0C2 +:10762000F801922F10C0C801322F06C0FC0101964C +:10763000E491E093F10031503323C1F706C081910A +:107640008093F10091509923D1F7020F111D809181 +:10765000E80085FF05C0209729F4A114B10411F0BA +:107660005092E8004FBF209709F0BACFF6FE03C052 +:107670008AE38093E800769884E680938C01A601E3 +:10768000CA01DF91CF911F910F91FF90EF90DF9092 +:10769000CF90BF90AF909F908F907F906F905F90B2 +:1076A00008950F931F93182FFB01A0919101B091A2 +:1076B0009201BA010EEF2AC017FF02C0949101C0D7 +:1076C000908120918F01309190012A173B07ACF4F3 +:1076D0008091E8008570E1F38091E80082FF03C0AB +:1076E0004FEF5FEF16C09093F100C90101968F73C1 +:1076F0009070892B11F40093E8002F5F3F4F309377 +:10770000900120938F016150704031966115710591 +:1077100099F6CA011F910F910895CF93DF939C01B1 +:10772000EB018091E80082FFFCCFC9016C2F95DE50 +:107730008BEF8093E800CE01DF91CF9108951F92E7 +:107740000F920FB60F9211242F933F938F93809136 +:10775000E1001092E100282F83FF0FC01092E90092 +:1077600081E08093EB001092EC0082E38093ED00C7 +:1077700010928E0188E08093F00022FF26C083E003 +:107780008093E9008091F200882319F08AE38093C6 +:10779000E80080918C01882351F080918C01815008 +:1077A00080938C0180918C01882309F4769A8091D2 +:1077B0008D01882351F080918D01815080938D013E +:1077C00080918D01882309F4289A8F913F912F9100 +:1077D0000F900FBE0F901F90189510928E0181E0B0 +:1077E0008093D70080EA8093D80082E189BD09B4F4 +:1077F00000FEFDCF80E98093D8008CE08093E2000A +:107800001092E00008950895DF93CF930F92CDB7C3 +:10781000DEB71982CE010196D7DC898190E00F9006 +:10782000CF91DF9108951F920F920FB60F921124FE +:10783000EF92FF921F932F933F934F935F936F931A +:107840007F938F939F93AF93BF93EF93FF93DF93B8 +:10785000CF93CDB7DEB76197DEBFCDBF1092E90001 +:107860008091E80083FFECC0CE01019668E0F5DD71 +:1078700082EF8093E800998197FF05C08091E8002E +:1078800080FFFCCF03C08EEF8093E800292F30E00B +:10789000C90180769070892B09F0B3C08A81882352 +:1078A00029F41092F1001092F100BFC0813009F468 +:1078B000BCC0833009F4B9C0853049F48091E80038 +:1078C00080FFFCCF8B8180688093E300AEC0863060 +:1078D00009F06DC01C81EF80F8841230A9F5109278 +:1078E000E9001092900110928F0110929201109273 +:1078F00091018ADF99E0FE013996DF01292F1D925F +:107900002A95E9F799871A8791E09E8790E8988BE6 +:107910009AEF998B20918F0130919001275F3F4F13 +:107920003C872B878D871092E9001092900110926E +:107930008F01F0929201E092910180E0BF0149E055 +:1079400050E0AFDE61DF71C01092E900109290014B +:1079500010928F01F0929201E0929101113071F436 +:1079600088E0E816F10411F41093930180919301DB +:10797000882309F062C0E2E5F1E713C0133009F093 +:1079800058C08B81882319F4E4E1F1E70AC0823002 +:1079900019F4E8E1F1E705C0813009F04AC0EAE3F3 +:1079A000F1E7449150E080E8BF017BDE3EC08730C4 +:1079B00009F43FC0883021F481E08093F10035C0A4 +:1079C000893099F523703070232B99F5E7E7F1E7BB +:1079D00091E031E026E39093E9003093EB0084914D +:1079E0008093EC002093ED009F5F3196943099F7DF +:1079F0008EE78093EA001092EA008B8180938E01DB +:107A000014C08F8198851092E90010929001109215 +:107A10008F0190939201809391018D81882349F485 +:107A2000CE010196DBDB882321F08EEF8093E80006 +:107A300007C081E28093EB0003C0E4E6F1E7B1CF39 +:107A40006196DEBFCDBFCF91DF91FF91EF91BF91E6 +:107A5000AF919F918F917F916F915F914F913F91E6 +:107A60002F911F91FF90EF900F900FBE0F901F90DE +:107A70001895EE0FFF1F0590F491E02D0994F894EE +:027A8000FFCF36 +:087A820000E10000000000001B :040000030000700089 :00000001FF diff --git a/bootloaders/nuevo_diskloader/DiskLoader.hex b/bootloaders/nuevo_diskloader/DiskLoader.hex index 28e3e81..df5f1da 100644 --- a/bootloaders/nuevo_diskloader/DiskLoader.hex +++ b/bootloaders/nuevo_diskloader/DiskLoader.hex @@ -1,6 +1,6 @@ :10700000BDC00000E0C00000DEC00000DCC0000029 :10701000DAC00000D8C00000D6C00000D4C0000014 -:10702000D2C00000D0C000006CC30000DEC300006E +:10702000D2C00000D0C000008AC30000FCC3000032 :10703000CAC00000C8C00000C6C00000C4C0000034 :10704000C2C00000C0C00000BEC00000BCC0000044 :10705000BAC00000B8C00000B6C00000B4C0000054 @@ -21,21 +21,21 @@ :107140006400750069006E006F0020004C004C0068 :1071500043001201000200000040412389000001A9 :1071600001020001120100020200004041238900D7 -:1071700000010102000100C18081E53B11241FBE16 -:10718000CFEFDAE0DEBFCDBF11E0A0E0B1E0E6E492 +:1071700000010102000100C18081033C11241FBEF7 +:10718000CFEFDAE0DEBFCDBF11E0A0E0B1E0E2E892 :10719000FAE702C005900D92A830B107D9F711E0C7 :1071A000A8E0B1E001C01D92A539B107E1F711E7F0 -:1071B000CCE7D1E703C02297FE013FD4CA37D107FD -:1071C000D1F772D03EC41CCFFC0180818E5F8083DA -:1071D00080E86AEB70E742E450E045C2FC0181813F +:1071B000CCE7D1E703C02297FE015DD4CA37D107DF +:1071C000D1F772D05CC41CCFFC0180818E5F8083BC +:1071D00080E86AEB70E742E450E063C2FC01818121 :1071E0009081913A49F48132C1F480E060E071E02D -:1071F00047E050E038D20FC0913279F4803231F458 -:1072000080E091E067E070E06AD205C0823229F444 +:1071F00047E050E056D20FC0913279F4803231F43A +:1072000080E091E067E070E088D205C0823229F426 :1072100082818093070181E0089580E00895FF92C4 :107220000F931F93CF93DF93982F8B01FF2480E759 :107230006030780738F4FF24F39483E0FB018093F7 :107240005700E895C42FD0E0892F68E071E0AE01C7 -:10725000FCD0FF2019F107B600FCFDCFD595C795EE +:107250001AD1FF2019F107B600FCFDCFD595C795CF :107260004C2FF801A8E0B1E020E031E009C08D9199 :107270009D910C0130935700E895112432962F5FB1 :107280002417A8F385E0F80180935700E89507B626 @@ -44,125 +44,129 @@ :1072B0006000109260000FBE3F9A209A6E9A90E88C :1072C000909361001092610081E885BF95BF01E055 :1072D00005BF02E005BF769A289A479884E991E0B5 -:1072E0005ED2789484E18093880180E18093890163 -:1072F000CC24DD2482E0A0D08823E1F382E0FAD020 -:10730000E82E8CEF90E7FC0124913196029644918F -:107310002E1511F02223B9F710928B0110928A01D9 -:1073200050E082E068E071E090D0F1E4EF1679F48B -:10733000609108016058633028F0683111F064E012 -:1073400001C063E0C62FD0E0C15FDE4810C026E573 -:10735000E21681F480910801803319F0FF24F39440 -:1073600028C080910A01C82FD0E0C45FDE48FF2406 -:10737000F39427C085E7E81629F423E0F22ECCE049 -:10738000D1E71FC0E5E5EE1639F4C0900801D090B2 -:107390000901CC0CDD1C0CC0F4E6EF1631F482E0E0 -:1073A000B601409109013BDF03C024E7E21621F05A -:1073B000FF24C3E1D1E705C0F0900901E601CF0C3D -:1073C000D11C08E813E1015010400930110501F10A -:1073D00082E032D08823E1F4F6CF809709F088CF9D -:1073E00083E068E871E041E050E0ACD0FF2029F094 -:1073F0004F2D50E083E8BE01A5D083E469E871E039 -:1074000041E050E09FD081E5E81609F073CF70CFDE -:1074100082E070D0EFEF8F3F9E07F9F6E1CFFC01DD -:1074200004C08091F100819361506623D1F72898C0 -:1074300084E680938D0108959FB7F89487708093B8 -:10744000E9008091F2009FBF0895FB019FB7F89477 -:1074500087708093E90034E62BE610C08091E80045 -:1074600085FFFCCF289830938D018091F1008193A6 -:107470008091E80085FD02C02093E8004150504013 -:107480008FEF4F3F580751F79FBF0895282F8091E6 -:107490008E018823C1F057FF1AC015C02898909319 -:1074A0008D018091F1008193E217F307B9F741153F -:1074B000510539F08091F200882319F48BE680930E -:1074C000E800AFBF02C04FEF5FEFCA010895AFB74A -:1074D000F89427702093E9008091F200282F30E083 -:1074E000241735070CF4A901FB019B01240F311D62 -:1074F00094E6DACFDF93CF930F92CDB7DEB7BE011C -:107500006F5F7F4F41E050E0C1DF019719F08FEFCF -:107510009FEF02C0898190E00F90CF91DF91089595 -:107520002FB7F89487708093E9008091E80085FD7B -:1075300002C090E004C08091F20090E4981B2FBF3D -:10754000892F08955F926F927F928F929F92AF9250 -:10755000BF92CF92DF92EF92FF920F931F93CF9340 -:10756000DF93F82E6A0180918E01882319F44FEF82 -:107570005FEF68C08B01EA0157E0E52EEF208F2D09 -:1075800090E040E2842E912C882299223AE3532EF7 -:1075900020E4A22EB12CA822B92280EA682E8FE026 -:1075A000782E43C08F2DBCDF282F882321F4C30100 -:1075B0000197F1F73AC090E0C817D9070CF42C2FC7 -:1075C000C21BD1094FB7F894E092E90081149104ED -:1075D00021F406C01092F10021502223D9F719C0DE -:1075E000F7FC03C0F801922F10C0C801322F06C06B -:1075F000FC010196E491E093F10031503323C1F78F -:1076000006C081918093F10091509923D1F7020F28 -:10761000111D8091E80085FF05C0209729F4A11471 -:10762000B10411F05092E8004FBF209709F0BACF93 -:10763000F6FE03C08AE38093E800769884E68093A0 -:107640008C01A601CA01DF91CF911F910F91FF908C -:10765000EF90DF90CF90BF90AF909F908F907F90F2 -:107660006F905F9008950F931F93182FFB01A091C7 -:107670009101B0919201BA010EEF2AC017FF02C02A -:10768000949101C0908120918F01309190012A172F -:107690003B07ACF48091E8008570E1F38091E8004D -:1076A00082FF03C04FEF5FEF16C09093F100C90156 -:1076B00001968F739070892B11F40093E8002F5F6F -:1076C0003F4F3093900120938F016150704031966D -:1076D0006115710599F6CA011F910F910895CF9315 -:1076E000DF939C01EB018091E80082FFFCCFC90190 -:1076F0006C2F95DE8BEF8093E800CE01DF91CF9168 -:1077000008951F920F920FB60F9211242F933F935B -:107710008F938091E1001092E100282F83FF0FC02A -:107720001092E90081E08093EB001092EC0082E37C -:107730008093ED0010928E0188E08093F00022FF8C -:1077400026C083E08093E9008091F200882319F03D -:107750008AE38093E80080918C01882351F0809126 -:107760008C01815080938C0180918C01882309F4D5 -:10777000769A80918D01882351F080918D018150FE -:1077800080938D0180918D01882309F4289A8F912F -:107790003F912F910F900FBE0F901F901895109250 -:1077A0008E0181E08093D70080EA8093D80082E147 -:1077B00089BD09B400FEFDCF80E98093D8008CE03C -:1077C0008093E2001092E00008950895DF93CF9334 -:1077D0000F92CDB7DEB71982CE010196F5DC898113 -:1077E00090E00F90CF91DF9108951F920F920FB606 -:1077F0000F921124EF92FF921F932F933F934F9379 -:107800005F936F937F938F939F93AF93BF93EF9308 -:10781000FF93DF93CF93CDB7DEB76197DEBFCDBFC8 -:107820001092E9008091E80083FFECC0CE01019640 -:1078300068E0F5DD82EF8093E800998197FF05C04D -:107840008091E80080FFFCCF03C08EEF8093E800BA -:10785000292F30E0C90180769070892B09F0B3C0E0 -:107860008A81882329F41092F1001092F100BFC0A0 -:10787000813009F4BCC0833009F4B9C0853049F4C3 -:107880008091E80080FFFCCF8B8180688093E300CB -:10789000AEC0863009F06DC01C81EF80F8841230D4 -:1078A000A9F51092E9001092900110928F011092A8 -:1078B0009201109291018ADF99E0FE013996DF0171 -:1078C000292F1D922A95E9F799871A8791E09E87BB -:1078D00090E8988B9AEF998B20918F0130919001CD -:1078E000275F3F4F3C872B878D871092E9001092CE -:1078F000900110928F01F0929201E092910180E04C -:10790000BF0149E050E0AFDE61DF71C01092E900D5 -:107910001092900110928F01F0929201E0929101E9 -:10792000113071F488E0E816F10411F4109393011A -:1079300080919301882309F062C0E2E5F1E713C06A -:10794000133009F058C08B81882319F4E4E1F1E782 -:107950000AC0823019F4E8E1F1E705C0813009F08E -:107960004AC0EAE3F1E7449150E080E8BF017BDEE2 -:107970003EC0873009F43FC0883021F481E0809315 -:10798000F10035C0893099F523703070232B99F5BB -:10799000E7E7F1E791E031E026E39093E9003093E7 -:1079A000EB0084918093EC002093ED009F5F319673 -:1079B000943099F78EE78093EA001092EA008B8169 -:1079C00080938E0114C08F8198851092E9001092E7 -:1079D000900110928F0190939201809391018D817B -:1079E000882349F4CE010196F9DB882321F08EEF3C -:1079F0008093E80007C081E28093EB0003C0E4E6D7 -:107A0000F1E7B1CF6196DEBFCDBFCF91DF91FF919E -:107A1000EF91BF91AF919F918F917F916F915F9106 -:107A20004F913F912F911F91FF90EF900F900FBEBC -:107A30000F901F901895EE0FFF1F0590F491E02D09 -:067A40000994F894FFCF49 -:087A460000E100000000000057 +:1072E0007CD2789484E18093880180E18093890145 +:1072F000CC24DD2430E9A32E31E0B32E99249394DD +:1073000002C0CC24DD2482E0B5D08823E1F382E002 +:107310000FD1E82E8CEF90E7FC0124913196029674 +:1073200044912E1511F02223B9F710928B0110927F +:107330008A0150E082E068E071E0A5D0F1E4EF1648 +:1073400079F4609108016058633028F0683111F0D9 +:1073500064E001C063E0C62FD0E0C15FDE4810C02A +:1073600026E5E21681F480910801803319F0FF24AC +:10737000F39428C080910A01C82FD0E0C45FDE4892 +:10738000FF24F39427C085E7E81629F423E0F22EC2 +:10739000CCE0D1E71FC0E5E5EE1639F4C090080156 +:1073A000D0900901CC0CDD1C0CC0F4E6EF1631F4D2 +:1073B00082E0B6014091090132DF03C024E7E21602 +:1073C00021F0FF24C3E1D1E705C0F0900901E601F7 +:1073D000CF0CD11C08E813E1015010400930110511 +:1073E00009F433C082E046D0882309F02EC0F4CFE0 +:1073F000809709F086CF83E068E871E041E050E0D3 +:10740000BFD0FF2029F04F2D50E083E8BE01B8D057 +:1074100083E469E871E041E050E0B2D081E5E8162C +:1074200009F071CF88EE93E0F5013197F1F70197FC +:10743000D9F701E005BF00E005BF9092E00010928F +:10744000E200EE27FF2709945ECF82E071D0EFEFD4 +:107450008F3F9E0709F0CCCFCECFFC0104C08091B6 +:10746000F100819361506623D1F7289884E68093D8 +:107470008D0108959FB7F89487708093E9008091FB +:10748000F2009FBF0895FB019FB7F8948770809327 +:10749000E90034E62BE610C08091E80085FFFCCFC0 +:1074A000289830938D018091F10081938091E800BC +:1074B00085FD02C02093E800415050408FEF4F3FC0 +:1074C000580751F79FBF0895282F80918E01882378 +:1074D000C1F057FF1AC015C0289890938D01809174 +:1074E000F1008193E217F307B9F74115510539F01F +:1074F0008091F200882319F48BE68093E800AFBFF7 +:1075000002C04FEF5FEFCA010895AFB7F89427703C +:107510002093E9008091F200282F30E024173507EE +:107520000CF4A901FB019B01240F311D94E6DACF75 +:10753000DF93CF930F92CDB7DEB7BE016F5F7F4F62 +:1075400041E050E0C1DF019719F08FEF9FEF02C0DB +:10755000898190E00F90CF91DF9108952FB7F89433 +:1075600087708093E9008091E80085FD02C090E07B +:1075700004C08091F20090E4981B2FBF892F0895DA +:107580005F926F927F928F929F92AF92BF92CF92B3 +:10759000DF92EF92FF920F931F93CF93DF93F82E1A +:1075A0006A0180918E01882319F44FEF5FEF68C064 +:1075B0008B01EA0157E0E52EEF208F2D90E040E2AD +:1075C000842E912C882299223AE3532E20E4A22E75 +:1075D000B12CA822B92280EA682E8FE0782E43C011 +:1075E0008F2DBCDF282F882321F4C3010197F1F7E9 +:1075F0003AC090E0C817D9070CF42C2FC21BD10950 +:107600004FB7F894E092E9008114910421F406C088 +:107610001092F10021502223D9F719C0F7FC03C0C2 +:10762000F801922F10C0C801322F06C0FC0101964C +:10763000E491E093F10031503323C1F706C081910A +:107640008093F10091509923D1F7020F111D809181 +:10765000E80085FF05C0209729F4A114B10411F0BA +:107660005092E8004FBF209709F0BACFF6FE03C052 +:107670008AE38093E800769884E680938C01A601E3 +:10768000CA01DF91CF911F910F91FF90EF90DF9092 +:10769000CF90BF90AF909F908F907F906F905F90B2 +:1076A00008950F931F93182FFB01A0919101B091A2 +:1076B0009201BA010EEF2AC017FF02C0949101C0D7 +:1076C000908120918F01309190012A173B07ACF4F3 +:1076D0008091E8008570E1F38091E80082FF03C0AB +:1076E0004FEF5FEF16C09093F100C90101968F73C1 +:1076F0009070892B11F40093E8002F5F3F4F309377 +:10770000900120938F016150704031966115710591 +:1077100099F6CA011F910F910895CF93DF939C01B1 +:10772000EB018091E80082FFFCCFC9016C2F95DE50 +:107730008BEF8093E800CE01DF91CF9108951F92E7 +:107740000F920FB60F9211242F933F938F93809136 +:10775000E1001092E100282F83FF0FC01092E90092 +:1077600081E08093EB001092EC0082E38093ED00C7 +:1077700010928E0188E08093F00022FF26C083E003 +:107780008093E9008091F200882319F08AE38093C6 +:10779000E80080918C01882351F080918C01815008 +:1077A00080938C0180918C01882309F4769A8091D2 +:1077B0008D01882351F080918D01815080938D013E +:1077C00080918D01882309F4289A8F913F912F9100 +:1077D0000F900FBE0F901F90189510928E0181E0B0 +:1077E0008093D70080EA8093D80082E189BD09B4F4 +:1077F00000FEFDCF80E98093D8008CE08093E2000A +:107800001092E00008950895DF93CF930F92CDB7C3 +:10781000DEB71982CE010196D7DC898190E00F9006 +:10782000CF91DF9108951F920F920FB60F921124FE +:10783000EF92FF921F932F933F934F935F936F931A +:107840007F938F939F93AF93BF93EF93FF93DF93B8 +:10785000CF93CDB7DEB76197DEBFCDBF1092E90001 +:107860008091E80083FFECC0CE01019668E0F5DD71 +:1078700082EF8093E800998197FF05C08091E8002E +:1078800080FFFCCF03C08EEF8093E800292F30E00B +:10789000C90180769070892B09F0B3C08A81882352 +:1078A00029F41092F1001092F100BFC0813009F468 +:1078B000BCC0833009F4B9C0853049F48091E80038 +:1078C00080FFFCCF8B8180688093E300AEC0863060 +:1078D00009F06DC01C81EF80F8841230A9F5109278 +:1078E000E9001092900110928F0110929201109273 +:1078F00091018ADF99E0FE013996DF01292F1D925F +:107900002A95E9F799871A8791E09E8790E8988BE6 +:107910009AEF998B20918F0130919001275F3F4F13 +:107920003C872B878D871092E9001092900110926E +:107930008F01F0929201E092910180E0BF0149E055 +:1079400050E0AFDE61DF71C01092E900109290014B +:1079500010928F01F0929201E0929101113071F436 +:1079600088E0E816F10411F41093930180919301DB +:10797000882309F062C0E2E5F1E713C0133009F093 +:1079800058C08B81882319F4E4E1F1E70AC0823002 +:1079900019F4E8E1F1E705C0813009F04AC0EAE3F3 +:1079A000F1E7449150E080E8BF017BDE3EC08730C4 +:1079B00009F43FC0883021F481E08093F10035C0A4 +:1079C000893099F523703070232B99F5E7E7F1E7BB +:1079D00091E031E026E39093E9003093EB0084914D +:1079E0008093EC002093ED009F5F3196943099F7DF +:1079F0008EE78093EA001092EA008B8180938E01DB +:107A000014C08F8198851092E90010929001109215 +:107A10008F0190939201809391018D81882349F485 +:107A2000CE010196DBDB882321F08EEF8093E80006 +:107A300007C081E28093EB0003C0E4E6F1E7B1CF39 +:107A40006196DEBFCDBFCF91DF91FF91EF91BF91E6 +:107A5000AF919F918F917F916F915F914F913F91E6 +:107A60002F911F91FF90EF900F900FBE0F901F90DE +:107A70001895EE0FFF1F0590F491E02D0994F894EE +:027A8000FFCF36 +:087A820000E10000000000001B :040000030000700089 :00000001FF diff --git a/bootloaders/nuevo_diskloader/src/DiskLoader.cpp b/bootloaders/nuevo_diskloader/src/DiskLoader.cpp index a7ccde6..216ddc6 100644 --- a/bootloaders/nuevo_diskloader/src/DiskLoader.cpp +++ b/bootloaders/nuevo_diskloader/src/DiskLoader.cpp @@ -109,6 +109,17 @@ const u8 _consts[] = //} +void start_sketch() +{ + UDCON = 1; // Detatch USB + UDIEN = 0; + asm volatile ( // Reset vector to run firmware + "clr r30\n" + "clr r31\n" + "ijmp\n" + ::); +} + int main(void) __attribute__ ((naked)); int main() { @@ -139,117 +150,130 @@ int main() u16 address = 0; for (;;) { - while (!USB_Available(CDC_RX)) - ; - u8 cmd = USB_Recv(CDC_RX); - - // Read packet contents - u8 len; - const u8* rs = _readSize; - for (;;) - { - u8 c = pgm_read_byte(rs++); - len = pgm_read_byte(rs++); - if (c == cmd || c == 0) - break; - } - _timeout = 0; - // Read params - USB_Recv_block(CDC_RX, packet, len); - - // Send a response - u8 send = 0; - const u8* pgm = _consts+7; - if (STK_GET_PARAMETER == cmd) - { - u8 i = packet[0] - 0x80; - if (i > 2) - i = (i==0x18) ? 3 : 4; // 0x80:HW_VER,0x81:SW_MAJOR,0x82:SW_MINOR,0x18:3 or 0 - pgm = _consts + i + 3; - send = 1; - } - else if (STK_UNIVERSAL == cmd) - { - if (packet[0] == 0x30) - pgm = _consts + packet[2]; - send = 1; - } - else if (STK_READ_SIGN == cmd) - { - pgm = _consts; - send = 3; - } - else if (STK_LOAD_ADDRESS == cmd) - { - address = *((u16*)packet); // word address - address += address; - } - else if (STK_PROG_PAGE == cmd) - { - Program(CDC_RX, address, packet[1]); - } - else if (STK_READ_PAGE == cmd) - { - send = packet[1]; - pgm = (const u8*)address; - address += send; - } - - // Check sync -// if (Serial.available() > 0 && Serial.read() != ' ') -// break; -// if (USB_Available(CDC_RX) && USB_Recv(CDC_RX) != ' ') - -// u8 countdown = 10; // while (!USB_Available(CDC_RX)) -// { -// if (countdown-- == 0) -// break; -// } -// u8 x = USB_Recv(CDC_RX); -// if (x != -1 && x != ' ') -// { -// L_LED_ON(); -// break; -// } - -// if (getch() != ' ') -// break; - -// while (!USB_Available(CDC_RX)) // ; -// -// int x = USB_Recv(CDC_RX); -// if (x == -1) -// { -// UEINTX = 0x6B; -// break; -// } -// else if (x != ' ') -// { -//// UEINTX = 0x6B; -// break; -// } - - u16 countdown = 5000; - while (countdown-- > 10 && !USB_Available(CDC_RX)) - ; - int x = USB_Recv(CDC_RX); - if (x != -1 && x != ' ') - break; - - USB_Send(CDC_TX, &_inSync, 1); - - if (send) - USB_Send(CDC_TX|TRANSFER_PGM, pgm, send); - - // Send ok - USB_Send(CDC_TX|TRANSFER_RELEASE, &_ok, 1); - - if ('Q' == cmd) + if (USB_Available(CDC_RX)) { - do_reset = 500; - break; + u8 cmd = USB_Recv(CDC_RX); + + // Read packet contents + u8 len; + const u8* rs = _readSize; + for (;;) + { + u8 c = pgm_read_byte(rs++); + len = pgm_read_byte(rs++); + if (c == cmd || c == 0) + break; + } + _timeout = 0; + // Read params + USB_Recv_block(CDC_RX, packet, len); + + // Send a response + u8 send = 0; + const u8* pgm = _consts+7; + if (STK_GET_PARAMETER == cmd) + { + u8 i = packet[0] - 0x80; + if (i > 2) + i = (i==0x18) ? 3 : 4; // 0x80:HW_VER,0x81:SW_MAJOR,0x82:SW_MINOR,0x18:3 or 0 + pgm = _consts + i + 3; + send = 1; + } + else if (STK_UNIVERSAL == cmd) + { + if (packet[0] == 0x30) + pgm = _consts + packet[2]; + send = 1; + } + else if (STK_READ_SIGN == cmd) + { + pgm = _consts; + send = 3; + } + else if (STK_LOAD_ADDRESS == cmd) + { + address = *((u16*)packet); // word address + address += address; + } + else if (STK_PROG_PAGE == cmd) + { + Program(CDC_RX, address, packet[1]); + } + else if (STK_READ_PAGE == cmd) + { + send = packet[1]; + pgm = (const u8*)address; + address += send; + } + + // Check sync + // if (Serial.available() > 0 && Serial.read() != ' ') + // break; + // if (USB_Available(CDC_RX) && USB_Recv(CDC_RX) != ' ') + + // u8 countdown = 10; + // while (!USB_Available(CDC_RX)) + // { + // if (countdown-- == 0) + // break; + // } + // u8 x = USB_Recv(CDC_RX); + // if (x != -1 && x != ' ') + // { + // L_LED_ON(); + // break; + // } + + // if (getch() != ' ') + // break; + + // while (!USB_Available(CDC_RX)) + // ; + // + // int x = USB_Recv(CDC_RX); + // if (x == -1) + // { + // UEINTX = 0x6B; + // break; + // } + // else if (x != ' ') + // { + //// UEINTX = 0x6B; + // break; + // } + + u16 countdown = 5000; + while (countdown-- > 10 && !USB_Available(CDC_RX)) + ; + int x = USB_Recv(CDC_RX); + if (x != -1 && x != ' ') + break; + + USB_Send(CDC_TX, &_inSync, 1); + + if (send) + USB_Send(CDC_TX|TRANSFER_PGM, pgm, send); + + // Send ok + USB_Send(CDC_TX|TRANSFER_RELEASE, &_ok, 1); + + if ('Q' == cmd) + { + _delay_ms(100); + /* move interrupts to application section: + * uses inline assembly because the procedure must be completed in four cycles. + */ + asm volatile ( + "ldi r16, 0x01\n" // (1<