1 ###############################################################################
2 # "THE BEER-WARE LICENSE" (Revision 42):
3 # <msmith@FreeBSD.ORG> wrote this file. As long as you retain this notice you
4 # can do whatever you want with this stuff. If we meet some day, and you think
5 # this stuff is worth it, you can buy me a beer in return
6 ###############################################################################
8 # Makefile for building the cleanflight firmware.
10 # Invoke this with 'make help' to see the list of supported targets.
13 ###############################################################################
14 # Things that the user might override on the commandline
17 # The target to build, see VALID_TARGETS below
20 # Compile-time options
23 # compile for OpenPilot BootLoader support
26 # Debugger optons, must be empty or GDB
29 # Serial port/Device for flashing
30 SERIAL_DEVICE ?
= $(firstword $(wildcard /dev
/ttyUSB
*) no-port-found
)
32 # Flash size (KB). Some low-end chips actually have more flash than advertised, use this to override.
35 ###############################################################################
36 # Things that need to be maintained as the source changes
41 VALID_TARGETS
= NAZE NAZE32PRO OLIMEXINO STM32F3DISCOVERY CHEBUZZF3 CC3D CJMCU EUSTM32F103RC SPRACINGF3 PORT103R SPARKY ALIENWIIF1 ALIENWIIF3 COLIBRI_RACE
43 # Valid targets for OP BootLoader support
44 OPBL_VALID_TARGETS
= CC3D
46 # Configure default flash sizes for the targets
48 ifeq ($(TARGET
),$(filter $(TARGET
),CJMCU
))
50 else ifeq ($(TARGET
),$(filter $(TARGET
),NAZE CC3D ALIENWIIF1 OLIMEXINO
))
52 else ifeq ($(TARGET
),$(filter $(TARGET
),EUSTM32F103RC PORT103R STM32F3DISCOVERY CHEBUZZF3 NAZE32PRO SPRACINGF3 SPARKY ALIENWIIF3 COLIBRI_RACE
))
55 $(error FLASH_SIZE not configured for target
)
59 REVISION
= $(shell git log
-1 --format
="%h")
62 ROOT
:= $(patsubst %/,%,$(dir $(lastword
$(MAKEFILE_LIST
))))
63 SRC_DIR
= $(ROOT
)/src
/main
64 OBJECT_DIR
= $(ROOT
)/obj
/main
66 CMSIS_DIR
= $(ROOT
)/lib
/main
/CMSIS
67 INCLUDE_DIRS
= $(SRC_DIR
)
68 LINKER_DIR
= $(ROOT
)/src
/main
/target
70 # Search path for sources
71 VPATH
:= $(SRC_DIR
):$(SRC_DIR
)/startup
72 USBFS_DIR
= $(ROOT
)/lib
/main
/STM32_USB-FS-Device_Driver
73 USBPERIPH_SRC
= $(notdir $(wildcard $(USBFS_DIR
)/src
/*.c
))
75 ifeq ($(TARGET
),$(filter $(TARGET
),STM32F3DISCOVERY CHEBUZZF3 NAZE32PRO SPRACINGF3 SPARKY ALIENWIIF3 COLIBRI_RACE
))
77 STDPERIPH_DIR
= $(ROOT
)/lib
/main
/STM32F30x_StdPeriph_Driver
79 STDPERIPH_SRC
= $(notdir $(wildcard $(STDPERIPH_DIR
)/src
/*.c
))
81 EXCLUDES
= stm32f30x_crc.c \
84 STDPERIPH_SRC
:= $(filter-out ${EXCLUDES}, $(STDPERIPH_SRC
))
86 DEVICE_STDPERIPH_SRC
= \
90 VPATH
:= $(VPATH
):$(CMSIS_DIR
)/CM1
/CoreSupport
:$(CMSIS_DIR
)/CM1
/DeviceSupport
/ST
/STM32F30x
91 CMSIS_SRC
= $(notdir $(wildcard $(CMSIS_DIR
)/CM1
/CoreSupport
/*.c \
92 $(CMSIS_DIR
)/CM1
/DeviceSupport
/ST
/STM32F30x
/*.c
))
94 INCLUDE_DIRS
:= $(INCLUDE_DIRS
) \
95 $(STDPERIPH_DIR
)/inc \
96 $(CMSIS_DIR
)/CM1
/CoreSupport \
97 $(CMSIS_DIR
)/CM1
/DeviceSupport
/ST
/STM32F30x
99 ifneq ($(TARGET
),SPRACINGF3
)
100 INCLUDE_DIRS
:= $(INCLUDE_DIRS
) \
104 VPATH
:= $(VPATH
):$(USBFS_DIR
)/src
106 DEVICE_STDPERIPH_SRC
:= $(DEVICE_STDPERIPH_SRC
)\
111 LD_SCRIPT
= $(LINKER_DIR
)/stm32_flash_f303_
$(FLASH_SIZE
)k.
ld
113 ARCH_FLAGS
= -mthumb
-mcpu
=cortex-m4
-mfloat-abi
=hard
-mfpu
=fpv4-sp-d16
-fsingle-precision-constant
-Wdouble-promotion
114 DEVICE_FLAGS
= -DSTM32F303xC
-DSTM32F303
115 TARGET_FLAGS
= -D
$(TARGET
)
116 ifeq ($(TARGET
),CHEBUZZF3
)
117 # CHEBUZZ is a VARIANT of STM32F3DISCOVERY
118 TARGET_FLAGS
:= $(TARGET_FLAGS
) -DSTM32F3DISCOVERY
121 else ifeq ($(TARGET
),$(filter $(TARGET
),EUSTM32F103RC PORT103R
))
124 STDPERIPH_DIR
= $(ROOT
)/lib
/main
/STM32F10x_StdPeriph_Driver
126 STDPERIPH_SRC
= $(notdir $(wildcard $(STDPERIPH_DIR
)/src
/*.c
))
128 EXCLUDES
= stm32f10x_crc.c \
132 STDPERIPH_SRC
:= $(filter-out ${EXCLUDES}, $(STDPERIPH_SRC
))
134 # Search path and source files for the CMSIS sources
135 VPATH
:= $(VPATH
):$(CMSIS_DIR
)/CM3
/CoreSupport
:$(CMSIS_DIR
)/CM3
/DeviceSupport
/ST
/STM32F10x
136 CMSIS_SRC
= $(notdir $(wildcard $(CMSIS_DIR
)/CM3
/CoreSupport
/*.c \
137 $(CMSIS_DIR
)/CM3
/DeviceSupport
/ST
/STM32F10x
/*.c
))
139 INCLUDE_DIRS
:= $(INCLUDE_DIRS
) \
140 $(STDPERIPH_DIR
)/inc \
141 $(CMSIS_DIR
)/CM3
/CoreSupport \
142 $(CMSIS_DIR
)/CM3
/DeviceSupport
/ST
/STM32F10x \
144 LD_SCRIPT
= $(LINKER_DIR
)/stm32_flash_f103_
$(FLASH_SIZE
)k.
ld
146 ARCH_FLAGS
= -mthumb
-mcpu
=cortex-m3
147 TARGET_FLAGS
= -D
$(TARGET
) -pedantic
148 DEVICE_FLAGS
= -DSTM32F10X_HD
-DSTM32F10X
150 DEVICE_STDPERIPH_SRC
= $(STDPERIPH_SRC
)
154 STDPERIPH_DIR
= $(ROOT
)/lib
/main
/STM32F10x_StdPeriph_Driver
156 STDPERIPH_SRC
= $(notdir $(wildcard $(STDPERIPH_DIR
)/src
/*.c
))
158 EXCLUDES
= stm32f10x_crc.c \
162 STDPERIPH_SRC
:= $(filter-out ${EXCLUDES}, $(STDPERIPH_SRC
))
164 # Search path and source files for the CMSIS sources
165 VPATH
:= $(VPATH
):$(CMSIS_DIR
)/CM3
/CoreSupport
:$(CMSIS_DIR
)/CM3
/DeviceSupport
/ST
/STM32F10x
166 CMSIS_SRC
= $(notdir $(wildcard $(CMSIS_DIR
)/CM3
/CoreSupport
/*.c \
167 $(CMSIS_DIR
)/CM3
/DeviceSupport
/ST
/STM32F10x
/*.c
))
169 INCLUDE_DIRS
:= $(INCLUDE_DIRS
) \
170 $(STDPERIPH_DIR
)/inc \
171 $(CMSIS_DIR
)/CM3
/CoreSupport \
172 $(CMSIS_DIR
)/CM3
/DeviceSupport
/ST
/STM32F10x \
174 DEVICE_STDPERIPH_SRC
= $(STDPERIPH_SRC
)
176 ifeq ($(TARGET
),CC3D
)
177 INCLUDE_DIRS
:= $(INCLUDE_DIRS
) \
181 VPATH
:= $(VPATH
):$(USBFS_DIR
)/src
183 DEVICE_STDPERIPH_SRC
:= $(DEVICE_STDPERIPH_SRC
) \
188 LD_SCRIPT
= $(LINKER_DIR
)/stm32_flash_f103_
$(FLASH_SIZE
)k.
ld
190 ARCH_FLAGS
= -mthumb
-mcpu
=cortex-m3
191 TARGET_FLAGS
= -D
$(TARGET
) -pedantic
192 DEVICE_FLAGS
= -DSTM32F10X_MD
-DSTM32F10X
196 ifneq ($(FLASH_SIZE
),)
197 DEVICE_FLAGS
:= $(DEVICE_FLAGS
) -DFLASH_SIZE
=$(FLASH_SIZE
)
200 TARGET_DIR
= $(ROOT
)/src
/main
/target
/$(TARGET
)
201 TARGET_SRC
= $(notdir $(wildcard $(TARGET_DIR
)/*.c
))
203 ifeq ($(TARGET
),ALIENWIIF1
)
204 # ALIENWIIF1 is a VARIANT of NAZE
205 TARGET_FLAGS
:= $(TARGET_FLAGS
) -DNAZE
-DALIENWII32
206 TARGET_DIR
= $(ROOT
)/src
/main
/target
/NAZE
209 INCLUDE_DIRS
:= $(INCLUDE_DIRS
) \
212 VPATH
:= $(VPATH
):$(TARGET_DIR
)
214 COMMON_SRC
= build_config.c \
219 config
/runtime_config.c \
222 common
/typeconversion.c \
227 flight
/altitudehold.c \
233 drivers
/bus_i2c_soft.c \
235 drivers
/sound_beeper.c \
237 drivers
/gyro_sync.c \
245 io
/statusindicator.c \
254 sensors
/acceleration.c \
256 sensors
/boardalignment.c \
259 sensors
/initialisation.c \
261 $(DEVICE_STDPERIPH_SRC
)
263 HIGHEND_SRC
= flight
/autotune.c \
264 flight
/navigation.c \
265 flight
/gps_conversion.c \
266 common
/colorconversion.c \
270 telemetry
/telemetry.c \
274 telemetry
/smartport.c \
276 sensors
/barometer.c \
277 blackbox
/blackbox.c \
278 blackbox
/blackbox_io.c
288 drivers
/serial_usb_vcp.c
290 NAZE_SRC
= startup_stm32f10x_md_gcc.S \
291 drivers
/accgyro_adxl345.c \
292 drivers
/accgyro_bma280.c \
293 drivers
/accgyro_l3g4200d.c \
294 drivers
/accgyro_mma845x.c \
295 drivers
/accgyro_mpu3050.c \
296 drivers
/accgyro_mpu6050.c \
297 drivers
/accgyro_spi_mpu6500.c \
299 drivers
/adc_stm32f10x.c \
300 drivers
/barometer_bmp085.c \
301 drivers
/barometer_bmp280.c \
302 drivers
/barometer_ms5611.c \
304 drivers
/bus_i2c_stm32f10x.c \
305 drivers
/compass_hmc5883l.c \
306 drivers
/display_ug2864hsweg01.h \
307 drivers
/flash_m25p16.c \
308 drivers
/gpio_stm32f10x.c \
310 drivers
/light_led_stm32f10x.c \
311 drivers
/light_ws2811strip.c \
312 drivers
/light_ws2811strip_stm32f10x.c \
313 drivers
/sonar_hcsr04.c \
314 drivers
/pwm_mapping.c \
315 drivers
/pwm_output.c \
317 drivers
/serial_softserial.c \
318 drivers
/serial_uart.c \
319 drivers
/serial_uart_stm32f10x.c \
320 drivers
/sound_beeper_stm32f10x.c \
321 drivers
/system_stm32f10x.c \
323 drivers
/timer_stm32f10x.c \
325 hardware_revision.c \
329 ALIENWIIF1_SRC
= $(NAZE_SRC
)
331 EUSTM32F103RC_SRC
= startup_stm32f10x_hd_gcc.S \
332 drivers
/accgyro_adxl345.c \
333 drivers
/accgyro_bma280.c \
334 drivers
/accgyro_l3g4200d.c \
335 drivers
/accgyro_mma845x.c \
336 drivers
/accgyro_mpu3050.c \
337 drivers
/accgyro_mpu6050.c \
338 drivers
/accgyro_spi_mpu6000.c \
339 drivers
/accgyro_spi_mpu6500.c \
341 drivers
/adc_stm32f10x.c \
342 drivers
/barometer_bmp085.c \
343 drivers
/barometer_bmp280.c \
344 drivers
/barometer_ms5611.c \
345 drivers
/bus_i2c_stm32f10x.c \
347 drivers
/compass_ak8975.c \
348 drivers
/compass_hmc5883l.c \
349 drivers
/display_ug2864hsweg01.c \
350 drivers
/flash_m25p16.c \
351 drivers
/gpio_stm32f10x.c \
353 drivers
/light_led_stm32f10x.c \
354 drivers
/light_ws2811strip.c \
355 drivers
/light_ws2811strip_stm32f10x.c \
356 drivers
/pwm_mapping.c \
357 drivers
/pwm_output.c \
359 drivers
/serial_softserial.c \
360 drivers
/serial_uart.c \
361 drivers
/serial_uart_stm32f10x.c \
362 drivers
/sonar_hcsr04.c \
363 drivers
/sound_beeper_stm32f10x.c \
364 drivers
/system_stm32f10x.c \
366 drivers
/timer_stm32f10x.c \
371 PORT103R_SRC
= $(EUSTM32F103RC_SRC
)
373 OLIMEXINO_SRC
= startup_stm32f10x_md_gcc.S \
374 drivers
/accgyro_mpu6050.c \
376 drivers
/adc_stm32f10x.c \
377 drivers
/barometer_bmp085.c \
378 drivers
/barometer_bmp280.c \
379 drivers
/bus_i2c_stm32f10x.c \
381 drivers
/compass_hmc5883l.c \
382 drivers
/gpio_stm32f10x.c \
383 drivers
/light_led_stm32f10x.c \
384 drivers
/light_ws2811strip.c \
385 drivers
/light_ws2811strip_stm32f10x.c \
386 drivers
/pwm_mapping.c \
387 drivers
/pwm_output.c \
389 drivers
/serial_softserial.c \
390 drivers
/serial_uart.c \
391 drivers
/serial_uart_stm32f10x.c \
392 drivers
/sonar_hcsr04.c \
393 drivers
/sound_beeper_stm32f10x.c \
394 drivers
/system_stm32f10x.c \
396 drivers
/timer_stm32f10x.c \
401 ifneq ($(filter $(TARGET
),$(OPBL_VALID_TARGETS
)),)
402 TARGET_FLAGS
:= -DOPBL
$(TARGET_FLAGS
)
403 LD_SCRIPT
= $(LINKER_DIR
)/stm32_flash_f103_
$(FLASH_SIZE
)k_opbl.
ld
404 .DEFAULT_GOAL
:= binary
406 $(error OPBL specified with a unsupported target
)
411 startup_stm32f10x_md_gcc.S \
413 drivers
/adc_stm32f10x.c \
414 drivers
/accgyro_mpu6050.c \
415 drivers
/bus_i2c_stm32f10x.c \
416 drivers
/compass_hmc5883l.c \
417 drivers
/gpio_stm32f10x.c \
418 drivers
/light_led_stm32f10x.c \
419 drivers
/pwm_mapping.c \
420 drivers
/pwm_output.c \
422 drivers
/serial_uart.c \
423 drivers
/serial_uart_stm32f10x.c \
424 drivers
/sound_beeper_stm32f10x.c \
425 drivers
/system_stm32f10x.c \
427 drivers
/timer_stm32f10x.c \
428 hardware_revision.c \
429 blackbox
/blackbox.c \
430 blackbox
/blackbox_io.c \
434 startup_stm32f10x_md_gcc.S \
435 drivers
/accgyro_spi_mpu6000.c \
437 drivers
/adc_stm32f10x.c \
438 drivers
/barometer_bmp085.c \
439 drivers
/barometer_bmp280.c \
440 drivers
/barometer_ms5611.c \
442 drivers
/bus_i2c_stm32f10x.c \
443 drivers
/compass_hmc5883l.c \
444 drivers
/display_ug2864hsweg01.c \
445 drivers
/flash_m25p16.c \
446 drivers
/gpio_stm32f10x.c \
448 drivers
/light_led_stm32f10x.c \
449 drivers
/light_ws2811strip.c \
450 drivers
/light_ws2811strip_stm32f10x.c \
451 drivers
/pwm_mapping.c \
452 drivers
/pwm_output.c \
454 drivers
/serial_softserial.c \
455 drivers
/serial_uart.c \
456 drivers
/serial_uart_stm32f10x.c \
457 drivers
/sonar_hcsr04.c \
458 drivers
/sound_beeper_stm32f10x.c \
459 drivers
/system_stm32f10x.c \
461 drivers
/timer_stm32f10x.c \
467 STM32F30x_COMMON_SRC
= \
468 startup_stm32f30x_md_gcc.S \
470 drivers
/adc_stm32f30x.c \
471 drivers
/bus_i2c_stm32f30x.c \
473 drivers
/gpio_stm32f30x.c \
474 drivers
/light_led_stm32f30x.c \
475 drivers
/light_ws2811strip.c \
476 drivers
/light_ws2811strip_stm32f30x.c \
477 drivers
/pwm_mapping.c \
478 drivers
/pwm_output.c \
480 drivers
/serial_uart.c \
481 drivers
/serial_uart_stm32f30x.c \
482 drivers
/sound_beeper_stm32f30x.c \
483 drivers
/system_stm32f30x.c \
485 drivers
/timer_stm32f30x.c
488 $(STM32F30x_COMMON_SRC
) \
493 STM32F3DISCOVERY_COMMON_SRC
= \
494 $(STM32F30x_COMMON_SRC
) \
495 drivers
/accgyro_l3gd20.c \
496 drivers
/accgyro_l3gd20.c \
497 drivers
/accgyro_lsm303dlhc.c \
498 drivers
/compass_hmc5883l.c \
501 STM32F3DISCOVERY_SRC
= \
502 $(STM32F3DISCOVERY_COMMON_SRC
) \
503 drivers
/accgyro_adxl345.c \
504 drivers
/accgyro_bma280.c \
505 drivers
/accgyro_mma845x.c \
506 drivers
/accgyro_mpu3050.c \
507 drivers
/accgyro_mpu6050.c \
508 drivers
/accgyro_l3g4200d.c \
509 drivers
/barometer_ms5611.c \
510 drivers
/barometer_bmp280.c \
511 drivers
/compass_ak8975.c \
516 $(STM32F3DISCOVERY_SRC
) \
521 $(STM32F30x_COMMON_SRC
) \
522 drivers
/display_ug2864hsweg01.c \
523 drivers
/accgyro_spi_mpu6500.c \
524 drivers
/barometer_ms5611.c \
525 drivers
/compass_ak8975.c \
526 drivers
/compass_hmc5883l.c \
527 drivers
/serial_usb_vcp.c \
533 $(STM32F30x_COMMON_SRC
) \
534 drivers
/display_ug2864hsweg01.c \
535 drivers
/accgyro_mpu6050.c \
536 drivers
/barometer_ms5611.c \
537 drivers
/barometer_bmp280.c \
538 drivers
/compass_ak8975.c \
539 drivers
/serial_usb_vcp.c \
544 ALIENWIIF3_SRC
= $(SPARKY_SRC
)
547 $(STM32F30x_COMMON_SRC
) \
548 drivers
/accgyro_mpu6050.c \
549 drivers
/barometer_ms5611.c \
550 drivers
/compass_ak8975.c \
551 drivers
/barometer_bmp280.c \
552 drivers
/compass_hmc5883l.c \
553 drivers
/display_ug2864hsweg01.h \
554 drivers
/flash_m25p16.c \
555 drivers
/serial_softserial.c \
556 drivers
/sonar_hcsr04.c \
561 # Search path and source files for the ST stdperiph library
562 VPATH
:= $(VPATH
):$(STDPERIPH_DIR
)/src
564 ###############################################################################
565 # Things that might need changing to use different tools
569 CC
= arm-none-eabi-gcc
570 OBJCOPY
= arm-none-eabi-objcopy
571 SIZE
= arm-none-eabi-size
579 LTO_FLAGS
= $(OPTIMIZE
)
582 LTO_FLAGS
= -flto
-fuse-linker-plugin
$(OPTIMIZE
)
587 CFLAGS
= $(ARCH_FLAGS
) \
589 $(addprefix -D
,$(OPTIONS
)) \
590 $(addprefix -I
,$(INCLUDE_DIRS
)) \
593 -Wall
-Wextra
-Wunsafe-loop-optimizations
-Wdouble-promotion \
594 -ffunction-sections \
597 -DUSE_STDPERIPH_DRIVER \
599 -D
'__FORKNAME__="$(FORKNAME)"' \
600 -D
'__TARGET__="$(TARGET)"' \
601 -D
'__REVISION__="$(REVISION)"' \
605 ASFLAGS
= $(ARCH_FLAGS
) \
606 -x assembler-with-cpp \
607 $(addprefix -I
,$(INCLUDE_DIRS
)) \
619 -Wl
,-gc-sections
,-Map
,$(TARGET_MAP
) \
620 -Wl
,-L
$(LINKER_DIR
) \
623 ###############################################################################
624 # No user-serviceable parts below
625 ###############################################################################
628 # Things we will build
630 ifeq ($(filter $(TARGET
),$(VALID_TARGETS
)),)
631 $(error Target
'$(TARGET)' is not valid
, must be one of
$(VALID_TARGETS
))
634 TARGET_BIN
= $(BIN_DIR
)/$(FORKNAME
)_
$(TARGET
).bin
635 TARGET_HEX
= $(BIN_DIR
)/$(FORKNAME
)_
$(TARGET
).hex
636 TARGET_ELF
= $(OBJECT_DIR
)/$(FORKNAME
)_
$(TARGET
).elf
637 TARGET_OBJS
= $(addsuffix .o
,$(addprefix $(OBJECT_DIR
)/$(TARGET
)/,$(basename $($(TARGET
)_SRC
))))
638 TARGET_DEPS
= $(addsuffix .d
,$(addprefix $(OBJECT_DIR
)/$(TARGET
)/,$(basename $($(TARGET
)_SRC
))))
639 TARGET_MAP
= $(OBJECT_DIR
)/$(FORKNAME
)_
$(TARGET
).map
641 # List of buildable ELF files and their object dependencies.
642 # It would be nice to compute these lists, but that seems to be just beyond make.
644 $(TARGET_HEX
): $(TARGET_ELF
)
645 $(OBJCOPY
) -O ihex
--set-start
0x8000000 $< $@
647 $(TARGET_BIN
): $(TARGET_ELF
)
648 $(OBJCOPY
) -O binary
$< $@
650 $(TARGET_ELF
): $(TARGET_OBJS
)
651 $(CC
) -o
$@
$^
$(LDFLAGS
)
652 $(SIZE
) $(TARGET_ELF
)
655 $(OBJECT_DIR
)/$(TARGET
)/%.o
: %.c
657 @echo
%% $(notdir $<)
658 @
$(CC
) -c
-o
$@
$(CFLAGS
) $<
661 $(OBJECT_DIR
)/$(TARGET
)/%.o
: %.s
663 @echo
%% $(notdir $<)
664 @
$(CC
) -c
-o
$@
$(ASFLAGS
) $<
666 $(OBJECT_DIR
)/$(TARGET
)/%.o
: %.S
668 @echo
%% $(notdir $<)
669 @
$(CC
) -c
-o
$@
$(ASFLAGS
) $<
672 rm -f
$(TARGET_BIN
) $(TARGET_HEX
) $(TARGET_ELF
) $(TARGET_OBJS
) $(TARGET_MAP
)
673 rm -rf
$(OBJECT_DIR
)/$(TARGET
)
674 cd src
/test && $(MAKE
) clean || true
676 flash_
$(TARGET
): $(TARGET_HEX
)
677 stty
-F
$(SERIAL_DEVICE
) raw speed
115200 -crtscts cs8
-parenb
-cstopb
-ixon
678 echo
-n
'R' >$(SERIAL_DEVICE
)
679 stm32flash
-w
$(TARGET_HEX
) -v
-g
0x0 -b
115200 $(SERIAL_DEVICE
)
681 flash
: flash_
$(TARGET
)
683 st-flash_
$(TARGET
): $(TARGET_BIN
)
684 st-flash
--reset write
$< 0x08000000
686 st-flash
: st-flash_
$(TARGET
)
688 binary
: $(TARGET_BIN
)
690 unbrick_
$(TARGET
): $(TARGET_HEX
)
691 stty
-F
$(SERIAL_DEVICE
) raw speed
115200 -crtscts cs8
-parenb
-cstopb
-ixon
692 stm32flash
-w
$(TARGET_HEX
) -v
-g
0x0 -b
115200 $(SERIAL_DEVICE
)
694 unbrick
: unbrick_
$(TARGET
)
698 @echo
"Makefile for the $(FORKNAME) firmware"
701 @echo
" make [TARGET=<target>] [OPTIONS=\"<options>\"]"
703 @echo
"Valid TARGET values are: $(VALID_TARGETS)"
706 ## test : run the cleanflight test suite
708 cd src
/test && $(MAKE
) test || true
710 # rebuild everything when makefile changes
711 $(TARGET_OBJS
) : Makefile
713 # include auto-generated dependencies
714 -include $(TARGET_DEPS
)