Mercurial > ~darius > hgwebdir.cgi > stm32temp
annotate BSDmakefile.arm @ 24:1e2fa7396f98
Reduce prescaler to 2, the flash is capable of 25MHz reads (although
the touch screen is limited to ~2.5MHz)
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Sat, 17 Nov 2012 12:17:58 +1030 |
parents | 35cf31794a42 |
children | 7f8e5780024b |
rev | line source |
---|---|
0
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
1 # Cribbed from http://stm32.spacevs.com/index.php?option=com_content&view=category&id=9&Itemid=103 (and others) |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
2 |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
3 .SUFFIXES: .bin .elf .hex .map .lst .dmp |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
4 |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
5 .MAIN: ${PROG}.bin |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
6 |
17
b62eaa3131b1
Catch up with new toolchain location
Daniel O'Connor <darius@dons.net.au>
parents:
3
diff
changeset
|
7 TCHAIN= ${HOME}/arm/arm-none-eabi-gcc-4_6/bin/arm-none-eabi |
1
7a08db98ae8b
Split out compile flags for easier editing.
Daniel O'Connor <darius@dons.net.au>
parents:
0
diff
changeset
|
8 #TCHAIN= arm-elf |
7a08db98ae8b
Split out compile flags for easier editing.
Daniel O'Connor <darius@dons.net.au>
parents:
0
diff
changeset
|
9 #TCHAINSF= -4.6 |
0
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
10 |
1
7a08db98ae8b
Split out compile flags for easier editing.
Daniel O'Connor <darius@dons.net.au>
parents:
0
diff
changeset
|
11 CC= ${TCHAIN}-gcc${TCHAINSF} |
7a08db98ae8b
Split out compile flags for easier editing.
Daniel O'Connor <darius@dons.net.au>
parents:
0
diff
changeset
|
12 AS= ${TCHAIN}-gcc${TCHAINSF} |
7a08db98ae8b
Split out compile flags for easier editing.
Daniel O'Connor <darius@dons.net.au>
parents:
0
diff
changeset
|
13 CXX= ${TCHAIN}-g++${TCHAINSF} |
7a08db98ae8b
Split out compile flags for easier editing.
Daniel O'Connor <darius@dons.net.au>
parents:
0
diff
changeset
|
14 AR= ${TCHAIN}-ar${TCHAINSF} |
7a08db98ae8b
Split out compile flags for easier editing.
Daniel O'Connor <darius@dons.net.au>
parents:
0
diff
changeset
|
15 OBJCOPY= ${TCHAIN}-objcopy${TCHAINSF} |
7a08db98ae8b
Split out compile flags for easier editing.
Daniel O'Connor <darius@dons.net.au>
parents:
0
diff
changeset
|
16 GDB= ${TCHAIN}-gdb |
0
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
17 RM= rm -f |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
18 |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
19 CFLAGS+= ${COMMONFLAGS} |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
20 |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
21 LDFLAGS+= ${COMMONFLAGS} |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
22 LDFLAGS+= -L$(LIBDIR) -nostartfiles -Wl,--gc-sections,-T${LINKFILE} |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
23 |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
24 OBJS+= ${SRCS:N*.h:R:S/$/.o/g} |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
25 |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
26 .c.o: |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
27 ${CC} ${CFLAGS} ${CPPFLAGS} -Wa,-adhlns=${.PREFIX}.lst -c ${.IMPSRC} -o ${.PREFIX}.o |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
28 |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
29 .s.o: |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
30 ${AS} ${CFLAGS} ${ASFLAGS} -c ${.IMPSRC} -o ${.PREFIX}.o |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
31 |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
32 ${PROG}.elf: ${OBJS} |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
33 ${CC} ${LDFLAGS} ${OBJS} -Wl,-Map=${PROG}.map,--cref -o ${PROG}.elf ${LDADD} |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
34 |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
35 .elf.bin: |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
36 ${OBJCOPY} -O binary ${.ALLSRC} ${.TARGET} |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
37 |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
38 clean: |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
39 ${RM} ${PROG}.hex ${PROG}.out ${PROG}.elf ${PROG}.bin ${PROG}.map ${OBJS} ${OBJS:S/.o/.lst/} ${PROG}.dmp |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
40 |
20
35cf31794a42
Fix debug & load targets for BMP.
Daniel O'Connor <darius@dons.net.au>
parents:
17
diff
changeset
|
41 debug: |
35cf31794a42
Fix debug & load targets for BMP.
Daniel O'Connor <darius@dons.net.au>
parents:
17
diff
changeset
|
42 ${GDB} -ex "target extended-remote ${DBGPORT}" -ex "attach 1" ${PROG}.elf |
35cf31794a42
Fix debug & load targets for BMP.
Daniel O'Connor <darius@dons.net.au>
parents:
17
diff
changeset
|
43 |
35cf31794a42
Fix debug & load targets for BMP.
Daniel O'Connor <darius@dons.net.au>
parents:
17
diff
changeset
|
44 load: |
35cf31794a42
Fix debug & load targets for BMP.
Daniel O'Connor <darius@dons.net.au>
parents:
17
diff
changeset
|
45 ${GDB} -ex "target extended-remote ${DBGPORT}" -ex "attach 1" -ex "load" -ex "detach" -ex "quit" ${PROG}.elf |
0
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
46 |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
47 ######################### |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
48 #;;; Local Variables: *** |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
49 #;;; mode:makefile *** |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
50 #;;; End: *** |
c59513fd84fb
Initial commit of STM32 test code.
Daniel O'Connor <darius@dons.net.au>
parents:
diff
changeset
|
51 |