From 2e79aafb7081a5305ee875277d26734779ca6d2f Mon Sep 17 00:00:00 2001 From: Perry Hung Date: Fri, 17 Sep 2010 03:49:14 -0400 Subject: Enable USB auto-reset in a hard fault. Redirect thread-mode execution to a fail routine which throbs the LED to indicate a hard fault. Because the fail routine runs in thread mode with interrupts on, USB auto-reset should now work. Test by executing some bogus instruction (e.g. *(volatile int*)0xf34fdaa = 0;) and check that the auto-reset continues to work. --- support/make/build-rules.mk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'support/make') diff --git a/support/make/build-rules.mk b/support/make/build-rules.mk index 3892af9..4dcf00f 100644 --- a/support/make/build-rules.mk +++ b/support/make/build-rules.mk @@ -3,7 +3,7 @@ CC := arm-none-eabi-gcc CXX := arm-none-eabi-g++ LD := arm-none-eabi-ld -v AR := arm-none-eabi-ar -AS := arm-none-eabi-as +AS := arm-none-eabi-gcc OBJCOPY := arm-none-eabi-objcopy DISAS := arm-none-eabi-objdump OBJDUMP := arm-none-eabi-objdump @@ -14,10 +14,10 @@ OPENOCD := openocd # Suppress annoying output unless V is set ifndef V SILENT_CC = @echo ' [CC] ' $(@:$(BUILD_PATH)/%.o=%.c); + SILENT_AS = @echo ' [AS] ' $(@:$(BUILD_PATH)/%.o=%.S); SILENT_CXX = @echo ' [CXX] ' $(@:$(BUILD_PATH)/%.o=%.cpp); SILENT_LD = @echo ' [LD] ' $(@F); SILENT_AR = @echo ' [AR] ' - SILENT_AS = @echo ' [AS] ' SILENT_OBJCOPY = @echo ' [OBJCOPY] ' $(@F); SILENT_DISAS = @echo ' [DISAS] ' $(@:$(BUILD_PATH)/%.bin=%).disas; SILENT_OBJDUMP = @echo ' [OBJDUMP] ' $(OBJDUMP); @@ -28,6 +28,7 @@ TGT_BIN := CFLAGS = $(GLOBAL_CFLAGS) $(TGT_CFLAGS) CXXFLAGS = $(GLOBAL_CXXFLAGS) $(TGT_CXXFLAGS) +ASFLAGS = $(GLOBAL_ASFLAGS) $(TGT_ASFLAGS) # General directory independent build rules, generate dependency information $(BUILD_PATH)/%.o: %.c @@ -36,3 +37,5 @@ $(BUILD_PATH)/%.o: %.c $(BUILD_PATH)/%.o: %.cpp $(SILENT_CXX) $(CXX) $(CFLAGS) $(CXXFLAGS) -MMD -MP -MF $(@:%.o=%.d) -MT $@ -o $@ -c $< +$(BUILD_PATH)/%.o: %.S + $(SILENT_AS) $(AS) $(ASFLAGS) -MMD -MP -MF $(@:%.o=%.d) -MT $@ -o $@ -c $< -- cgit v1.2.3