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
39 FORKNAME
= cleanflight
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 \
226 flight
/altitudehold.c \
233 drivers
/bus_i2c_soft.c \
235 drivers
/sound_beeper.c \
243 io
/statusindicator.c \
252 sensors
/acceleration.c \
254 sensors
/boardalignment.c \
257 sensors
/initialisation.c \
259 $(DEVICE_STDPERIPH_SRC
)
261 HIGHEND_SRC
= flight
/autotune.c \
262 flight
/navigation.c \
263 flight
/gps_conversion.c \
264 common
/colorconversion.c \
268 telemetry
/telemetry.c \
272 telemetry
/smartport.c \
274 sensors
/barometer.c \
275 blackbox
/blackbox.c \
276 blackbox
/blackbox_io.c
286 drivers
/serial_usb_vcp.c
288 NAZE_SRC
= startup_stm32f10x_md_gcc.S \
289 drivers
/accgyro_adxl345.c \
290 drivers
/accgyro_bma280.c \
291 drivers
/accgyro_l3g4200d.c \
292 drivers
/accgyro_mma845x.c \
293 drivers
/accgyro_mpu3050.c \
294 drivers
/accgyro_mpu6050.c \
295 drivers
/accgyro_spi_mpu6500.c \
297 drivers
/adc_stm32f10x.c \
298 drivers
/barometer_bmp085.c \
299 drivers
/barometer_ms5611.c \
301 drivers
/bus_i2c_stm32f10x.c \
302 drivers
/compass_hmc5883l.c \
303 drivers
/display_ug2864hsweg01.h \
304 drivers
/flash_m25p16.c \
305 drivers
/gpio_stm32f10x.c \
307 drivers
/light_led_stm32f10x.c \
308 drivers
/light_ws2811strip.c \
309 drivers
/light_ws2811strip_stm32f10x.c \
310 drivers
/sonar_hcsr04.c \
311 drivers
/pwm_mapping.c \
312 drivers
/pwm_output.c \
314 drivers
/serial_softserial.c \
315 drivers
/serial_uart.c \
316 drivers
/serial_uart_stm32f10x.c \
317 drivers
/sound_beeper_stm32f10x.c \
318 drivers
/system_stm32f10x.c \
320 drivers
/timer_stm32f10x.c \
322 hardware_revision.c \
326 ALIENWIIF1_SRC
= $(NAZE_SRC
)
328 EUSTM32F103RC_SRC
= startup_stm32f10x_hd_gcc.S \
329 drivers
/accgyro_adxl345.c \
330 drivers
/accgyro_bma280.c \
331 drivers
/accgyro_l3g4200d.c \
332 drivers
/accgyro_mma845x.c \
333 drivers
/accgyro_mpu3050.c \
334 drivers
/accgyro_mpu6050.c \
335 drivers
/accgyro_spi_mpu6000.c \
336 drivers
/accgyro_spi_mpu6500.c \
338 drivers
/adc_stm32f10x.c \
339 drivers
/barometer_bmp085.c \
340 drivers
/barometer_ms5611.c \
341 drivers
/bus_i2c_stm32f10x.c \
343 drivers
/compass_ak8975.c \
344 drivers
/compass_hmc5883l.c \
345 drivers
/display_ug2864hsweg01.c \
346 drivers
/flash_m25p16.c \
347 drivers
/gpio_stm32f10x.c \
349 drivers
/light_led_stm32f10x.c \
350 drivers
/light_ws2811strip.c \
351 drivers
/light_ws2811strip_stm32f10x.c \
352 drivers
/pwm_mapping.c \
353 drivers
/pwm_output.c \
355 drivers
/serial_softserial.c \
356 drivers
/serial_uart.c \
357 drivers
/serial_uart_stm32f10x.c \
358 drivers
/sonar_hcsr04.c \
359 drivers
/sound_beeper_stm32f10x.c \
360 drivers
/system_stm32f10x.c \
362 drivers
/timer_stm32f10x.c \
367 PORT103R_SRC
= $(EUSTM32F103RC_SRC
)
369 OLIMEXINO_SRC
= startup_stm32f10x_md_gcc.S \
370 drivers
/accgyro_mpu6050.c \
372 drivers
/adc_stm32f10x.c \
373 drivers
/barometer_bmp085.c \
374 drivers
/bus_i2c_stm32f10x.c \
376 drivers
/compass_hmc5883l.c \
377 drivers
/gpio_stm32f10x.c \
378 drivers
/light_led_stm32f10x.c \
379 drivers
/light_ws2811strip.c \
380 drivers
/light_ws2811strip_stm32f10x.c \
381 drivers
/pwm_mapping.c \
382 drivers
/pwm_output.c \
384 drivers
/serial_softserial.c \
385 drivers
/serial_uart.c \
386 drivers
/serial_uart_stm32f10x.c \
387 drivers
/sonar_hcsr04.c \
388 drivers
/sound_beeper_stm32f10x.c \
389 drivers
/system_stm32f10x.c \
391 drivers
/timer_stm32f10x.c \
396 ifneq ($(filter $(TARGET
),$(OPBL_VALID_TARGETS
)),)
397 TARGET_FLAGS
:= -DOPBL
$(TARGET_FLAGS
)
398 LD_SCRIPT
= $(LINKER_DIR
)/stm32_flash_f103_
$(FLASH_SIZE
)k_opbl.
ld
399 .DEFAULT_GOAL
:= binary
401 $(error OPBL specified with a unsupported target
)
406 startup_stm32f10x_md_gcc.S \
408 drivers
/adc_stm32f10x.c \
409 drivers
/accgyro_mpu6050.c \
410 drivers
/bus_i2c_stm32f10x.c \
411 drivers
/compass_hmc5883l.c \
412 drivers
/gpio_stm32f10x.c \
413 drivers
/light_led_stm32f10x.c \
414 drivers
/pwm_mapping.c \
415 drivers
/pwm_output.c \
417 drivers
/serial_uart.c \
418 drivers
/serial_uart_stm32f10x.c \
419 drivers
/sound_beeper_stm32f10x.c \
420 drivers
/system_stm32f10x.c \
422 drivers
/timer_stm32f10x.c \
423 hardware_revision.c \
424 blackbox
/blackbox.c \
425 blackbox
/blackbox_io.c \
429 startup_stm32f10x_md_gcc.S \
430 drivers
/accgyro_spi_mpu6000.c \
432 drivers
/adc_stm32f10x.c \
433 drivers
/barometer_bmp085.c \
434 drivers
/barometer_ms5611.c \
436 drivers
/bus_i2c_stm32f10x.c \
437 drivers
/compass_hmc5883l.c \
438 drivers
/display_ug2864hsweg01.c \
439 drivers
/flash_m25p16.c \
440 drivers
/gpio_stm32f10x.c \
442 drivers
/light_led_stm32f10x.c \
443 drivers
/light_ws2811strip.c \
444 drivers
/light_ws2811strip_stm32f10x.c \
445 drivers
/pwm_mapping.c \
446 drivers
/pwm_output.c \
448 drivers
/serial_softserial.c \
449 drivers
/serial_uart.c \
450 drivers
/serial_uart_stm32f10x.c \
451 drivers
/sonar_hcsr04.c \
452 drivers
/sound_beeper_stm32f10x.c \
453 drivers
/system_stm32f10x.c \
455 drivers
/timer_stm32f10x.c \
461 STM32F30x_COMMON_SRC
= \
462 startup_stm32f30x_md_gcc.S \
464 drivers
/adc_stm32f30x.c \
465 drivers
/bus_i2c_stm32f30x.c \
467 drivers
/gpio_stm32f30x.c \
468 drivers
/light_led_stm32f30x.c \
469 drivers
/light_ws2811strip.c \
470 drivers
/light_ws2811strip_stm32f30x.c \
471 drivers
/pwm_mapping.c \
472 drivers
/pwm_output.c \
474 drivers
/serial_uart.c \
475 drivers
/serial_uart_stm32f30x.c \
476 drivers
/sound_beeper_stm32f30x.c \
477 drivers
/system_stm32f30x.c \
479 drivers
/timer_stm32f30x.c
482 $(STM32F30x_COMMON_SRC
) \
487 STM32F3DISCOVERY_COMMON_SRC
= \
488 $(STM32F30x_COMMON_SRC
) \
489 drivers
/accgyro_l3gd20.c \
490 drivers
/accgyro_l3gd20.c \
491 drivers
/accgyro_lsm303dlhc.c \
492 drivers
/compass_hmc5883l.c \
495 STM32F3DISCOVERY_SRC
= \
496 $(STM32F3DISCOVERY_COMMON_SRC
) \
497 drivers
/accgyro_adxl345.c \
498 drivers
/accgyro_bma280.c \
499 drivers
/accgyro_mma845x.c \
500 drivers
/accgyro_mpu3050.c \
501 drivers
/accgyro_mpu6050.c \
502 drivers
/accgyro_l3g4200d.c \
503 drivers
/barometer_ms5611.c \
504 drivers
/compass_ak8975.c \
509 $(STM32F3DISCOVERY_SRC
) \
514 $(STM32F30x_COMMON_SRC
) \
515 drivers
/display_ug2864hsweg01.c \
516 drivers
/accgyro_spi_mpu6500.c \
517 drivers
/barometer_ms5611.c \
518 drivers
/compass_ak8975.c \
519 drivers
/compass_hmc5883l.c \
520 drivers
/serial_usb_vcp.c \
526 $(STM32F30x_COMMON_SRC
) \
527 drivers
/display_ug2864hsweg01.c \
528 drivers
/accgyro_mpu6050.c \
529 drivers
/barometer_ms5611.c \
530 drivers
/compass_ak8975.c \
531 drivers
/serial_usb_vcp.c \
536 ALIENWIIF3_SRC
= $(SPARKY_SRC
)
539 $(STM32F30x_COMMON_SRC
) \
540 drivers
/accgyro_mpu6050.c \
541 drivers
/barometer_ms5611.c \
542 drivers
/compass_ak8975.c \
543 drivers
/compass_hmc5883l.c \
544 drivers
/display_ug2864hsweg01.h \
545 drivers
/flash_m25p16.c \
546 drivers
/serial_softserial.c \
547 drivers
/sonar_hcsr04.c \
552 # Search path and source files for the ST stdperiph library
553 VPATH
:= $(VPATH
):$(STDPERIPH_DIR
)/src
555 ###############################################################################
556 # Things that might need changing to use different tools
560 CC
= arm-none-eabi-gcc
561 OBJCOPY
= arm-none-eabi-objcopy
562 SIZE
= arm-none-eabi-size
570 LTO_FLAGS
= $(OPTIMIZE
)
573 LTO_FLAGS
= -flto
-fuse-linker-plugin
$(OPTIMIZE
)
578 CFLAGS
= $(ARCH_FLAGS
) \
580 $(addprefix -D
,$(OPTIONS
)) \
581 $(addprefix -I
,$(INCLUDE_DIRS
)) \
584 -Wall
-Wextra
-Wunsafe-loop-optimizations
-Wdouble-promotion \
585 -ffunction-sections \
588 -DUSE_STDPERIPH_DRIVER \
590 -D
'__FORKNAME__="$(FORKNAME)"' \
591 -D
'__TARGET__="$(TARGET)"' \
592 -D
'__REVISION__="$(REVISION)"' \
596 ASFLAGS
= $(ARCH_FLAGS
) \
597 -x assembler-with-cpp \
598 $(addprefix -I
,$(INCLUDE_DIRS
)) \
610 -Wl
,-gc-sections
,-Map
,$(TARGET_MAP
) \
611 -Wl
,-L
$(LINKER_DIR
) \
614 ###############################################################################
615 # No user-serviceable parts below
616 ###############################################################################
619 # Things we will build
621 ifeq ($(filter $(TARGET
),$(VALID_TARGETS
)),)
622 $(error Target
'$(TARGET)' is not valid
, must be one of
$(VALID_TARGETS
))
625 TARGET_BIN
= $(BIN_DIR
)/$(FORKNAME
)_
$(TARGET
).bin
626 TARGET_HEX
= $(BIN_DIR
)/$(FORKNAME
)_
$(TARGET
).hex
627 TARGET_ELF
= $(OBJECT_DIR
)/$(FORKNAME
)_
$(TARGET
).elf
628 TARGET_OBJS
= $(addsuffix .o
,$(addprefix $(OBJECT_DIR
)/$(TARGET
)/,$(basename $($(TARGET
)_SRC
))))
629 TARGET_DEPS
= $(addsuffix .d
,$(addprefix $(OBJECT_DIR
)/$(TARGET
)/,$(basename $($(TARGET
)_SRC
))))
630 TARGET_MAP
= $(OBJECT_DIR
)/$(FORKNAME
)_
$(TARGET
).map
632 # List of buildable ELF files and their object dependencies.
633 # It would be nice to compute these lists, but that seems to be just beyond make.
635 $(TARGET_HEX
): $(TARGET_ELF
)
636 $(OBJCOPY
) -O ihex
--set-start
0x8000000 $< $@
638 $(TARGET_BIN
): $(TARGET_ELF
)
639 $(OBJCOPY
) -O binary
$< $@
641 $(TARGET_ELF
): $(TARGET_OBJS
)
642 $(CC
) -o
$@
$^
$(LDFLAGS
)
643 $(SIZE
) $(TARGET_ELF
)
646 $(OBJECT_DIR
)/$(TARGET
)/%.o
: %.c
648 @echo
%% $(notdir $<)
649 @
$(CC
) -c
-o
$@
$(CFLAGS
) $<
652 $(OBJECT_DIR
)/$(TARGET
)/%.o
: %.s
654 @echo
%% $(notdir $<)
655 @
$(CC
) -c
-o
$@
$(ASFLAGS
) $<
657 $(OBJECT_DIR
)/$(TARGET
)/%.o
: %.S
659 @echo
%% $(notdir $<)
660 @
$(CC
) -c
-o
$@
$(ASFLAGS
) $<
663 rm -f
$(TARGET_BIN
) $(TARGET_HEX
) $(TARGET_ELF
) $(TARGET_OBJS
) $(TARGET_MAP
)
664 rm -rf
$(OBJECT_DIR
)/$(TARGET
)
665 cd src
/test && $(MAKE
) clean || true
667 flash_
$(TARGET
): $(TARGET_HEX
)
668 stty
-F
$(SERIAL_DEVICE
) raw speed
115200 -crtscts cs8
-parenb
-cstopb
-ixon
669 echo
-n
'R' >$(SERIAL_DEVICE
)
670 stm32flash
-w
$(TARGET_HEX
) -v
-g
0x0 -b
115200 $(SERIAL_DEVICE
)
672 flash
: flash_
$(TARGET
)
674 st-flash_
$(TARGET
): $(TARGET_BIN
)
675 st-flash
--reset write
$< 0x08000000
677 st-flash
: st-flash_
$(TARGET
)
679 binary
: $(TARGET_BIN
)
681 unbrick_
$(TARGET
): $(TARGET_HEX
)
682 stty
-F
$(SERIAL_DEVICE
) raw speed
115200 -crtscts cs8
-parenb
-cstopb
-ixon
683 stm32flash
-w
$(TARGET_HEX
) -v
-g
0x0 -b
115200 $(SERIAL_DEVICE
)
685 unbrick
: unbrick_
$(TARGET
)
689 @echo
"Makefile for the $(FORKNAME) firmware"
692 @echo
" make [TARGET=<target>] [OPTIONS=\"<options>\"]"
694 @echo
"Valid TARGET values are: $(VALID_TARGETS)"
697 ## test : run the cleanflight test suite
699 cd src
/test && $(MAKE
) test || true
701 # rebuild everything when makefile changes
702 $(TARGET_OBJS
) : Makefile
704 # include auto-generated dependencies
705 -include $(TARGET_DEPS
)