2013-01-17 01:12:15 -04:00
|
|
|
#
|
2013-01-17 03:40:40 -04:00
|
|
|
# Rules and tools for uploading firmware to various PX4 boards.
|
2013-01-17 01:12:15 -04:00
|
|
|
#
|
|
|
|
|
|
|
|
UPLOADER = $(PX4_BASE)/Tools/px_uploader.py
|
|
|
|
|
|
|
|
SYSTYPE := $(shell uname -s)
|
|
|
|
|
|
|
|
#
|
|
|
|
# Serial port defaults.
|
|
|
|
#
|
|
|
|
# XXX The uploader should be smarter than this.
|
|
|
|
#
|
|
|
|
ifeq ($(SYSTYPE),Darwin)
|
2013-09-11 19:30:00 -03:00
|
|
|
SERIAL_PORTS ?= "/dev/tty.usbmodemPX*,/dev/tty.usbmodem*"
|
2013-01-17 01:12:15 -04:00
|
|
|
endif
|
|
|
|
ifeq ($(SYSTYPE),Linux)
|
2013-09-11 19:30:00 -03:00
|
|
|
SERIAL_PORTS ?= "/dev/serial/by-id/usb-3D_Robotics*"
|
2013-01-17 01:12:15 -04:00
|
|
|
endif
|
|
|
|
ifeq ($(SERIAL_PORTS),)
|
2013-06-23 23:39:33 -03:00
|
|
|
SERIAL_PORTS = "COM32,COM31,COM30,COM29,COM28,COM27,COM26,COM25,COM24,COM23,COM22,COM21,COM20,COM19,COM18,COM17,COM16,COM15,COM14,COM13,COM12,COM11,COM10,COM9,COM8,COM7,COM6,COM5,COM4,COM3,COM2,COM1,COM0"
|
2013-01-17 01:12:15 -04:00
|
|
|
endif
|
|
|
|
|
2013-04-26 20:14:32 -03:00
|
|
|
.PHONY: all upload-$(METHOD)-$(BOARD)
|
|
|
|
all: upload-$(METHOD)-$(BOARD)
|
2013-01-17 01:12:15 -04:00
|
|
|
|
2013-06-01 19:11:56 -03:00
|
|
|
upload-serial-px4fmu-v1: $(BUNDLE) $(UPLOADER)
|
2013-04-28 16:47:34 -03:00
|
|
|
$(Q) $(PYTHON) -u $(UPLOADER) --port $(SERIAL_PORTS) $(BUNDLE)
|
|
|
|
|
2013-07-07 21:53:55 -03:00
|
|
|
upload-serial-px4fmu-v2: $(BUNDLE) $(UPLOADER)
|
2013-04-28 16:47:34 -03:00
|
|
|
$(Q) $(PYTHON) -u $(UPLOADER) --port $(SERIAL_PORTS) $(BUNDLE)
|
2013-01-17 01:12:15 -04:00
|
|
|
|
2014-12-18 16:18:33 -04:00
|
|
|
upload-serial-aerocore:
|
|
|
|
openocd -f $(PX4_BASE)/makefiles/gumstix-aerocore.cfg -c 'init; reset halt; flash write_image erase $(PX4_BASE)/../Bootloader/px4aerocore_bl.bin 0x08000000; flash write_image erase $(PX4_BASE)/Build/aerocore_default.build/firmware.bin 0x08004000; reset run; exit'
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-17 01:12:15 -04:00
|
|
|
#
|
|
|
|
# JTAG firmware uploading with OpenOCD
|
|
|
|
#
|
|
|
|
JTAGCONFIG ?= interface/olimex-jtag-tiny.cfg
|
|
|
|
|
|
|
|
upload-jtag-px4fmu: all
|
2013-04-28 16:47:34 -03:00
|
|
|
@$(ECHO) Attempting to flash PX4FMU board via JTAG
|
|
|
|
$(Q) $(OPENOCD) -f $(JTAGCONFIG) -f ../Bootloader/stm32f4x.cfg -c init -c "reset halt" -c "flash write_image erase nuttx/nuttx" -c "flash write_image erase ../Bootloader/px4fmu_bl.elf" -c "reset run" -c shutdown
|
2013-01-17 01:12:15 -04:00
|
|
|
|
|
|
|
upload-jtag-px4io: all
|
2013-04-28 16:47:34 -03:00
|
|
|
@$(ECHO) Attempting to flash PX4IO board via JTAG
|
|
|
|
$(Q) $(OPENOCD) -f $(JTAGCONFIG) -f ../Bootloader/stm32f1x.cfg -c init -c "reset halt" -c "flash write_image erase nuttx/nuttx" -c "flash write_image erase ../Bootloader/px4io_bl.elf" -c "reset run" -c shutdown
|