Makefile.f7 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #
  2. # PX4 bootloader build rules for STM32F7 targets.
  3. # Since the STM32F7 is not supported fully in libopencm3 at this time,
  4. # this build is a bit of a hack to use the similar IP blocks of the F469
  5. # for USB by telling libopencm3 it is an STM32F4
  6. ARCH=stm32
  7. OPENOCD ?= openocd
  8. JTAGCONFIG ?= interface/olimex-jtag-tiny.cfg
  9. #JTAGCONFIG ?= interface/jtagkey-tiny.cfg
  10. # 5 seconds / 5000 ms default delay
  11. PX4_BOOTLOADER_DELAY ?= 5000
  12. SRCS = $(COMMON_SRCS) $(addprefix $(ARCH)/,$(ARCH_SRCS)) main_f7.c
  13. LIBS = opencm3_stm32f7 opencm3_stm32f4
  14. FLAGS += -g -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-sp-d16 \
  15. -DTARGET_HW_$(TARGET_HW) \
  16. -T$(LINKER_FILE) \
  17. -L$(LIBOPENCM3)/lib $(addprefix -l, $(LIBS)) \
  18. -DSTM32F7
  19. # libopencm3 doesn't have USB driver in stm32f7 library, tell it to use the one from stm32f4
  20. # for the cdcacm
  21. $(BUILD_DIR_ROOT)/$(TARGET_FILE_NAME)/stm32/cdcacm.o : FLAGS+=-DSTM32F4
  22. #
  23. # General rules for making dependency and object files
  24. # This is where the compiler is called
  25. #
  26. include rules.mk
  27. #upload: all flash flash-bootloader
  28. upload: all flash-bootloader
  29. flash-bootloader:
  30. $(OPENOCD) --search ../px4_bootloader -f $(JTAGCONFIG) -f stm32f4x.cfg -c init -c "reset halt" -c "flash write_image erase $(BINARY) 0x08000000" -c "reset run" -c shutdown