Rev 6 | Rev 11 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 6 | Rev 7 | ||
|---|---|---|---|
| Line 6... | Line 6... | ||
| 6 | # Compiler options here. |
6 | # Compiler options here. |
| 7 | ifeq ($(USE_OPT),) |
7 | ifeq ($(USE_OPT),) |
| 8 | USE_OPT = -Og -g -ggdb -fomit-frame-pointer -falign-functions=16 |
8 | USE_OPT = -Og -g -ggdb -fomit-frame-pointer -falign-functions=16 |
| 9 | endif |
9 | endif |
| 10 | 10 | ||
| - | 11 | ||
| 11 | # C specific options here (added to USE_OPT). |
12 | # C specific options here (added to USE_OPT). |
| 12 | ifeq ($(USE_COPT),) |
13 | ifeq ($(USE_COPT),) |
| 13 | USE_COPT = |
14 | USE_COPT = |
| 14 | endif |
15 | endif |
| 15 | 16 | ||
| 16 | # C++ specific options here (added to USE_OPT). |
17 | # C++ specific options here (added to USE_OPT). |
| 17 | ifeq ($(USE_CPPOPT),) |
18 | ifeq ($(USE_CPPOPT),) |
| 18 | USE_CPPOPT = -fno-rtti |
19 | USE_CPPOPT = -fno-rtti |
| Line 21... | Line 22... | ||
| 21 | # Enable this if you want the linker to remove unused code and data |
22 | # Enable this if you want the linker to remove unused code and data |
| 22 | ifeq ($(USE_LINK_GC),) |
23 | ifeq ($(USE_LINK_GC),) |
| 23 | USE_LINK_GC = yes |
24 | USE_LINK_GC = yes |
| 24 | endif |
25 | endif |
| 25 | 26 | ||
| - | 27 | # Linker extra options here. |
|
| - | 28 | ifeq ($(USE_LDOPT),) |
|
| - | 29 | USE_LDOPT = |
|
| - | 30 | endif |
|
| - | 31 | ||
| - | 32 | # Enable this if you want link time optimizations (LTO) |
|
| - | 33 | ifeq ($(USE_LTO),) |
|
| - | 34 | USE_LTO = yes |
|
| - | 35 | endif |
|
| - | 36 | ||
| 26 | # If enabled, this option allows to compile the application in THUMB mode. |
37 | # If enabled, this option allows to compile the application in THUMB mode. |
| 27 | ifeq ($(USE_THUMB),) |
38 | ifeq ($(USE_THUMB),) |
| 28 | USE_THUMB = yes |
39 | USE_THUMB = yes |
| 29 | endif |
40 | endif |
| 30 | 41 | ||
| 31 | # Enable this if you want to see the full log while compiling. |
42 | # Enable this if you want to see the full log while compiling. |
| 32 | ifeq ($(USE_VERBOSE_COMPILE),) |
43 | ifeq ($(USE_VERBOSE_COMPILE),) |
| 33 | USE_VERBOSE_COMPILE = no |
44 | USE_VERBOSE_COMPILE = no |
| 34 | endif |
45 | endif |
| 35 | 46 | ||
| - | 47 | # If enabled, this option makes the build process faster by not compiling |
|
| - | 48 | # modules not used in the current configuration. |
|
| - | 49 | ifeq ($(USE_SMART_BUILD),) |
|
| - | 50 | USE_SMART_BUILD = yes |
|
| - | 51 | endif |
|
| - | 52 | ||
| - | 53 | ||
| 36 | # |
54 | # |
| 37 | # Build global options |
55 | # Build global options |
| 38 | ############################################################################## |
56 | ############################################################################## |
| 39 | 57 | ||
| 40 | ############################################################################## |
58 | ############################################################################## |
| 41 | # Architecture or project specific options |
59 | # Architecture or project specific options |
| 42 | # |
60 | # |
| 43 | 61 | ||
| - | 62 | # Stack size to be allocated to the Cortex-M process stack. This stack is |
|
| - | 63 | # the stack used by the main() thread. |
|
| - | 64 | ifeq ($(USE_PROCESS_STACKSIZE),) |
|
| - | 65 | USE_PROCESS_STACKSIZE = 0x400 |
|
| - | 66 | endif |
|
| - | 67 | ||
| - | 68 | # Stack size to the allocated to the Cortex-M main/exceptions stack. This |
|
| - | 69 | # stack is used for processing interrupts and exceptions. |
|
| - | 70 | ifeq ($(USE_EXCEPTIONS_STACKSIZE),) |
|
| - | 71 | USE_EXCEPTIONS_STACKSIZE = 0x400 |
|
| - | 72 | endif |
|
| - | 73 | ||
| - | 74 | # Enables the use of FPU (no, softfp, hard). |
|
| - | 75 | ifeq ($(USE_FPU),) |
|
| - | 76 | USE_FPU = no |
|
| - | 77 | endif |
|
| - | 78 | ||
| 44 | # Enable this if you really want to use the STM FWLib. |
79 | # Enable this if you really want to use the STM FWLib. |
| 45 | ifeq ($(USE_FWLIB),) |
80 | ifeq ($(USE_FWLIB),) |
| 46 | USE_FWLIB = no |
81 | USE_FWLIB = no |
| 47 | endif |
82 | endif |
| 48 | 83 | ||
| Line 59... | Line 94... | ||
| 59 | # Define project name here |
94 | # Define project name here |
| 60 | PROJECT = ch |
95 | PROJECT = ch |
| 61 | #define board |
96 | #define board |
| 62 | BOARD = ST_bluePillF103 |
97 | BOARD = ST_bluePillF103 |
| 63 | 98 | ||
| 64 | # Imported source files and paths |
- | |
| 65 | CHIBIOS = ../chibios |
99 | CHIBIOS = ../ChibiOS |
| - | 100 | # Licensing files. |
|
| 66 | include $(CHIBIOS)/boards/$(BOARD)/board.mk |
101 | include $(CHIBIOS)/os/license/license.mk |
| - | 102 | # Startup files. |
|
| 67 | include $(CHIBIOS)/os/hal/platforms/STM32F1xx/platform.mk |
103 | include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk |
| - | 104 | # HAL-OSAL files (optional). |
|
| 68 | include $(CHIBIOS)/os/hal/hal.mk |
105 | include $(CHIBIOS)/os/hal/hal.mk |
| 69 | include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32F1xx/port.mk |
106 | include $(CHIBIOS)/os/hal/ports/STM32/STM32F1xx/platform.mk |
| - | 107 | # board pinout file changed from chibiOS |
|
| - | 108 | include ./chibios/board/board.mk |
|
| - | 109 | include $(CHIBIOS)/os/hal/osal/rt/osal.mk |
|
| - | 110 | # RTOS files (optional). |
|
| 70 | include $(CHIBIOS)/os/kernel/kernel.mk |
111 | include $(CHIBIOS)/os/rt/rt.mk |
| - | 112 | include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk |
|
| - | 113 | # Other files (optional). |
|
| 71 | include $(CHIBIOS)/test/test.mk |
114 | include $(CHIBIOS)/test/lib/test.mk |
| 72 | #include $(CHIBIOS)/ext/fatfs/fatfs.mk |
115 | include $(CHIBIOS)/test/rt/rt_test.mk |
| - | 116 | include $(CHIBIOS)/test/oslib/oslib_test.mk |
|
| - | 117 | include $(CHIBIOS)/os/hal/lib/streams/streams.mk |
|
| - | 118 | include $(CHIBIOS)/os/various/shell/shell.mk |
|
| 73 | 119 | ||
| 74 | # Define linker script file here |
120 | # Define linker script file here |
| 75 | LDSCRIPT= $(PORTLD)/STM32F103xB.ld |
121 | LDSCRIPT= $(STARTUPLD)/STM32F103xB.ld |
| 76 | 122 | ||
| 77 | SSD1306SRC = SSD1306_lib/Font.c |
123 | SSD1306SRC = SSD1306_lib/Font.c |
| 78 | SSD1306SRC += SSD1306_lib/SSD1306.c |
124 | SSD1306SRC += SSD1306_lib/SSD1306.c |
| 79 | 125 | ||
| 80 | SSD1306INC = SSD1306_lib |
126 | SSD1306INC = SSD1306_lib |
| Line 87... | Line 133... | ||
| 87 | 133 | ||
| 88 | IGNINC = inc |
134 | IGNINC = inc |
| 89 | 135 | ||
| 90 | # C sources that can be compiled in ARM or THUMB mode depending on the global |
136 | # C sources that can be compiled in ARM or THUMB mode depending on the global |
| 91 | # setting. |
137 | # setting. |
| 92 | CSRC = $(PORTSRC) \ |
138 | CSRC = $(ALLCSRC) \ |
| 93 | $(KERNSRC) \ |
- | |
| 94 | $(TESTSRC) \ |
- | |
| 95 | $(HALSRC) \ |
- | |
| 96 | $(PLATFORMSRC) \ |
- | |
| 97 | $(BOARDSRC) \ |
- | |
| 98 | $(SSD1306SRC) \ |
- | |
| 99 | $(CHIBIOS)/os/various/shell.c \ |
- | |
| 100 | $(CHIBIOS)/os/various/syscalls.c \ |
- | |
| 101 | $(CHIBIOS)/os/various/chprintf.c \ |
- | |
| 102 | $(IGNSRC) \ |
139 | $(IGNSRC) \ |
| - | 140 | $(SSD1306SRC) \ |
|
| - | 141 | usbcfg.c \ |
|
| 103 | main.c |
142 | main.c |
| 104 | 143 | ||
| 105 | # C++ sources that can be compiled in ARM or THUMB mode depending on the global |
144 | # C++ sources that can be compiled in ARM or THUMB mode depending on the global |
| 106 | # setting. |
145 | # setting. |
| 107 | CPPSRC = |
146 | CPPSRC = $(ALLCPPSRC) |
| 108 | 147 | ||
| 109 | # C sources to be compiled in ARM mode regardless of the global setting. |
148 | # C sources to be compiled in ARM mode regardless of the global setting. |
| 110 | # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
149 | # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
| 111 | # option that results in lower performance and larger code size. |
150 | # option that results in lower performance and larger code size. |
| 112 | ACSRC = |
151 | ACSRC = |
| Line 125... | Line 164... | ||
| 125 | # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
164 | # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
| 126 | # option that results in lower performance and larger code size. |
165 | # option that results in lower performance and larger code size. |
| 127 | TCPPSRC = |
166 | TCPPSRC = |
| 128 | 167 | ||
| 129 | # List ASM source files here |
168 | # List ASM source files here |
| 130 | ASMSRC = $(PORTASM) |
169 | ASMSRC = $(ALLASMSRC) |
| - | 170 | ASMXSRC = $(ALLXASMSRC) |
|
| - | 171 | ||
| 131 | 172 | ||
| 132 | INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ |
173 | INCDIR = $(ALLINC) \ |
| 133 | $(HALINC) $(PLATFORMINC) $(BOARDINC) \ |
174 | $(IGNINC) \ |
| 134 | $(IGNINC) $(SSD1306INC) \ |
175 | $(SSD1306INC) \ |
| 135 | $(CHIBIOS)/os/various |
176 | $(CHIBIOS)/os/various |
| 136 | 177 | ||
| 137 | # |
178 | # |
| 138 | # Project, sources and paths |
179 | # Project, sources and paths |
| 139 | ############################################################################## |
180 | ############################################################################## |
| Line 226... | Line 267... | ||
| 226 | CSRC += $(STM32SRC) |
267 | CSRC += $(STM32SRC) |
| 227 | INCDIR += $(STM32INC) |
268 | INCDIR += $(STM32INC) |
| 228 | USE_OPT += -DUSE_STDPERIPH_DRIVER |
269 | USE_OPT += -DUSE_STDPERIPH_DRIVER |
| 229 | endif |
270 | endif |
| 230 | 271 | ||
| - | 272 | ||
| - | 273 | ############################################################################## |
|
| - | 274 | ||
| 231 | include $(CHIBIOS)/os/ports/GCC/ARMCMx/rules.mk |
275 | RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC |
| - | 276 | include $(RULESPATH)/rules.mk |
|