Mercurial > ~darius > hgwebdir.cgi > stm32test
comparison BSDmakefile @ 0:c59513fd84fb
Initial commit of STM32 test code.
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Mon, 03 Oct 2011 21:19:15 +1030 |
parents | |
children | 7a08db98ae8b |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c59513fd84fb |
---|---|
1 PROG= main | |
2 | |
3 SRCS= main.c \ | |
4 comm.c \ | |
5 syscalls.c \ | |
6 startup_stm32f10x_md_mthomas.c \ | |
7 core_cm3.c \ | |
8 system_stm32f10x.c \ | |
9 stm32f10x_usart.c \ | |
10 stm32f10x_flash.c \ | |
11 stm32f10x_gpio.c \ | |
12 stm32f10x_rcc.c \ | |
13 stm32f10x_spi.c \ | |
14 stm32f10x_rtc.c \ | |
15 stm32f10x_bkp.c \ | |
16 stm32f10x_pwr.c \ | |
17 stm32f10x_dma.c \ | |
18 stm32f10x_tim.c \ | |
19 misc.c | |
20 | |
21 # Linker file | |
22 LINKFILE= ${.CURDIR}/STM32F10x_512k_64k_flash.ld | |
23 | |
24 # Set CPU type, enable thumb code, thumb interwork debugging & optimisation | |
25 COMMONFLAGS= -mthumb -mthumb-interwork -ggdb -Os -mcpu=cortex-m3 | |
26 # Put functions & data in individual sections to allow the linker to optimise (breaks debugging apparently) | |
27 COMMONFLAGS+= -ffunction-sections -fdata-sections | |
28 # We aren't using exceptions | |
29 COMMONFLAGS+= -fno-exceptions | |
30 | |
31 CFLAGS+= -I ${.CURDIR} | |
32 | |
33 # Set device type | |
34 CFLAGS+= -DSTM32F10X_MD | |
35 # Set clocks | |
36 CFLAGS+= -DHSE_VALUE=8000000UL -DSYSCLK_FREQ_72MHz=72000000 | |
37 # Enable STM peripheral drivers | |
38 CFLAGS+= -DUSE_STDPERIPH_DRIVER | |
39 # Enable startup delay | |
40 CFLAGS+= -DSTARTUP_DELAY | |
41 # Vector table in flash | |
42 CFLAGS+= -DVECT_TAB_FLASH | |
43 # Enable warnings (disable char-subscripts otherwise ctypes.h generates warnings | |
44 CFLAGS+= -Wall -Wextra -pedantic -Wimplicit -Wcast-align -Wpointer-arith -Wredundant-decls -Wshadow -Wcast-qual -Wcast-align -Wnested-externs -Wno-char-subscripts -std=gnu99 | |
45 | |
46 LDFLAGS= -nostartfiles -Wl,--gc-sections -lc -lm -lgcc | |
47 | |
48 # Location of STM32 library bits | |
49 STMLIB= ${.CURDIR}/libs/STM32F10x_StdPeriph_Lib_V3.5.0 | |
50 PERIPHDIR= ${STMLIB}/Libraries/STM32F10x_StdPeriph_Driver | |
51 COREDIR= ${STMLIB}/Libraries/CMSIS/CM3/CoreSupport | |
52 SYSDIR= ${STMLIB}/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x | |
53 | |
54 CFLAGS+= -I ${PERIPHDIR}/inc | |
55 CFLAGS+= -I ${SYSDIR} | |
56 CFLAGS+= -I ${COREDIR} | |
57 | |
58 .PATH: ${PERIPHDIR}/src | |
59 .PATH: ${COREDIR} | |
60 .PATH: ${SYSDIR} | |
61 | |
62 .include "${.CURDIR}/BSDmakefile.arm" |