From 817ce9327f15160f072afa34d646d6009000ce23 Mon Sep 17 00:00:00 2001 From: zedamota Date: Sat, 12 May 2012 12:57:15 +0100 Subject: [PATCH 1/3] flight - fix pipxtreme bootloader compile --- flight/Bootloaders/PipXtreme/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/flight/Bootloaders/PipXtreme/Makefile b/flight/Bootloaders/PipXtreme/Makefile index 8711ccbd9..e682d00bd 100644 --- a/flight/Bootloaders/PipXtreme/Makefile +++ b/flight/Bootloaders/PipXtreme/Makefile @@ -118,8 +118,6 @@ SRC += $(PIOSCOMMON)/pios_usb_desc_hid_only.c ## PIOS Hardware (Common) SRC += $(PIOSCOMMON)/pios_board_info.c SRC += $(PIOSCOMMON)/pios_com_msg.c -SRC += $(PIOSCOMMON)/pios_bl_helper.c -SRC += $(PIOSCOMMON)/pios_iap.c SRC += $(PIOSCOMMON)/printf-stdarg.c ## Libraries for flight calculations From 44a1663eb9162b3f653339f263601368053a6f55 Mon Sep 17 00:00:00 2001 From: Brian Webb Date: Wed, 16 May 2012 19:02:53 -0700 Subject: [PATCH 2/3] Fixed transparent comm on PipX. --- .../Modules/RadioComBridge/RadioComBridge.c | 9 ++-- flight/PipXtreme/System/inc/pios_config.h | 2 +- .../plugins/config/configpipxtremewidget.cpp | 3 +- make/firmware-defs.mk | 44 +++---------------- 4 files changed, 13 insertions(+), 45 deletions(-) diff --git a/flight/Modules/RadioComBridge/RadioComBridge.c b/flight/Modules/RadioComBridge/RadioComBridge.c index 54108646a..76c3040a5 100644 --- a/flight/Modules/RadioComBridge/RadioComBridge.c +++ b/flight/Modules/RadioComBridge/RadioComBridge.c @@ -278,7 +278,10 @@ static void comUAVTalkTask(void *parameters) if (PIOS_COM_UAVTALK) BufferedReadSetCom(f, PIOS_COM_UAVTALK); else + { vTaskDelay(5); + continue; + } } // Read the next byte @@ -627,7 +630,7 @@ static void transparentCommTask(void * parameters) // Receive data from the com port uint32_t cur_rx_bytes = PIOS_COM_ReceiveBuffer(PIOS_COM_TRANS_COM, p->data + p->header.data_size, - PH_MAX_DATA - p->header.data_size, timeout); + PH_MAX_DATA - p->header.data_size, timeout); // Do we have an data to send? p->header.data_size += cur_rx_bytes; @@ -657,8 +660,8 @@ static void transparentCommTask(void * parameters) // Should we send this packet? if (send_packet) { - // Transmit the packet - PHTransmitPacket(pios_packet_handler, p); + // Queue the packet for transmission. + xQueueSend(data->sendPacketQueue, &p, MAX_PORT_DELAY); // Reset the timeout timeout = MAX_PORT_DELAY; diff --git a/flight/PipXtreme/System/inc/pios_config.h b/flight/PipXtreme/System/inc/pios_config.h index 07a6f879b..39d51ef1d 100755 --- a/flight/PipXtreme/System/inc/pios_config.h +++ b/flight/PipXtreme/System/inc/pios_config.h @@ -59,7 +59,7 @@ #define PIOS_INCLUDE_GPIO #define PIOS_INCLUDE_EXTI #define PIOS_INCLUDE_RTC -//#define PIOS_INCLUDE_WDG +#define PIOS_INCLUDE_WDG #define PIOS_INCLUDE_BL_HELPER #define PIOS_INCLUDE_FLASH_EEPROM diff --git a/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp b/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp index b782eafb3..a5e934c99 100644 --- a/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp @@ -137,7 +137,7 @@ void ConfigPipXtremeWidget::updateStatus(UAVObject *object) { // Restart the disconnection timer. - timeOut->start(5000); + timeOut->start(10000); // Request and update of the setting object if we haven't received it yet. if (!settingsUpdated) @@ -260,7 +260,6 @@ void ConfigPipXtremeWidget::disconnected() void ConfigPipXtremeWidget::pairIDToggled(bool checked, quint8 idx) { - qDebug() << "Toggled"; if(checked) { PipXStatus *pipxStatus = PipXStatus::GetInstance(getObjectManager()); diff --git a/make/firmware-defs.mk b/make/firmware-defs.mk index 087792b45..594765444 100644 --- a/make/firmware-defs.mk +++ b/make/firmware-defs.mk @@ -49,8 +49,6 @@ MSG_OPFIRMWARE := ${quote} OPFW ${quote} MSG_FWINFO := ${quote} FWINFO ${quote} MSG_JTAG_PROGRAM := ${quote} JTAG-PGM ${quote} MSG_JTAG_WIPE := ${quote} JTAG-WIPE ${quote} -MSG_JTAG_RESET := ${quote} JTAG-RST ${quote} -MSG_JTAG_SAFEBOOT := ${quote} JTAG-SAFE ${quote} toprel = $(subst $(realpath $(TOP))/,,$(abspath $(1))) @@ -118,7 +116,7 @@ FORCE: $(1).firmwareinfo.c: $(1) $(TOP)/make/templates/firmwareinfotemplate.c FORCE @echo $(MSG_FWINFO) $$(call toprel, $$@) - $(V1) python $(TOP)/make/scripts/version-info.py \ + python $(TOP)/make/scripts/version-info.py \ --path=$(TOP) \ --template=$(TOP)/make/templates/firmwareinfotemplate.c \ --outfile=$$@ \ @@ -203,8 +201,6 @@ endef # $(1) = Name of binary image to write # $(2) = Base of flash region to write/wipe # $(3) = Size of flash region to write/wipe -# $(4) = OpenOCD JTAG interface configuration file to use -# $(5) = OpenOCD configuration file to use define JTAG_TEMPLATE # --------------------------------------------------------------------------- # Options for OpenOCD flash-programming @@ -217,7 +213,7 @@ OOCD_EXE ?= openocd OOCD_JTAG_SETUP = -d0 # interface and board/target settings (using the OOCD target-library here) OOCD_JTAG_SETUP += -s $(TOP)/flight/Project/OpenOCD -OOCD_JTAG_SETUP += -f $(4) -f $(5) +OOCD_JTAG_SETUP += -f flyswatter.cfg -f stm32f1x.cfg # initialize OOCD_BOARD_RESET = -c init @@ -232,8 +228,8 @@ program: $(1) $(V1) $(OOCD_EXE) \ $$(OOCD_JTAG_SETUP) \ $$(OOCD_BOARD_RESET) \ - -c "flash write_image erase $$< $(2) bin" \ - -c "verify_image $$< $(2) bin" \ + -c "flash write_image erase $(subst c:,,$(1)) $(2) bin" \ + -c "verify_image $(subst c:,,$(1)) $(2) bin" \ -c "reset run" \ -c "shutdown" @@ -246,34 +242,4 @@ wipe: -c "flash erase_address pad $(2) $(3)" \ -c "reset run" \ -c "shutdown" - -reset: - @echo $(MSG_JTAG_RESET) resetting device - $(V1) $(OOCD_EXE) \ - $$(OOCD_JTAG_SETUP) \ - $$(OOCD_BOARD_RESET) \ - -c "reset run" \ - -c "shutdown" - -# Enable PWR and BKP clocks (set RCC_APB1ENR[PWREN|BKPEN]) -OOCD_WRITE_BKPDR3 = -c "mww 0x4002101C 0x18000000" -# Enable writes to BKP registers (set PWR_CR[DBP] via bit op alias address) -# -# Direct register access would be: -# mww 0x40007000 0x00000100 -# -# Direct _bit_ access is: -# Bit 8 in 0x40007000 = 0x42000000 + 0x7000 * 32 + 8 * 4 = 420E0020 -OOCD_WRITE_BKPDR3 += -c "mww 0x420E0020 0x00000001" -# Set BR3 to max value to force a safe boot -OOCD_WRITE_BKPDR3 += -c "mwh 0x40006C0C 0xFFFF" -safeboot: - @echo $(MSG_JTAG_SAFEBOOT) forcing boot into safe mode - $(V1) $(OOCD_EXE) \ - $$(OOCD_JTAG_SETUP) \ - $$(OOCD_BOARD_RESET) \ - $$(OOCD_WRITE_BKPDR3) \ - -c "reset run" \ - -c "shutdown" -endef - +endef \ No newline at end of file From 14bbd09c8775de794a51c4735208bce0a33bda69 Mon Sep 17 00:00:00 2001 From: Brian Webb Date: Wed, 16 May 2012 19:03:47 -0700 Subject: [PATCH 3/3] Reverted inadvertent checkin of firmware-defs.mk --- make/firmware-defs.mk | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/make/firmware-defs.mk b/make/firmware-defs.mk index 594765444..b22a66639 100644 --- a/make/firmware-defs.mk +++ b/make/firmware-defs.mk @@ -116,7 +116,7 @@ FORCE: $(1).firmwareinfo.c: $(1) $(TOP)/make/templates/firmwareinfotemplate.c FORCE @echo $(MSG_FWINFO) $$(call toprel, $$@) - python $(TOP)/make/scripts/version-info.py \ + $(V1) python $(TOP)/make/scripts/version-info.py \ --path=$(TOP) \ --template=$(TOP)/make/templates/firmwareinfotemplate.c \ --outfile=$$@ \ @@ -201,6 +201,7 @@ endef # $(1) = Name of binary image to write # $(2) = Base of flash region to write/wipe # $(3) = Size of flash region to write/wipe +# $(4) = OpenOCD configuration file to use define JTAG_TEMPLATE # --------------------------------------------------------------------------- # Options for OpenOCD flash-programming @@ -213,7 +214,7 @@ OOCD_EXE ?= openocd OOCD_JTAG_SETUP = -d0 # interface and board/target settings (using the OOCD target-library here) OOCD_JTAG_SETUP += -s $(TOP)/flight/Project/OpenOCD -OOCD_JTAG_SETUP += -f flyswatter.cfg -f stm32f1x.cfg +OOCD_JTAG_SETUP += -f foss-jtag.revb.cfg -f $(4) # initialize OOCD_BOARD_RESET = -c init @@ -228,8 +229,8 @@ program: $(1) $(V1) $(OOCD_EXE) \ $$(OOCD_JTAG_SETUP) \ $$(OOCD_BOARD_RESET) \ - -c "flash write_image erase $(subst c:,,$(1)) $(2) bin" \ - -c "verify_image $(subst c:,,$(1)) $(2) bin" \ + -c "flash write_image erase $$< $(2) bin" \ + -c "verify_image $$< $(2) bin" \ -c "reset run" \ -c "shutdown" @@ -242,4 +243,5 @@ wipe: -c "flash erase_address pad $(2) $(3)" \ -c "reset run" \ -c "shutdown" -endef \ No newline at end of file +endef +