forked from OpenSourceEBike/TSDZ2_motor_controller_v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
131 lines (120 loc) · 5.84 KB
/
Makefile
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
CCFLAGS=-DXMC1302_T038x0064 -O3 -g3 -mthumb -mcpu=cortex-m0 -MD --specs=nano.specs -lc -g -Werror -I..
LDFLAGS=-DXMC1302_T038x0064 -O3 -g3 -T DAVE_FOC_PROJECT/linker_script.ld -mcpu=cortex-m0 -mthumb
LDFLAGS += -nostartfiles -Xlinker --gc-sections -specs=nano.specs -specs=nosys.specs
# LDFLAGS += -u _printf_float -u _scanf_float
CC=arm-none-eabi-gcc
AS=arm-none-eabi-as
LD=arm-none-eabi-ld
CCFLAGS +=\
-I . \
-I DAVE_FOC_PROJECT/Libraries/CMSIS/Include \
-I DAVE_FOC_PROJECT/Libraries/CMSIS/Infineon/XMC1300_series/Include \
-I DAVE_FOC_PROJECT/Libraries/XMCLib/inc \
-I DAVE_FOC_PROJECT/Dave/Generated \
-I DAVE_FOC_PROJECT/Dave/Generated/PWM \
-I DAVE_FOC_PROJECT/Dave/Generated/ADC_QUEUE \
-I DAVE_FOC_PROJECT/Dave/Generated/CLOCK_XMC1 \
-I DAVE_FOC_PROJECT/Dave/Generated/CPU_CTRL_XMC1 \
-I DAVE_FOC_PROJECT/Dave/Generated/GLOBAL_ADC \
-I DAVE_FOC_PROJECT/Dave/Generated/GLOBAL_CCU4 \
-I DAVE_FOC_PROJECT/Dave/Generated/GLOBAL_CCU8 \
-I DAVE_FOC_PROJECT/Dave/Generated/PMSM_FOC \
-I DAVE_FOC_PROJECT/Dave/Generated/PWM_SVM \
-I DAVE_FOC_PROJECT/Dave/Generated/UART \
LIBSDIR = -LDAVE_FOC_PROJECT/Dave/Generated/PMSM_FOC
LIBS = -lPMSM_FOC_LIB
ELF=main.elf \
all: $(ELF)
@echo "done"
main.elf: \
DAVE_FOC_PROJECT/Startup/startup_XMC1300.o \
DAVE_FOC_PROJECT/Startup/system_XMC1300.o \
DAVE_FOC_PROJECT/Libraries/Newlib/syscalls.o \
DAVE_FOC_PROJECT/main.o \
adc.o \
DAVE_FOC_PROJECT/Libraries/XMCLib/src/xmc_vadc.o \
DAVE_FOC_PROJECT/Libraries/XMCLib/src/xmc1_scu.o \
DAVE_FOC_PROJECT/Libraries/XMCLib/src/xmc_posif.o \
DAVE_FOC_PROJECT/Dave/Generated/DAVE.o \
DAVE_FOC_PROJECT/Dave/Generated/PWM/pwm_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/PWM/pwm.o \
DAVE_FOC_PROJECT/Dave/Generated/ADC_QUEUE/adc_queue_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/ADC_QUEUE/adc_queue.o \
DAVE_FOC_PROJECT/Dave/Generated/CLOCK_XMC1/clock_xmc1_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/CLOCK_XMC1/clock_xmc1.o \
DAVE_FOC_PROJECT/Dave/Generated/CPU_CTRL_XMC1/cpu_ctrl_xmc1_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/CPU_CTRL_XMC1/cpu_ctrl_xmc1.o \
DAVE_FOC_PROJECT/Dave/Generated/GLOBAL_ADC/global_adc_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/GLOBAL_ADC/global_adc.o \
DAVE_FOC_PROJECT/Dave/Generated/UART/uart_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/UART/uart.o \
DAVE_FOC_PROJECT/Libraries/XMCLib/src/xmc_gpio.o \
DAVE_FOC_PROJECT/Libraries/XMCLib/src/xmc1_gpio.o \
DAVE_FOC_PROJECT/Libraries/XMCLib/src/xmc_uart.o \
DAVE_FOC_PROJECT/Libraries/XMCLib/src/xmc_usic.o \
DAVE_FOC_PROJECT/Dave/Generated/GLOBAL_CCU4/global_ccu4_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/GLOBAL_CCU4/global_ccu4.o \
DAVE_FOC_PROJECT/Dave/Generated/GLOBAL_CCU8/global_ccu8_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/GLOBAL_CCU8/global_ccu8.o \
DAVE_FOC_PROJECT/Libraries/XMCLib/src/xmc_ccu4.o \
DAVE_FOC_PROJECT/Libraries/XMCLib/src/xmc_ccu8.o \
DAVE_FOC_PROJECT/Dave/Generated/GLOBAL_POSIF/global_posif_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/GLOBAL_POSIF/global_posif.o \
DAVE_FOC_PROJECT/Dave/Generated/HALL_POSIF/hall_posif_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/HALL_POSIF/hall_posif.o \
DAVE_FOC_PROJECT/Dave/Generated/PWM_SVM/pwm_svm_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/PWM_SVM/pwm_svm.o \
DAVE_FOC_PROJECT/Dave/Generated/PWM_SVM/pwm_svm_table.o \
DAVE_FOC_PROJECT/Dave/Generated/PMSM_FOC/pmsm_foc_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/PMSM_FOC/pmsm_foc.o \
DAVE_FOC_PROJECT/Dave/Generated/PMSM_FOC/pmsm_foc_control.o \
$(CC) $(LDFLAGS) $(LIBSDIR) $^ $(LIBS) -o $@
arm-none-eabi-objcopy -O binary $@ TSDZ2_motor_controller_v2_firmware.bin
arm-none-eabi-objcopy -O ihex $@ TSDZ2_motor_controller_v2_firmware.hex
.c.o:
$(CC) -c $(CCFLAGS) $< -o $@
.S.o:
$(CC) -x assembler-with-cpp -c $(CCFLAGS) $< -o $@
clean:
rm -f \
*.o *.elf *.map *.bin *.hex \
DAVE_FOC_PROJECT/Startup/startup_XMC1300.o \
DAVE_FOC_PROJECT/Startup/system_XMC1300.o \
syscalls.o \
DAVE_FOC_PROJECT/Libraries/XMCLib/src/xmc_vadc.o \
DAVE_FOC_PROJECT/Libraries/XMCLib/src/xmc1_scu.o \
DAVE_FOC_PROJECT/Libraries/XMCLib/src/xmc_posif.o \
DAVE_FOC_PROJECT/Dave/Generated/DAVE.o \
DAVE_FOC_PROJECT/Dave/Generated/PWM/pwm_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/PWM/pwm.o \
DAVE_FOC_PROJECT/Dave/Generated/ADC_QUEUE/adc_queue_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/ADC_QUEUE/adc_queue.o \
DAVE_FOC_PROJECT/Dave/Generated/CLOCK_XMC1/clock_xmc1_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/CLOCK_XMC1/clock_xmc1.o \
DAVE_FOC_PROJECT/Dave/Generated/CPU_CTRL_XMC1/cpu_ctrl_xmc1_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/CPU_CTRL_XMC1/cpu_ctrl_xmc1.o \
DAVE_FOC_PROJECT/Dave/Generated/GLOBAL_ADC/global_adc_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/GLOBAL_ADC/global_adc.o \
DAVE_FOC_PROJECT/Dave/Generated/GLOBAL_CCU4/global_ccu4_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/GLOBAL_CCU4/global_ccu4.o \
DAVE_FOC_PROJECT/Dave/Generated/GLOBAL_CCU8/global_ccu8_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/GLOBAL_CCU8/global_ccu8.o \
DAVE_FOC_PROJECT/Dave/Generated/GLOBAL_POSIF/global_posif_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/GLOBAL_POSIF/global_posif.o \
DAVE_FOC_PROJECT/Dave/Generated/HALL_POSIF/hall_posif_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/HALL_POSIF/hall_posif.o \
DAVE_FOC_PROJECT/Dave/Generated/PMSM_FOC/pmsm_foc_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/PMSM_FOC/pmsm_foc.o \
DAVE_FOC_PROJECT/Dave/Generated/PMSM_FOC/pmsm_foc_control.o \
DAVE_FOC_PROJECT/Dave/Generated/PWM_SVM/pwm_svm_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/PWM_SVM/pwm_svm.o \
DAVE_FOC_PROJECT/Dave/Generated/PWM_SVM/pwm_svm_table.o \
DAVE_FOC_PROJECT/Dave/Generated/UART/uart_conf.o \
DAVE_FOC_PROJECT/Dave/Generated/UART/uart.o \
DAVE_FOC_PROJECT/Libraries/XMCLib/src/xmc_ccu4.o \
DAVE_FOC_PROJECT/Libraries/XMCLib/src/xmc_ccu8.o \
DAVE_FOC_PROJECT/Libraries/XMCLib/src/xmc_gpio.o \
DAVE_FOC_PROJECT/Libraries/XMCLib/src/xmc1_gpio.o \
DAVE_FOC_PROJECT/Libraries/XMCLib/src/xmc_uart.o \
DAVE_FOC_PROJECT/Libraries/XMCLib/src/xmc_usic.o \
DAVE_FOC_PROJECT/main.o \