forked from rowol/stm32_discovery_arm_gcc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
make.config
executable file
·52 lines (37 loc) · 1.58 KB
/
make.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Put your stlink folder here so make burn will work.
STLINK=~/stlink.git
# Put your source files here (or *.c, etc)
SRCS=main.c
# Binaries will be generated with this name (.elf, .bin, .hex, etc)
PROJ_NAME=blinky
# Put your STM32F4 library code directory here
STM_COMMON=stm32F4_Mac
# Normally you shouldn't need to change anything below this line!
#######################################################################################
CC=arm-none-eabi-gcc
OBJCOPY=arm-none-eabi-objcopy
CFLAGS = -g -O2 -Wall -T$(STM_COMMON)/stm32_flash.ld
CFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork
CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
CFLAGS += -I.
# Include files from STM libraries
CFLAGS += -I$(STM_COMMON)/Utilities/STM32F4-Discovery
CFLAGS += -I$(STM_COMMON)/Libraries/CMSIS/Include -I$(STM_COMMON)/Libraries/CMSIS/ST/STM32F4xx/Include
CFLAGS += -I$(STM_COMMON)/Libraries/STM32F4xx_StdPeriph_Driver/inc
# add startup file to build
SRCS += $(STM_COMMON)/Libraries/CMSIS/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c
SRCS += $(STM_COMMON)/Libraries/CMSIS/ST/STM32F4xx/Source/Templates/TrueSTUDIO/startup_stm32f4xx.s
OBJS = $(SRCS:.c=.o)
# include stm32F4_Mac/make.config
# .PHONY: proj
# all: proj
# proj: $(PROJ_NAME).elf
# $(PROJ_NAME).elf: $(SRCS)
# $(CC) $(CFLAGS) $^ -o $@
# $(OBJCOPY) -O ihex $(PROJ_NAME).elf $(PROJ_NAME).hex
# $(OBJCOPY) -O binary $(PROJ_NAME).elf $(PROJ_NAME).bin
# clean:
# rm -f *.o $(PROJ_NAME).elf $(PROJ_NAME).hex $(PROJ_NAME).bin
# # Flash the STM32F4
# dfu: proj
# dfu-util -d 0483:df11 -c 1 -a 0 -s 0x08000000:leave -D $(PROJ_NAME).bin