mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-04 13:55:40 +08:00
Added Black Magic Probe support to the stm32 platform.
Just add BMP_PORT=/dev/ttyACM0 to the ap.upload make call. The script will try to flash the device using GDB and the BMP.
This commit is contained in:
+15
-1
@@ -52,6 +52,7 @@ CP = $(GCC_BIN_PREFIX)-objcopy
|
|||||||
DMP = $(GCC_BIN_PREFIX)-objdump
|
DMP = $(GCC_BIN_PREFIX)-objdump
|
||||||
NM = $(GCC_BIN_PREFIX)-nm
|
NM = $(GCC_BIN_PREFIX)-nm
|
||||||
SIZE = $(GCC_BIN_PREFIX)-size
|
SIZE = $(GCC_BIN_PREFIX)-size
|
||||||
|
GDB = $(GCC_BIN_PREFIX)-gdb
|
||||||
RM = rm
|
RM = rm
|
||||||
|
|
||||||
# If we can't find the toolchain then try picking up the compilers from the path
|
# If we can't find the toolchain then try picking up the compilers from the path
|
||||||
@@ -62,8 +63,10 @@ CP = $(shell which arm-none-eabi-objcopy)
|
|||||||
DMP = $(shell which arm-none-eabi-objdump)
|
DMP = $(shell which arm-none-eabi-objdump)
|
||||||
NM = $(shell which arm-none-eabi-nm)
|
NM = $(shell which arm-none-eabi-nm)
|
||||||
SIZE = $(shell which arm-none-eabi-size)
|
SIZE = $(shell which arm-none-eabi-size)
|
||||||
|
GDB = $(shell which arm-none-eabi-gdb)
|
||||||
RM = rm
|
RM = rm
|
||||||
GCC_LIB_DIR=$(shell dirname `which arm-none-eabi-gcc`)/../arm-none-eabi/lib
|
TOOLCHAIN_DIR=$(shell dirname `which arm-none-eabi-gcc`)
|
||||||
|
GCC_LIB_DIR=$(TOOLCHAIN_DIR)/../arm-none-eabi/lib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Detect if we are using the new libopencm3 or the old libopenstm32
|
# Detect if we are using the new libopencm3 or the old libopenstm32
|
||||||
@@ -250,6 +253,7 @@ ifeq ($(FLASH_MODE),SERIAL)
|
|||||||
upload: $(OBJDIR)/$(TARGET).bin
|
upload: $(OBJDIR)/$(TARGET).bin
|
||||||
$(LOADER) -p /dev/ttyUSB0 -b 115200 -e -w -v $^
|
$(LOADER) -p /dev/ttyUSB0 -b 115200 -e -w -v $^
|
||||||
else ifeq ($(FLASH_MODE),JTAG)
|
else ifeq ($(FLASH_MODE),JTAG)
|
||||||
|
ifeq ($(BMP_PORT),)
|
||||||
upload: $(OBJDIR)/$(TARGET).elf
|
upload: $(OBJDIR)/$(TARGET).elf
|
||||||
@echo "Using OOCD = $(OOCD)"
|
@echo "Using OOCD = $(OOCD)"
|
||||||
@echo " OOCD\t$<"
|
@echo " OOCD\t$<"
|
||||||
@@ -263,6 +267,16 @@ upload: $(OBJDIR)/$(TARGET).elf
|
|||||||
-c reset \
|
-c reset \
|
||||||
-c shutdown
|
-c shutdown
|
||||||
else
|
else
|
||||||
|
upload: $(OBJDIR)/$(TARGET).elf
|
||||||
|
@echo "Using Black Magic Probe"
|
||||||
|
@echo "Using GDB = $(GDB)"
|
||||||
|
@echo " BMP\t$<"
|
||||||
|
$(Q)$(GDB) --batch \
|
||||||
|
-ex 'target extended-remote $(BMP_PORT)' \
|
||||||
|
-x $(TOOLCHAIN_DIR)/arm-none-eabi/share/libopencm3/scripts/black_magic_probe_flash.scr \
|
||||||
|
$<
|
||||||
|
endif
|
||||||
|
else
|
||||||
upload:
|
upload:
|
||||||
@echo unknown flash_mode $(FLASH_MODE)
|
@echo unknown flash_mode $(FLASH_MODE)
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user