Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added minimal reset assembly to override CS3 code.

  • Loading branch information...
commit 60d1d93012a13bca58a60ddc2ffdafe86307894c 1 parent 7974fed
@balau authored
View
17 cortex-m3-cs3/Makefile
@@ -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
5 cortex-m3-cs3/main.c
@@ -1,7 +1,4 @@
-__attribute__((interrupt)) void __cs3_isr_debug() {
-}
-
-int main() {
+int main() {
return 0;
}
View
3  cortex-m3-cs3/main.gdb
@@ -0,0 +1,3 @@
+file main
+target remote localhost:1234
+break main
View
20 cortex-m3-cs3/reset.S
@@ -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
+
Please sign in to comment.
Something went wrong with that request. Please try again.