-OBJJTAG = $(OBJDIR)/bootrom.o $(OBJDIR)/ram-reset.o $(OBJDIR)/usb.o\r
-OBJFLASH = $(OBJDIR)/flash-reset.o $(OBJDIR)/fromflash.o\r
-\r
-THUMBSRC = usb.c fromflash.c bootrom.c\r
-ASMSRC = ram-reset.s flash-reset.s\r
-\r
-# Do not move this inclusion before the definition of {THUMB,ASM,ARM}{OBJ,SRC}\r
+# DO NOT use thumb mode in the phase 1 bootloader since that generates a section with glue code\r
+ARMSRC = fromflash.c \r
+THUMBSRC = usb.c bootrom.c\r
+ASMSRC = ram-reset.s flash-reset.s\r
+\r
+## There is a strange bug with the linker: Sometimes it will not emit the glue to call\r
+## BootROM from ARM mode. The symbol is emitted, but the section will be filled with\r
+## zeroes. As a temporary workaround, do not use thumb for the phase 2 bootloader\r
+## -- Henryk Plötz <henryk@ploetzli.ch> 2009-09-01\r
+ARMSRC := $(ARMSRC) $(THUMBSRC)\r
+THUMBSRC := \r
+\r
+# Do not move this inclusion before the definition of {THUMB,ASM,ARM}SRC\r