From 13c5eccbe37e939350846559930edc3781a5817e Mon Sep 17 00:00:00 2001 From: Zach Eveland Date: Fri, 21 Oct 2011 16:51:25 -0400 Subject: can now enable interrupts but EORSTE or SOFE in USB_::attach() still cause bootloader to hang --- bootloaders/nuevo_diskloader/DiskLoader.elf.hex | 78 +++++++++++++++++++++++++ bootloaders/nuevo_diskloader/DiskLoader.hex | 78 +++++++++++++++++++++++++ bootloaders/nuevo_diskloader/Makefile | 2 +- bootloaders/nuevo_diskloader/src/DiskLoader.cpp | 46 +++++++-------- 4 files changed, 179 insertions(+), 25 deletions(-) create mode 100644 bootloaders/nuevo_diskloader/DiskLoader.elf.hex create mode 100644 bootloaders/nuevo_diskloader/DiskLoader.hex diff --git a/bootloaders/nuevo_diskloader/DiskLoader.elf.hex b/bootloaders/nuevo_diskloader/DiskLoader.elf.hex new file mode 100644 index 0000000..be4d6d1 --- /dev/null +++ b/bootloaders/nuevo_diskloader/DiskLoader.elf.hex @@ -0,0 +1,78 @@ +:1070000058C000007BC0000079C0000077C00000BD +:1070100075C0000073C0000071C000006FC00000A8 +:107020006DC000006BC000000FC20000F9C100007D +:1070300065C0000063C0000061C000005FC00000C8 +:107040005DC000005BC0000059C0000057C00000D8 +:1070500055C0000053C0000051C000004FC00000E8 +:107060004DC000004BC0000049C0000047C00000F8 +:1070700045C0000043C0000041C000003FC0000008 +:107080003DC000003BC0000039C0000037C0000018 +:1070900035C0000033C0000031C000002FC0000028 +:1070A0002DC000002BC0000029C0000091C09838FE +:1070B000443A11241FBECFEFDAE0DEBFCDBF11E0AE +:1070C000A0E0B1E0EAE9F4E702C005900D92A83132 +:1070D000B107D9F711E0A8E1B1E001C01D92AE31CE +:1070E000B107E1F710E7C2EBD0E703C02297FE013A +:1070F000CED1CE3AD107D1F76BD0CDC15EC0DC0185 +:1071000080910001909101018F5F9F4F61F4ED919B +:10711000FC9111970480F581E02DCD0109959093A4 +:107120000101809300018091000190910101089577 +:107130008EE091E090931901809318010895DF93F8 +:10714000CF930F92CDB7DEB7698380910901882371 +:1071500051F083E0BE016F5F7F4F41E050E0CED041 +:107160001816190614F080E090E00F90CF91DF918F +:10717000089583E05FC120910001309101018FEFFC +:107180002F3F380739F08FEF9FEF909301018093E5 +:10719000000103C082E08AD09C01C901089582E009 +:1071A00048D0282F80910001909101018F5F9F4F5F +:1071B00009F02F5F822F90E008951F920F920FB673 +:1071C0000F921124479A0F900FBE0F901F901895A1 +:1071D00081E085BF82E085BF88E10FB6F894809397 +:1071E0006000109260000FBE3F9A209A6E9A90E85D +:1071F000909361001092610081E885BF95BF769AF7 +:10720000289A47988DE191E029D1789420E931E0DE +:10721000479A84EC99E0F9013197F1F70197D9F792 +:10722000479884EC99E0F9013197F1F70197D9F784 +:10723000EFCF9FB7F89487708093E9008091F200B8 +:107240009FBF0895282F80911C018823C1F057FF0C +:107250001AC015C0289890931B018091F10081936A +:10726000E217F307B9F74115510539F08091F200A3 +:10727000882319F48BE68093E800AFBF02C04FEF7C +:107280005FEFCA010895AFB7F89427702093E90023 +:107290008091F200282F30E0241735070CF4A90163 +:1072A000FB019B01240F311D94E6DACFDF93CF93CE +:1072B0000F92CDB7DEB7BE016F5F7F4F41E050E068 +:1072C000C1DF019719F08FEF9FEF02C0898190E035 +:1072D0000F90CF91DF9108952FB7F8948770809326 +:1072E000E9008091E80085FD02C090E004C0809133 +:1072F000F20090E4981B2FBF892F08954F925F9260 +:107300006F927F928F929F92AF92BF92CF92DF92B5 +:10731000EF92FF920F931F93CF93DF93F82E6A01A2 +:1073200080911C01882309F18B01EA016AEFE62EA6 +:1073300057E0552E5F208F2D90E040E2842E912C57 +:10734000882299223AE3432E20E4A22EB12CA822CF +:10735000B92280EA682E8FE0782E48C08F2DBCDFDE +:10736000282F882349F4EA9419F44FEF5FEF46C0C1 +:10737000C3010197F1F73AC090E0C817D9070CF4A0 +:107380002C2FC21BD1094FB7F8945092E9008114F9 +:10739000910421F406C01092F10021502223D9F764 +:1073A00019C0F7FC03C0F801922F10C0C801322F9A +:1073B00006C0FC010196E491E093F10031503323C3 +:1073C000C1F706C081918093F10091509923D1F7C4 +:1073D000020F111D8091E80085FF05C0209729F458 +:1073E000A114B10411F04092E8004FBF209709F0BA +:1073F000B5CF769884E680931A01A601CA01DF9181 +:10740000CF911F910F91FF90EF90DF90CF90BF90A1 +:10741000AF909F908F907F906F905F904F90089566 +:107420001F920F920FB60F9211240F900FBE0F9064 +:107430001F9018958093E9008091F200882319F03D +:107440008AE38093E80008951F920F920FB60F927F +:1074500011240F900FBE0F901F90189510921C01D1 +:1074600081E08093D70080EA8093D80082E189BDD3 +:1074700009B400FEFDCF80E98093D8008CE08093B2 +:10748000E2001092E00008950895EE0FFF1F0590AE +:0A749000F491E02D0994F894FFCF69 +:10749A00FFFF00E100000000000000000000CF38FC +:0874AA007F38BB38B9389F3868 +:040000030000700089 +:00000001FF diff --git a/bootloaders/nuevo_diskloader/DiskLoader.hex b/bootloaders/nuevo_diskloader/DiskLoader.hex new file mode 100644 index 0000000..be4d6d1 --- /dev/null +++ b/bootloaders/nuevo_diskloader/DiskLoader.hex @@ -0,0 +1,78 @@ +:1070000058C000007BC0000079C0000077C00000BD +:1070100075C0000073C0000071C000006FC00000A8 +:107020006DC000006BC000000FC20000F9C100007D +:1070300065C0000063C0000061C000005FC00000C8 +:107040005DC000005BC0000059C0000057C00000D8 +:1070500055C0000053C0000051C000004FC00000E8 +:107060004DC000004BC0000049C0000047C00000F8 +:1070700045C0000043C0000041C000003FC0000008 +:107080003DC000003BC0000039C0000037C0000018 +:1070900035C0000033C0000031C000002FC0000028 +:1070A0002DC000002BC0000029C0000091C09838FE +:1070B000443A11241FBECFEFDAE0DEBFCDBF11E0AE +:1070C000A0E0B1E0EAE9F4E702C005900D92A83132 +:1070D000B107D9F711E0A8E1B1E001C01D92AE31CE +:1070E000B107E1F710E7C2EBD0E703C02297FE013A +:1070F000CED1CE3AD107D1F76BD0CDC15EC0DC0185 +:1071000080910001909101018F5F9F4F61F4ED919B +:10711000FC9111970480F581E02DCD0109959093A4 +:107120000101809300018091000190910101089577 +:107130008EE091E090931901809318010895DF93F8 +:10714000CF930F92CDB7DEB7698380910901882371 +:1071500051F083E0BE016F5F7F4F41E050E0CED041 +:107160001816190614F080E090E00F90CF91DF918F +:10717000089583E05FC120910001309101018FEFFC +:107180002F3F380739F08FEF9FEF909301018093E5 +:10719000000103C082E08AD09C01C901089582E009 +:1071A00048D0282F80910001909101018F5F9F4F5F +:1071B00009F02F5F822F90E008951F920F920FB673 +:1071C0000F921124479A0F900FBE0F901F901895A1 +:1071D00081E085BF82E085BF88E10FB6F894809397 +:1071E0006000109260000FBE3F9A209A6E9A90E85D +:1071F000909361001092610081E885BF95BF769AF7 +:10720000289A47988DE191E029D1789420E931E0DE +:10721000479A84EC99E0F9013197F1F70197D9F792 +:10722000479884EC99E0F9013197F1F70197D9F784 +:10723000EFCF9FB7F89487708093E9008091F200B8 +:107240009FBF0895282F80911C018823C1F057FF0C +:107250001AC015C0289890931B018091F10081936A +:10726000E217F307B9F74115510539F08091F200A3 +:10727000882319F48BE68093E800AFBF02C04FEF7C +:107280005FEFCA010895AFB7F89427702093E90023 +:107290008091F200282F30E0241735070CF4A90163 +:1072A000FB019B01240F311D94E6DACFDF93CF93CE +:1072B0000F92CDB7DEB7BE016F5F7F4F41E050E068 +:1072C000C1DF019719F08FEF9FEF02C0898190E035 +:1072D0000F90CF91DF9108952FB7F8948770809326 +:1072E000E9008091E80085FD02C090E004C0809133 +:1072F000F20090E4981B2FBF892F08954F925F9260 +:107300006F927F928F929F92AF92BF92CF92DF92B5 +:10731000EF92FF920F931F93CF93DF93F82E6A01A2 +:1073200080911C01882309F18B01EA016AEFE62EA6 +:1073300057E0552E5F208F2D90E040E2842E912C57 +:10734000882299223AE3432E20E4A22EB12CA822CF +:10735000B92280EA682E8FE0782E48C08F2DBCDFDE +:10736000282F882349F4EA9419F44FEF5FEF46C0C1 +:10737000C3010197F1F73AC090E0C817D9070CF4A0 +:107380002C2FC21BD1094FB7F8945092E9008114F9 +:10739000910421F406C01092F10021502223D9F764 +:1073A00019C0F7FC03C0F801922F10C0C801322F9A +:1073B00006C0FC010196E491E093F10031503323C3 +:1073C000C1F706C081918093F10091509923D1F7C4 +:1073D000020F111D8091E80085FF05C0209729F458 +:1073E000A114B10411F04092E8004FBF209709F0BA +:1073F000B5CF769884E680931A01A601CA01DF9181 +:10740000CF911F910F91FF90EF90DF90CF90BF90A1 +:10741000AF909F908F907F906F905F904F90089566 +:107420001F920F920FB60F9211240F900FBE0F9064 +:107430001F9018958093E9008091F200882319F03D +:107440008AE38093E80008951F920F920FB60F927F +:1074500011240F900FBE0F901F90189510921C01D1 +:1074600081E08093D70080EA8093D80082E189BDD3 +:1074700009B400FEFDCF80E98093D8008CE08093B2 +:10748000E2001092E00008950895EE0FFF1F0590AE +:0A749000F491E02D0994F894FFCF69 +:10749A00FFFF00E100000000000000000000CF38FC +:0874AA007F38BB38B9389F3868 +:040000030000700089 +:00000001FF diff --git a/bootloaders/nuevo_diskloader/Makefile b/bootloaders/nuevo_diskloader/Makefile index cfd3425..90a519d 100644 --- a/bootloaders/nuevo_diskloader/Makefile +++ b/bootloaders/nuevo_diskloader/Makefile @@ -41,7 +41,7 @@ ASMFLAGS += -x assembler-with-cpp -Wa,-gdwarf2 ## Linker flags LDFLAGS = $(COMMON) LDFLAGS += -Wl,-gc-sections,-Map=DiskLoader.map,--cref -LDFLAGS += -Wl,--section-start=.text=0x7800,--relax +LDFLAGS += -Wl,--section-start=.text=0x7000,--relax LDFLAGS += -Wl,--gc-sections #LDFLAGS += -nodefaultlibs -nostartfiles #LDFLAGS += -nostartfiles diff --git a/bootloaders/nuevo_diskloader/src/DiskLoader.cpp b/bootloaders/nuevo_diskloader/src/DiskLoader.cpp index 5617d6a..6dda4ae 100644 --- a/bootloaders/nuevo_diskloader/src/DiskLoader.cpp +++ b/bootloaders/nuevo_diskloader/src/DiskLoader.cpp @@ -3,36 +3,34 @@ */ #include "Platform.h" -//#include "CDC.cpp" -#include "USBAPI.h" //extern "C" -//void entrypoint(void) __attribute__ ((naked)) __attribute__ ((section (".vectors"))); -//void entrypoint(void) -//{ -// asm volatile ( -//// "eor r1, r1\n" // Zero register -//// "out 0x3F, r1\n" // SREG -//// "ldi r28, 0xFF\n" -//// "ldi r29, 0x0A\n" -//// "out 0x3E, r29\n" // SPH -//// "out 0x3D, r28\n" // SPL -// "rjmp main" // Stack is all set up, start the main code -// ::); -//} +void entrypoint(void) __attribute__ ((naked)) __attribute__ ((section (".vectors"))); +void entrypoint(void) +{ + asm volatile ( +// "eor r1, r1\n" // Zero register +// "out 0x3F, r1\n" // SREG +// "ldi r28, 0xFF\n" +// "ldi r29, 0x0A\n" +// "out 0x3E, r29\n" // SPH +// "out 0x3D, r28\n" // SPL + "rjmp main" // Stack is all set up, start the main code + ::); +} -//ISR(BADISR_vect) -//{ -// L_LED_ON(); -//} +ISR(BADISR_vect) +{ + L_LED_ON(); +} int main(void) __attribute__ ((naked)); int main() { -// /* Enable change of interrupt vectors */ -// MCUCR = (1<