mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-04 05:42:49 +08:00
Flash using PX4 bootloader
This commit is contained in:
@@ -154,6 +154,13 @@ upload: $(OBJDIR)/$(TARGET).bin
|
||||
@echo "Using ST-LINK with SWD at $(STLINK_ADDR)"
|
||||
$(Q)st-flash write $^ $(STLINK_ADDR)
|
||||
|
||||
else ifeq ($(FLASH_MODE),PX4_BOOTLOADER)
|
||||
# Program the device and start it.
|
||||
upload: $(OBJDIR)/$(TARGET).bin
|
||||
$(PAPARAZZI_SRC)/sw/tools/px4/px_mkfw.py --prototype $(PX4_PROTOTYPE) --image $(OBJDIR)/$(TARGET).bin > $(OBJDIR)/$(TARGET).px4
|
||||
$(PAPARAZZI_SRC)/sw/tools/px4/print_message.py
|
||||
$(PAPARAZZI_SRC)/sw/tools/px4/px_uploader.py --port $(PX4_BL_PORT) $(OBJDIR)/$(TARGET).px4
|
||||
|
||||
#
|
||||
# no known flash mode
|
||||
else
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# px4fmu_2.4.makefile
|
||||
#
|
||||
# This is for the main MCU (STM32F427) on the pixhawk board
|
||||
# This is for the main MCU (STM32F427) on the PX4 board
|
||||
# See https://pixhawk.org/modules/pixhawk for details
|
||||
#
|
||||
|
||||
@@ -19,10 +19,12 @@ $(TARGET).LDSCRIPT=$(SRC_ARCH)/px4fmu_2.4.ld
|
||||
|
||||
HARD_FLOAT=yes
|
||||
|
||||
# default flash mode is via usb dfu bootloader
|
||||
# possibilities: DFU, SWD
|
||||
FLASH_MODE ?= SWD
|
||||
|
||||
# default flash mode is the PX4 bootloader
|
||||
# possibilities: DFU, SWD, PX4 bootloader
|
||||
FLASH_MODE ?= PX4_BOOTLOADER
|
||||
PX4_PROTOTYPE ?= "${PAPARAZZI_HOME}/sw/tools/px4/px4fmu-v2.prototype"
|
||||
PX4_BL_PORT ?= "/dev/serial/by-id/usb-3D_Robotics*,/dev/serial/by-id/pci-3D_Robotics*"
|
||||
$(TARGET).MAKEFILE = stm32
|
||||
|
||||
#
|
||||
# default LED configuration
|
||||
@@ -40,12 +42,10 @@ SYS_TIME_LED ?= 1
|
||||
MODEM_PORT ?= UART2
|
||||
MODEM_BAUD ?= B57600
|
||||
|
||||
#The GPS serial on px4 is called serial 3, but connected to uart4 on the f4
|
||||
GPS_PORT ?= UART4
|
||||
GPS_BAUD ?= B38400
|
||||
|
||||
RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT ?= UART2
|
||||
|
||||
|
||||
#
|
||||
# default actuator configuration
|
||||
#
|
||||
|
||||
@@ -96,6 +96,13 @@
|
||||
<board name="px4fmu_.*"/>
|
||||
<board name="elle*"/>
|
||||
</boards>
|
||||
</mode>
|
||||
<mode name="Px4 bootloader">
|
||||
<variable name="FLASH_MODE" value="PX4_BOOTLOADER"/>
|
||||
<boards>
|
||||
<board name="px4fmu_.*"/>
|
||||
<board name="px4io_.*"/>
|
||||
</boards>
|
||||
</mode>
|
||||
<mode name="JTAG (OpenOCD)">
|
||||
<variable name="FLASH_MODE" value="JTAG"/>
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<!DOCTYPE module SYSTEM "module.dtd">
|
||||
|
||||
<module name="px4io_flash">
|
||||
<doc>
|
||||
<description>Flashes the px4io f1 through the px4 bootloader.</description>
|
||||
</doc>
|
||||
<header>
|
||||
<file name="px4io_flash.h"/>
|
||||
</header>
|
||||
<init fun="px4ioflash_init()"/>
|
||||
<event fun="px4ioflash_event()"/>
|
||||
<makefile target="ap">
|
||||
<raw>
|
||||
|
||||
</raw>
|
||||
<file name="px4io_flash.c"/>
|
||||
<configure name="PX4IO_UART" default="uart6" case="upper|lower"/>
|
||||
<configure name="PX4IO_BAUD" default="B1500000"/>
|
||||
<define name="USE_$(PX4IO_UART_UPPER)"/>
|
||||
<define name="PX4IO_UART" value="$(PX4IO_UART_LOWER)"/>
|
||||
<define name="$(PX4IO_UART_UPPER)_BAUD" value="$(PX4IO_BAUD)"/>
|
||||
|
||||
<configure name="TELEM2_UART" default="uart3" case="upper|lower"/>
|
||||
<configure name="TELEM2_BAUD" default="B115200"/>
|
||||
<define name="USE_$(TELEM2_UART_UPPER)"/>
|
||||
<define name="TELEM2_UART" value="$(TELEM2_UART_LOWER)"/>
|
||||
<define name="$(TELEM2_UART_UPPER)_BAUD" value="$(TELEM2_BAUD)"/>
|
||||
|
||||
</makefile>
|
||||
</module>
|
||||
|
||||
Reference in New Issue
Block a user