Permalink
Browse files

Added minimal reset assembly to override CS3 code.

  • Loading branch information...
1 parent 7974fed commit 60d1d93012a13bca58a60ddc2ffdafe86307894c @balau committed Aug 26, 2011
Showing with 31 additions and 14 deletions.
  1. +7 −10 cortex-m3-cs3/Makefile
  2. +1 −4 cortex-m3-cs3/main.c
  3. +3 −0 cortex-m3-cs3/main.gdb
  4. +20 −0 cortex-m3-cs3/reset.S
View
@@ -9,11 +9,15 @@ CFLAGS += -mthumb -march=armv7 -mfix-cortex-m3-ldrd -g
ASFLAGS += -mthumb -march=armv7 -mfix-cortex-m3-ldrd -g
LDFLAGS += -T lm3s6965.ld
+#CFLAGS += --verbose
+#LDFLAGS += -Xlinker --verbose
+CFLAGS += -Xassembler --verbose
+
all: main main.dis main.bin main.sym
-debug: main.bin gdb.init
+debug: main.bin
qemu-system-arm -M lm3s6965evb -s -S --kernel main.bin &
- ddd --debugger $(CROSS_COMPILE)gdb --command=gdb.init
+ ddd --debugger $(CROSS_COMPILE)gdb --command=main.gdb
clean:
rm -f main.bin
@@ -22,14 +26,7 @@ clean:
rm -f main
rm -f gdb.init
-gdb.init:
- echo "file main" > $@
- echo "target remote localhost:1234" >> $@
- echo "break main" >> $@
-
-main.bin: main
-main.dis: main
-main.sym: main
+main: reset.S
%.bin: %
$(OC) -O binary $< $@
View
@@ -1,7 +1,4 @@
-__attribute__((interrupt)) void __cs3_isr_debug() {
-}
-
-int main() {
+int main() {
return 0;
}
View
@@ -0,0 +1,3 @@
+file main
+target remote localhost:1234
+break main
View
@@ -0,0 +1,20 @@
+.text
+.thumb
+
+.global __cs3_reset
+
+.thumb_func
+__cs3_reset:
+ # add peripherals and memory initialization here
+ LDR r0, =__cs3_start_asm
+ BX r0
+
+
+.thumb_func
+__cs3_start_asm:
+ # add assembly initializations here
+ LDR r0, =__cs3_start_c
+ BX r0
+
+.end
+

0 comments on commit 60d1d93

Please sign in to comment.