Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added minimal reset assembly to override CS3 code.

  • Loading branch information...
commit 60d1d93012a13bca58a60ddc2ffdafe86307894c 1 parent 7974fed
Francesco Balducci authored
17 cortex-m3-cs3/Makefile
@@ -9,11 +9,15 @@ CFLAGS += -mthumb -march=armv7 -mfix-cortex-m3-ldrd -g
9 9 ASFLAGS += -mthumb -march=armv7 -mfix-cortex-m3-ldrd -g
10 10 LDFLAGS += -T lm3s6965.ld
11 11
  12 +#CFLAGS += --verbose
  13 +#LDFLAGS += -Xlinker --verbose
  14 +CFLAGS += -Xassembler --verbose
  15 +
12 16 all: main main.dis main.bin main.sym
13 17
14   -debug: main.bin gdb.init
  18 +debug: main.bin
15 19 qemu-system-arm -M lm3s6965evb -s -S --kernel main.bin &
16   - ddd --debugger $(CROSS_COMPILE)gdb --command=gdb.init
  20 + ddd --debugger $(CROSS_COMPILE)gdb --command=main.gdb
17 21
18 22 clean:
19 23 rm -f main.bin
@@ -22,14 +26,7 @@ clean:
22 26 rm -f main
23 27 rm -f gdb.init
24 28
25   -gdb.init:
26   - echo "file main" > $@
27   - echo "target remote localhost:1234" >> $@
28   - echo "break main" >> $@
29   -
30   -main.bin: main
31   -main.dis: main
32   -main.sym: main
  29 +main: reset.S
33 30
34 31 %.bin: %
35 32 $(OC) -O binary $< $@
5 cortex-m3-cs3/main.c
... ... @@ -1,7 +1,4 @@
1   -__attribute__((interrupt)) void __cs3_isr_debug() {
2   -}
3   -
4   -int main() {
  1 +int main() {
5 2 return 0;
6 3 }
7 4
3  cortex-m3-cs3/main.gdb
... ... @@ -0,0 +1,3 @@
  1 +file main
  2 +target remote localhost:1234
  3 +break main
20 cortex-m3-cs3/reset.S
... ... @@ -0,0 +1,20 @@
  1 +.text
  2 +.thumb
  3 +
  4 +.global __cs3_reset
  5 +
  6 +.thumb_func
  7 +__cs3_reset:
  8 + # add peripherals and memory initialization here
  9 + LDR r0, =__cs3_start_asm
  10 + BX r0
  11 +
  12 +
  13 +.thumb_func
  14 +__cs3_start_asm:
  15 + # add assembly initializations here
  16 + LDR r0, =__cs3_start_c
  17 + BX r0
  18 +
  19 +.end
  20 +

0 comments on commit 60d1d93

Please sign in to comment.
Something went wrong with that request. Please try again.