From ec84fc40587060d3bb0a7069d87ca79c30512fed Mon Sep 17 00:00:00 2001 From: James Cotton Date: Sun, 13 Nov 2011 17:13:42 -0600 Subject: [PATCH] Get the Revolution bootloader working --- flight/Bootloaders/INS/pios_board.c | 151 ------------------ .../Bootloaders/{INS => Revolution}/Makefile | 86 +++------- .../{INS => Revolution}/ahrs_slave_test.c | 0 .../{INS => Revolution}/ahrs_spi_program.c | 0 .../ahrs_spi_program_master.c | 0 .../ahrs_spi_program_slave.c | 0 .../Bootloaders/{INS => Revolution}/bl_fsm.c | 0 .../{INS => Revolution}/inc/ahrs_bl.h | 0 .../inc/ahrs_spi_program.h | 0 .../inc/ahrs_spi_program_master.h | 0 .../inc/ahrs_spi_program_slave.h | 0 .../{INS => Revolution}/inc/bl_fsm.h | 0 .../{INS => Revolution}/inc/ins_bl.h | 0 .../{INS => Revolution}/inc/pios_config.h | 3 +- flight/Bootloaders/{INS => Revolution}/main.c | 2 +- flight/Bootloaders/Revolution/pios_board.c | 37 +++++ flight/PiOS/STM32F4xx/library.mk | 2 +- flight/PiOS/pios.h | 2 - .../OpenPilotOSX.xcodeproj/project.pbxproj | 93 ++++++----- flight/Project/gdb/revolution | 4 +- make/boards/revolution/board-info.mk | 2 +- 21 files changed, 110 insertions(+), 272 deletions(-) delete mode 100644 flight/Bootloaders/INS/pios_board.c rename flight/Bootloaders/{INS => Revolution}/Makefile (81%) rename flight/Bootloaders/{INS => Revolution}/ahrs_slave_test.c (100%) rename flight/Bootloaders/{INS => Revolution}/ahrs_spi_program.c (100%) rename flight/Bootloaders/{INS => Revolution}/ahrs_spi_program_master.c (100%) rename flight/Bootloaders/{INS => Revolution}/ahrs_spi_program_slave.c (100%) rename flight/Bootloaders/{INS => Revolution}/bl_fsm.c (100%) rename flight/Bootloaders/{INS => Revolution}/inc/ahrs_bl.h (100%) rename flight/Bootloaders/{INS => Revolution}/inc/ahrs_spi_program.h (100%) rename flight/Bootloaders/{INS => Revolution}/inc/ahrs_spi_program_master.h (100%) rename flight/Bootloaders/{INS => Revolution}/inc/ahrs_spi_program_slave.h (100%) rename flight/Bootloaders/{INS => Revolution}/inc/bl_fsm.h (100%) rename flight/Bootloaders/{INS => Revolution}/inc/ins_bl.h (100%) rename flight/Bootloaders/{INS => Revolution}/inc/pios_config.h (94%) rename flight/Bootloaders/{INS => Revolution}/main.c (96%) create mode 100644 flight/Bootloaders/Revolution/pios_board.c diff --git a/flight/Bootloaders/INS/pios_board.c b/flight/Bootloaders/INS/pios_board.c deleted file mode 100644 index 9d0b40647..000000000 --- a/flight/Bootloaders/INS/pios_board.c +++ /dev/null @@ -1,151 +0,0 @@ -/** - ****************************************************************************** - * - * @file pios_board.c - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @brief Defines board specific static initializers for hardware for the AHRS board. - * @see The GNU Public License (GPL) Version 3 - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include - -#if defined(PIOS_INCLUDE_SPI) - -#include - -/* OP Interface - * - * NOTE: Leave this declared as const data so that it ends up in the - * .rodata section (ie. Flash) rather than in the .bss section (RAM). - */ -void PIOS_SPI_op_irq_handler(void); -void DMA1_Channel5_IRQHandler() __attribute__ ((alias ("PIOS_SPI_op_irq_handler"))); -void DMA1_Channel4_IRQHandler() __attribute__ ((alias ("PIOS_SPI_op_irq_handler"))); -static const struct pios_spi_cfg - pios_spi_op_cfg = { - .regs = SPI2, - .init = { - .SPI_Mode = SPI_Mode_Slave, - .SPI_Direction = SPI_Direction_2Lines_FullDuplex, - .SPI_DataSize = SPI_DataSize_8b, - .SPI_NSS = SPI_NSS_Hard, - .SPI_FirstBit = SPI_FirstBit_MSB, - .SPI_CRCPolynomial = 7, - .SPI_CPOL = SPI_CPOL_High, - .SPI_CPHA = SPI_CPHA_2Edge, - }, - .use_crc = TRUE, - .dma = { - .ahb_clk = RCC_AHBPeriph_DMA1, - - .irq = { - .flags = (DMA1_FLAG_TC4 | DMA1_FLAG_TE4 | DMA1_FLAG_HT4 | DMA1_FLAG_GL4), - .init = { - .NVIC_IRQChannel = DMA1_Channel4_IRQn, - .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGH, - .NVIC_IRQChannelSubPriority = 0, - .NVIC_IRQChannelCmd = ENABLE, - }, - }, - - .rx = { - .channel = DMA1_Channel4, - .init = { - .DMA_PeripheralBaseAddr = (uint32_t)&(SPI2->DR), - .DMA_DIR = DMA_DIR_PeripheralSRC, - .DMA_PeripheralInc = DMA_PeripheralInc_Disable, - .DMA_MemoryInc = DMA_MemoryInc_Enable, - .DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte, - .DMA_MemoryDataSize = DMA_MemoryDataSize_Byte, - .DMA_Mode = DMA_Mode_Normal, - .DMA_Priority = DMA_Priority_Medium, - .DMA_M2M = DMA_M2M_Disable, - }, - }, - .tx = { - .channel = DMA1_Channel5, - .init = { - .DMA_PeripheralBaseAddr = (uint32_t)&(SPI2->DR), - .DMA_DIR = DMA_DIR_PeripheralDST, - .DMA_PeripheralInc = DMA_PeripheralInc_Disable, - .DMA_MemoryInc = DMA_MemoryInc_Enable, - .DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte, - .DMA_MemoryDataSize = DMA_MemoryDataSize_Byte, - .DMA_Mode = DMA_Mode_Normal, - .DMA_Priority = DMA_Priority_Medium, - .DMA_M2M = DMA_M2M_Disable, - }, - }, - }, .ssel = { - .gpio = GPIOB, - .init = { - .GPIO_Pin = GPIO_Pin_12, - .GPIO_Speed = GPIO_Speed_50MHz, - .GPIO_Mode = GPIO_Mode_IN_FLOATING, - }, - }, .sclk = { - .gpio = GPIOB, - .init = { - .GPIO_Pin = GPIO_Pin_13, - .GPIO_Speed = GPIO_Speed_50MHz, - .GPIO_Mode = GPIO_Mode_IN_FLOATING, - }, - }, .miso = { - .gpio = GPIOB, - .init = { - .GPIO_Pin = GPIO_Pin_14, - .GPIO_Speed = GPIO_Speed_50MHz, - .GPIO_Mode = GPIO_Mode_AF_PP, - }, - }, .mosi = { - .gpio = GPIOB, - .init = { - .GPIO_Pin = GPIO_Pin_15, - .GPIO_Speed = GPIO_Speed_50MHz, - .GPIO_Mode = GPIO_Mode_IN_FLOATING, - }, - }, }; - -uint32_t pios_spi_op_id; -void PIOS_SPI_op_irq_handler(void) { - /* Call into the generic code to handle the IRQ for this specific device */ - PIOS_SPI_IRQ_Handler(pios_spi_op_id); -} - -#endif /* PIOS_INCLUDE_SPI */ - -#include "bl_fsm.h" /* lfsm_* */ - -static bool board_init_complete = false; -void PIOS_Board_Init() { - if (board_init_complete) { - return; - } - -#if defined(PIOS_INCLUDE_SPI) - /* Set up the SPI interface to the OP board */ - if (PIOS_SPI_Init(&pios_spi_op_id, &pios_spi_op_cfg)) { - PIOS_DEBUG_Assert(0); - } - lfsm_attach(pios_spi_op_id); - lfsm_init(); -#endif - - board_init_complete = true; -} diff --git a/flight/Bootloaders/INS/Makefile b/flight/Bootloaders/Revolution/Makefile similarity index 81% rename from flight/Bootloaders/INS/Makefile rename to flight/Bootloaders/Revolution/Makefile index 46ec995ad..46a202fb6 100644 --- a/flight/Bootloaders/INS/Makefile +++ b/flight/Bootloaders/Revolution/Makefile @@ -49,44 +49,36 @@ endif FLASH_TOOL = OPENOCD # Paths -INS_BL = ./ -INS_BLINC = $(INS_BL)/inc +REVO_BL = ./ +REVO_BLINC = $(REVO_BL)/inc PIOS = ../../PiOS PIOSINC = $(PIOS)/inc -FLIGHTLIB = ../Libraries -FLIGHTLIBINC = ../Libraries/inc -PIOSSTM32FXX = $(PIOS)/STM32F2xx +FLIGHTLIB = ../../Libraries +FLIGHTLIBINC = ../../Libraries/inc +PIOSSTM32F4XX = $(PIOS)/STM32F4xx PIOSCOMMON = $(PIOS)/Common PIOSBOARDS = $(PIOS)/Boards -APPLIBDIR = $(PIOSSTM32FXX)/Libraries +PIOSCOMMONLIB = $(PIOSCOMMON)/Libraries +APPLIBDIR = $(PIOSSTM32F4XX)/Libraries STMLIBDIR = $(APPLIBDIR) -STMSPDDIR = $(STMLIBDIR)/STM32F2xx_StdPeriph_Driver +STMSPDDIR = $(STMLIBDIR)/STM32F4xx_StdPeriph_Driver STMSPDSRCDIR = $(STMSPDDIR)/src STMSPDINCDIR = $(STMSPDDIR)/inc -CMSISDIR = $(STMLIBDIR)/CMSIS/Core/CM3 - + # List C source files here. (C dependencies are automatically generated.) # use file-extension c for "c-only"-files ## BOOTLOADER: -SRC = main.c +SRC += main.c SRC += pios_board.c SRC += bl_fsm.c -#SRC += insgps.c -#SRC += $(FLIGHTLIB)/CoordinateConversions.c -## PIOS Hardware (STM32F2xx) -SRC += $(PIOSSTM32FXX)/pios_sys.c -SRC += $(PIOSSTM32FXX)/pios_led.c -SRC += $(PIOSSTM32FXX)/pios_delay.c -SRC += $(PIOSSTM32FXX)/pios_usart.c -SRC += $(PIOSSTM32FXX)/pios_irq.c -#SRC += $(PIOSSTM32FXX)/pios_i2c.c -#SRC += $(PIOSSTM32FXX)/pios_gpio.c -SRC += $(PIOSSTM32FXX)/pios_spi.c -SRC += $(PIOSSTM32FXX)/pios_iap.c -#SRC += $(PIOSSTM32FXX)/pios_debug.c +## PIOS Hardware (STM32F4xx) +include $(PIOS)/STM32F4xx/library.mk + +## Library files +SRC += $(FLIGHTLIB)/fifo_buffer.c ## PIOS Hardware (Common) #SRC += $(PIOSCOMMON)/pios_com.c @@ -96,28 +88,6 @@ SRC += $(PIOSCOMMON)/pios_opahrs_proto.c SRC += $(PIOSCOMMON)/printf-stdarg.c SRC += $(PIOSCOMMON)/pios_bl_helper.c -## CMSIS for STM32 -SRC += $(CMSISDIR)/core_cm3.c -SRC += $(CMSISDIR)/system_stm32f4xx.c - -## Used parts of the STM-Library -SRC += $(STMSPDSRCDIR)/stm32f2xx_adc.c -# SRC += $(STMSPDSRCDIR)/stm32f2xx_bkp.c -SRC += $(STMSPDSRCDIR)/stm32f2xx_crc.c -SRC += $(STMSPDSRCDIR)/stm32f2xx_dac.c -SRC += $(STMSPDSRCDIR)/stm32f2xx_dma.c -SRC += $(STMSPDSRCDIR)/stm32f2xx_exti.c -SRC += $(STMSPDSRCDIR)/stm32f2xx_flash.c -SRC += $(STMSPDSRCDIR)/stm32f2xx_gpio.c -SRC += $(STMSPDSRCDIR)/stm32f2xx_i2c.c -SRC += $(STMSPDSRCDIR)/stm32f2xx_pwr.c -SRC += $(STMSPDSRCDIR)/stm32f2xx_rcc.c -SRC += $(STMSPDSRCDIR)/stm32f2xx_rtc.c -SRC += $(STMSPDSRCDIR)/stm32f2xx_spi.c -SRC += $(STMSPDSRCDIR)/stm32f2xx_tim.c -SRC += $(STMSPDSRCDIR)/stm32f2xx_usart.c -SRC += $(STMSPDSRCDIR)/misc.c - # List C source files here which must be compiled in ARM-Mode (no -mthumb). # use file-extension c for "c-only"-files ## just for testing, timer.c could be compiled in thumb-mode too @@ -132,29 +102,17 @@ CPPSRC = #CPPSRCARM = $(TARGET).cpp CPPSRCARM = -# List Assembler source files here. -# Make them always end in a capital .S. Files ending in a lowercase .s -# will not be considered source files but generated files (assembler -# output from the compiler), and will be deleted upon "make clean"! -# Even though the DOS/Win* filesystem matches both .s and .S the same, -# it will preserve the spelling of the filenames, and gcc itself does -# care about how the name is spelled on its command-line. -ASRC = $(PIOSSTM32FXX)/startup_stm32f2xx.S - -# List Assembler source files here which must be assembled in ARM-Mode.. -ASRCARM = - # List any extra directories to look for include files here. # Each directory must be seperated by a space. EXTRAINCDIRS += $(PIOS) EXTRAINCDIRS += $(PIOSINC) EXTRAINCDIRS += $(FLIGHTLIBINC) -EXTRAINCDIRS += $(PIOSSTM32FXX) +EXTRAINCDIRS += $(PIOSSTM34FXX) EXTRAINCDIRS += $(PIOSCOMMON) EXTRAINCDIRS += $(PIOSBOARDS) EXTRAINCDIRS += $(STMSPDINCDIR) EXTRAINCDIRS += $(CMSISDIR) -EXTRAINCDIRS += $(INS_BLINC) +EXTRAINCDIRS += $(REVO_BLINC) # List any extra directories to look for library files here. # Also add directories where the linker should search for @@ -239,8 +197,7 @@ endif # This is not the best place for these. Really should abstract out # to the board file or something -CFLAGS += -DHSE_VALUE=$(OSCILLATOR_FREQ) -CFLAGS += -DSTM32F2XX +CFLAGS += -DSTM32F4XX CFLAGS += -DMEM_SIZE=1024000000 CFLAGS += -g$(DEBUGF) @@ -293,9 +250,8 @@ LDFLAGS += $(patsubst %,-l%,$(EXTRA_LIBS)) LDFLAGS += $(MATH_LIB) LDFLAGS += -lc -lgcc -# Set linker-script name depending on selected submodel name -LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld -LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_BL_sections.ld +#Linker scripts +LDFLAGS += $(addprefix -T,$(LINKER_SCRIPTS_BL)) # Define programs and commands. REMOVE = $(REMOVE_CMD) -f @@ -362,7 +318,7 @@ $(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin $(eval $(call OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION))) # Add jtag targets (program and wipe) -$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(FW_BANK_BASE),$(FW_BANK_SIZE),$(OPENOCD_CONFIG))) +$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BL_BANK_BASE),$(BL_BANK_SIZE),$(OPENOCD_CONFIG))) .PHONY: elf lss sym hex bin bino elf: $(OUTDIR)/$(TARGET).elf diff --git a/flight/Bootloaders/INS/ahrs_slave_test.c b/flight/Bootloaders/Revolution/ahrs_slave_test.c similarity index 100% rename from flight/Bootloaders/INS/ahrs_slave_test.c rename to flight/Bootloaders/Revolution/ahrs_slave_test.c diff --git a/flight/Bootloaders/INS/ahrs_spi_program.c b/flight/Bootloaders/Revolution/ahrs_spi_program.c similarity index 100% rename from flight/Bootloaders/INS/ahrs_spi_program.c rename to flight/Bootloaders/Revolution/ahrs_spi_program.c diff --git a/flight/Bootloaders/INS/ahrs_spi_program_master.c b/flight/Bootloaders/Revolution/ahrs_spi_program_master.c similarity index 100% rename from flight/Bootloaders/INS/ahrs_spi_program_master.c rename to flight/Bootloaders/Revolution/ahrs_spi_program_master.c diff --git a/flight/Bootloaders/INS/ahrs_spi_program_slave.c b/flight/Bootloaders/Revolution/ahrs_spi_program_slave.c similarity index 100% rename from flight/Bootloaders/INS/ahrs_spi_program_slave.c rename to flight/Bootloaders/Revolution/ahrs_spi_program_slave.c diff --git a/flight/Bootloaders/INS/bl_fsm.c b/flight/Bootloaders/Revolution/bl_fsm.c similarity index 100% rename from flight/Bootloaders/INS/bl_fsm.c rename to flight/Bootloaders/Revolution/bl_fsm.c diff --git a/flight/Bootloaders/INS/inc/ahrs_bl.h b/flight/Bootloaders/Revolution/inc/ahrs_bl.h similarity index 100% rename from flight/Bootloaders/INS/inc/ahrs_bl.h rename to flight/Bootloaders/Revolution/inc/ahrs_bl.h diff --git a/flight/Bootloaders/INS/inc/ahrs_spi_program.h b/flight/Bootloaders/Revolution/inc/ahrs_spi_program.h similarity index 100% rename from flight/Bootloaders/INS/inc/ahrs_spi_program.h rename to flight/Bootloaders/Revolution/inc/ahrs_spi_program.h diff --git a/flight/Bootloaders/INS/inc/ahrs_spi_program_master.h b/flight/Bootloaders/Revolution/inc/ahrs_spi_program_master.h similarity index 100% rename from flight/Bootloaders/INS/inc/ahrs_spi_program_master.h rename to flight/Bootloaders/Revolution/inc/ahrs_spi_program_master.h diff --git a/flight/Bootloaders/INS/inc/ahrs_spi_program_slave.h b/flight/Bootloaders/Revolution/inc/ahrs_spi_program_slave.h similarity index 100% rename from flight/Bootloaders/INS/inc/ahrs_spi_program_slave.h rename to flight/Bootloaders/Revolution/inc/ahrs_spi_program_slave.h diff --git a/flight/Bootloaders/INS/inc/bl_fsm.h b/flight/Bootloaders/Revolution/inc/bl_fsm.h similarity index 100% rename from flight/Bootloaders/INS/inc/bl_fsm.h rename to flight/Bootloaders/Revolution/inc/bl_fsm.h diff --git a/flight/Bootloaders/INS/inc/ins_bl.h b/flight/Bootloaders/Revolution/inc/ins_bl.h similarity index 100% rename from flight/Bootloaders/INS/inc/ins_bl.h rename to flight/Bootloaders/Revolution/inc/ins_bl.h diff --git a/flight/Bootloaders/INS/inc/pios_config.h b/flight/Bootloaders/Revolution/inc/pios_config.h similarity index 94% rename from flight/Bootloaders/INS/inc/pios_config.h rename to flight/Bootloaders/Revolution/inc/pios_config.h index 3d24f5399..578a01445 100644 --- a/flight/Bootloaders/INS/inc/pios_config.h +++ b/flight/Bootloaders/Revolution/inc/pios_config.h @@ -31,10 +31,9 @@ #define PIOS_INCLUDE_DELAY #define PIOS_INCLUDE_IRQ #define PIOS_INCLUDE_LED -//#define PIOS_INCLUDE_SPI +#define PIOS_INCLUDE_SPI #define PIOS_INCLUDE_SYS //#define PIOS_INCLUDE_BL_HELPER //#define PIOS_INCLUDE_BL_HELPER_WRITE_SUPPORT -#define PIOS_INCLUDE_GPIO #endif /* PIOS_CONFIG_H */ diff --git a/flight/Bootloaders/INS/main.c b/flight/Bootloaders/Revolution/main.c similarity index 96% rename from flight/Bootloaders/INS/main.c rename to flight/Bootloaders/Revolution/main.c index 3cab01ab2..a399ba1cf 100644 --- a/flight/Bootloaders/INS/main.c +++ b/flight/Bootloaders/Revolution/main.c @@ -36,7 +36,7 @@ #include #include "pios_opahrs_proto.h" #include "bl_fsm.h" /* lfsm_state */ -#include "stm32f2xx_flash.h" +//#include "stm32f2xx_flash.h" extern void PIOS_Board_Init(void); diff --git a/flight/Bootloaders/Revolution/pios_board.c b/flight/Bootloaders/Revolution/pios_board.c new file mode 100644 index 000000000..0ad3540ca --- /dev/null +++ b/flight/Bootloaders/Revolution/pios_board.c @@ -0,0 +1,37 @@ +/** + ****************************************************************************** + * + * @file pios_board.c + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. + * @brief Defines board specific static initializers for hardware for the AHRS board. + * @see The GNU Public License (GPL) Version 3 + * + *****************************************************************************/ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "bl_fsm.h" /* lfsm_* */ + +static bool board_init_complete = false; +void PIOS_Board_Init() { + if (board_init_complete) { + return; + } + + board_init_complete = true; +} diff --git a/flight/PiOS/STM32F4xx/library.mk b/flight/PiOS/STM32F4xx/library.mk index eb46f0a85..2820b6ddc 100644 --- a/flight/PiOS/STM32F4xx/library.mk +++ b/flight/PiOS/STM32F4xx/library.mk @@ -13,7 +13,7 @@ PIOS_DEVLIB := $(dir $(lastword $(MAKEFILE_LIST))) LINKER_SCRIPTS_APP = $(PIOS_DEVLIB)/link_STM32F4xx_OP_memory.ld \ $(PIOS_DEVLIB)/link_STM32F4xx_sections.ld -LINKER_SCRIPTS_BL = $(PIOS_DEVLIB)/link_STM32F4xx_OP_memory.ld \ +LINKER_SCRIPTS_BL = $(PIOS_DEVLIB)/link_STM32F4xx_BL_memory.ld \ $(PIOS_DEVLIB)/link_STM32F4xx_sections.ld # diff --git a/flight/PiOS/pios.h b/flight/PiOS/pios.h index 8c8a97e5a..e1b2eb277 100644 --- a/flight/PiOS/pios.h +++ b/flight/PiOS/pios.h @@ -123,9 +123,7 @@ #include #endif -#if defined(PIOS_INCLUDE_BMA180) #include -#endif #if defined(PIOS_INCLUDE_FLASH) #include diff --git a/flight/Project/OpenPilotOSX/OpenPilotOSX.xcodeproj/project.pbxproj b/flight/Project/OpenPilotOSX/OpenPilotOSX.xcodeproj/project.pbxproj index 941658783..2c1fdfdf9 100644 --- a/flight/Project/OpenPilotOSX/OpenPilotOSX.xcodeproj/project.pbxproj +++ b/flight/Project/OpenPilotOSX/OpenPilotOSX.xcodeproj/project.pbxproj @@ -210,21 +210,6 @@ 6560A38D13EE26B700105DA5 /* vectors_stm32f2xx.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = vectors_stm32f2xx.S; sourceTree = ""; }; 6560A39B13EE270C00105DA5 /* startup_stm32f10x_HD_OP.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = startup_stm32f10x_HD_OP.S; sourceTree = ""; }; 6560A39C13EE270C00105DA5 /* startup_stm32f10x_MD_CC.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = startup_stm32f10x_MD_CC.S; sourceTree = ""; }; - 6560A3A013EE2E8B00105DA5 /* ahrs_slave_test.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ahrs_slave_test.c; path = INS/ahrs_slave_test.c; sourceTree = ""; }; - 6560A3A113EE2E8B00105DA5 /* ahrs_spi_program_master.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ahrs_spi_program_master.c; path = INS/ahrs_spi_program_master.c; sourceTree = ""; }; - 6560A3A213EE2E8B00105DA5 /* ahrs_spi_program_slave.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ahrs_spi_program_slave.c; path = INS/ahrs_spi_program_slave.c; sourceTree = ""; }; - 6560A3A313EE2E8B00105DA5 /* ahrs_spi_program.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ahrs_spi_program.c; path = INS/ahrs_spi_program.c; sourceTree = ""; }; - 6560A3A413EE2E8B00105DA5 /* bl_fsm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bl_fsm.c; path = INS/bl_fsm.c; sourceTree = ""; }; - 6560A3A613EE2E8B00105DA5 /* ahrs_bl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ahrs_bl.h; sourceTree = ""; }; - 6560A3A713EE2E8B00105DA5 /* ahrs_spi_program.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ahrs_spi_program.h; sourceTree = ""; }; - 6560A3A813EE2E8B00105DA5 /* ahrs_spi_program_master.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ahrs_spi_program_master.h; sourceTree = ""; }; - 6560A3A913EE2E8B00105DA5 /* ahrs_spi_program_slave.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ahrs_spi_program_slave.h; sourceTree = ""; }; - 6560A3AA13EE2E8B00105DA5 /* bl_fsm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bl_fsm.h; sourceTree = ""; }; - 6560A3AB13EE2E8B00105DA5 /* ins_bl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ins_bl.h; sourceTree = ""; }; - 6560A3AC13EE2E8B00105DA5 /* pios_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_config.h; sourceTree = ""; }; - 6560A3AD13EE2E8B00105DA5 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = main.c; path = INS/main.c; sourceTree = ""; }; - 6560A3AE13EE2E8B00105DA5 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; name = Makefile; path = INS/Makefile; sourceTree = ""; }; - 6560A3AF13EE2E8B00105DA5 /* pios_board.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pios_board.c; path = INS/pios_board.c; sourceTree = ""; }; 6560A3B313EE2FCB00105DA5 /* ahrs_timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ahrs_timer.h; sourceTree = ""; }; 6560A3B413EE2FCB00105DA5 /* ins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ins.h; sourceTree = ""; }; 6560A3B513EE2FCB00105DA5 /* ins_fsm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ins_fsm.h; sourceTree = ""; }; @@ -3461,6 +3446,21 @@ 65F93D0612EE09290047DB36 /* transparent_comms.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = transparent_comms.c; sourceTree = ""; }; 65F93D0712EE09290047DB36 /* uavtalk_comms.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = uavtalk_comms.c; sourceTree = ""; }; 65F93D0812EE09290047DB36 /* watchdog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = watchdog.c; sourceTree = ""; }; + 65FA9B61147078450019A260 /* ahrs_slave_test.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ahrs_slave_test.c; sourceTree = ""; }; + 65FA9B62147078450019A260 /* ahrs_spi_program.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ahrs_spi_program.c; sourceTree = ""; }; + 65FA9B63147078450019A260 /* ahrs_spi_program_master.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ahrs_spi_program_master.c; sourceTree = ""; }; + 65FA9B64147078450019A260 /* ahrs_spi_program_slave.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ahrs_spi_program_slave.c; sourceTree = ""; }; + 65FA9B65147078450019A260 /* bl_fsm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bl_fsm.c; sourceTree = ""; }; + 65FA9B67147078450019A260 /* ahrs_bl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ahrs_bl.h; sourceTree = ""; }; + 65FA9B68147078450019A260 /* ahrs_spi_program.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ahrs_spi_program.h; sourceTree = ""; }; + 65FA9B69147078450019A260 /* ahrs_spi_program_master.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ahrs_spi_program_master.h; sourceTree = ""; }; + 65FA9B6A147078450019A260 /* ahrs_spi_program_slave.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ahrs_spi_program_slave.h; sourceTree = ""; }; + 65FA9B6B147078450019A260 /* bl_fsm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bl_fsm.h; sourceTree = ""; }; + 65FA9B6C147078450019A260 /* ins_bl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ins_bl.h; sourceTree = ""; }; + 65FA9B6D147078450019A260 /* pios_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_config.h; sourceTree = ""; }; + 65FA9B6E147078450019A260 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = ""; }; + 65FA9B6F147078450019A260 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + 65FA9B70147078450019A260 /* pios_board.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pios_board.c; sourceTree = ""; }; 65FAA03F133B669400F6F5CD /* GTOP_BIN.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = GTOP_BIN.c; sourceTree = ""; }; 65FBE14412E7C98100176B5A /* pios_servo_priv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pios_servo_priv.h; sourceTree = ""; }; 65FC66AA123F30F100B04F74 /* ahrs_timer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ahrs_timer.c; path = ../../AHRS/ahrs_timer.c; sourceTree = SOURCE_ROOT; }; @@ -4158,37 +4158,6 @@ path = src; sourceTree = ""; }; - 6560A39F13EE2E6E00105DA5 /* INS */ = { - isa = PBXGroup; - children = ( - 6560A3A013EE2E8B00105DA5 /* ahrs_slave_test.c */, - 6560A3A113EE2E8B00105DA5 /* ahrs_spi_program_master.c */, - 6560A3A213EE2E8B00105DA5 /* ahrs_spi_program_slave.c */, - 6560A3A313EE2E8B00105DA5 /* ahrs_spi_program.c */, - 6560A3A413EE2E8B00105DA5 /* bl_fsm.c */, - 6560A3A513EE2E8B00105DA5 /* inc */, - 6560A3AD13EE2E8B00105DA5 /* main.c */, - 6560A3AE13EE2E8B00105DA5 /* Makefile */, - 6560A3AF13EE2E8B00105DA5 /* pios_board.c */, - ); - name = INS; - sourceTree = ""; - }; - 6560A3A513EE2E8B00105DA5 /* inc */ = { - isa = PBXGroup; - children = ( - 6560A3A613EE2E8B00105DA5 /* ahrs_bl.h */, - 6560A3A713EE2E8B00105DA5 /* ahrs_spi_program.h */, - 6560A3A813EE2E8B00105DA5 /* ahrs_spi_program_master.h */, - 6560A3A913EE2E8B00105DA5 /* ahrs_spi_program_slave.h */, - 6560A3AA13EE2E8B00105DA5 /* bl_fsm.h */, - 6560A3AB13EE2E8B00105DA5 /* ins_bl.h */, - 6560A3AC13EE2E8B00105DA5 /* pios_config.h */, - ); - name = inc; - path = INS/inc; - sourceTree = ""; - }; 6560A3B013EE2FCB00105DA5 /* INS */ = { isa = PBXGroup; children = ( @@ -9612,15 +9581,45 @@ path = inc; sourceTree = ""; }; + 65FA9B60147078450019A260 /* Revolution */ = { + isa = PBXGroup; + children = ( + 65FA9B61147078450019A260 /* ahrs_slave_test.c */, + 65FA9B62147078450019A260 /* ahrs_spi_program.c */, + 65FA9B63147078450019A260 /* ahrs_spi_program_master.c */, + 65FA9B64147078450019A260 /* ahrs_spi_program_slave.c */, + 65FA9B65147078450019A260 /* bl_fsm.c */, + 65FA9B66147078450019A260 /* inc */, + 65FA9B6E147078450019A260 /* main.c */, + 65FA9B6F147078450019A260 /* Makefile */, + 65FA9B70147078450019A260 /* pios_board.c */, + ); + path = Revolution; + sourceTree = ""; + }; + 65FA9B66147078450019A260 /* inc */ = { + isa = PBXGroup; + children = ( + 65FA9B67147078450019A260 /* ahrs_bl.h */, + 65FA9B68147078450019A260 /* ahrs_spi_program.h */, + 65FA9B69147078450019A260 /* ahrs_spi_program_master.h */, + 65FA9B6A147078450019A260 /* ahrs_spi_program_slave.h */, + 65FA9B6B147078450019A260 /* bl_fsm.h */, + 65FA9B6C147078450019A260 /* ins_bl.h */, + 65FA9B6D147078450019A260 /* pios_config.h */, + ); + path = inc; + sourceTree = ""; + }; 65FF4BB313791C3300146BE4 /* Bootloaders */ = { isa = PBXGroup; children = ( - 6560A39F13EE2E6E00105DA5 /* INS */, 65FF4BB413791C3300146BE4 /* AHRS */, 65FF4BC413791C3300146BE4 /* BootloaderUpdater */, 65FF4BCB13791C3300146BE4 /* CopterControl */, 65FF4BD513791C3300146BE4 /* OpenPilot */, 65FF4BE213791C3300146BE4 /* PipXtreme */, + 65FA9B60147078450019A260 /* Revolution */, ); name = Bootloaders; path = ../../Bootloaders; diff --git a/flight/Project/gdb/revolution b/flight/Project/gdb/revolution index cc7b50dcd..ae6cc677d 100644 --- a/flight/Project/gdb/revolution +++ b/flight/Project/gdb/revolution @@ -1,8 +1,8 @@ define connect target remote localhost:3334 monitor cortex_m3 vector_catch all - file ./build/fw_revolution/fw_revolution.elf -# file ./build/bl_ins/bl_ins.elf +# file ./build/fw_revolution/fw_revolution.elf + file ./build/bl_ins/bl_ins.elf end source CortexM3 diff --git a/make/boards/revolution/board-info.mk b/make/boards/revolution/board-info.mk index 9eb3e0a0b..80e84e731 100644 --- a/make/boards/revolution/board-info.mk +++ b/make/boards/revolution/board-info.mk @@ -1,6 +1,6 @@ BOARD_TYPE := 0x05 BOARD_REVISION := 0x01 -BOOTLOADER_VERSION := 0x00 +BOOTLOADER_VERSION := 0x01 HW_TYPE := 0x00 MCU := cortex-m4