mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-30 15:52:12 +01:00
Merge branch 'master' of git://git.openpilot.org/OpenPilot
This commit is contained in:
commit
507a7c13b6
@ -121,6 +121,7 @@ SRC += $(PIOSCOMMON)/pios_com.c
|
|||||||
SRC += $(PIOSCOMMON)/pios_hmc5843.c
|
SRC += $(PIOSCOMMON)/pios_hmc5843.c
|
||||||
SRC += $(PIOSCOMMON)/printf-stdarg.c
|
SRC += $(PIOSCOMMON)/printf-stdarg.c
|
||||||
SRC += $(PIOSCOMMON)/pios_iap.c
|
SRC += $(PIOSCOMMON)/pios_iap.c
|
||||||
|
SRC += $(PIOSCOMMON)/pios_bl_helper.c
|
||||||
|
|
||||||
## CMSIS for STM32
|
## CMSIS for STM32
|
||||||
SRC += $(CMSISDIR)/core_cm3.c
|
SRC += $(CMSISDIR)/core_cm3.c
|
||||||
@ -304,39 +305,16 @@ LDFLAGS += -lc -lgcc
|
|||||||
# Set linker-script name depending on selected submodel name
|
# Set linker-script name depending on selected submodel name
|
||||||
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
|
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
||||||
# Options for OpenOCD flash-programming
|
# Program
|
||||||
# see openocd.pdf/openocd.texi for further information
|
|
||||||
#
|
|
||||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
|
||||||
# if OpenOCD is in the $PATH just set OPENOCDEXE=openocd
|
|
||||||
OOCD_EXE=openocd
|
|
||||||
# debug level
|
|
||||||
OOCD_CL=-d0
|
|
||||||
# interface and board/target settings (using the OOCD target-library here)
|
|
||||||
UNAME := $(shell uname)
|
|
||||||
ifeq ($(UNAME), Darwin)
|
|
||||||
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.ahrs.osx.cfg -f ../Project/OpenOCD/stm32.cfg
|
|
||||||
else
|
|
||||||
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.ahrs.cfg -f ../Project/OpenOCD/stm32.cfg
|
|
||||||
endif
|
|
||||||
# initialize
|
|
||||||
OOCD_CL+=-c init
|
|
||||||
# show the targets
|
|
||||||
OOCD_CL+=-c targets
|
|
||||||
# commands to prepare flash-write
|
|
||||||
OOCD_CL+= -c "reset halt"
|
|
||||||
# flash erase
|
|
||||||
OOCD_CL+=-c "stm32x mass_erase 0"
|
|
||||||
# flash-write
|
|
||||||
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
||||||
# Verify
|
# Verify
|
||||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
||||||
# reset target
|
# reset target
|
||||||
OOCD_CL+=-c "reset run"
|
OOCD_CL+=-c "reset run"
|
||||||
# terminate OOCD after programming
|
# # terminate OOCD after programming
|
||||||
OOCD_CL+=-c shutdown
|
OOCD_CL+=-c shutdown
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# Define programs and commands.
|
# Define programs and commands.
|
||||||
REMOVE = $(REMOVE_CMD) -f
|
REMOVE = $(REMOVE_CMD) -f
|
||||||
|
@ -99,8 +99,6 @@ void affine_rotate(float scale[3][4], float rotation[3]);
|
|||||||
void calibration(float result[3], float scale[3][4], float arg[3]);
|
void calibration(float result[3], float scale[3][4], float arg[3]);
|
||||||
|
|
||||||
/* Bootloader related functions and var*/
|
/* Bootloader related functions and var*/
|
||||||
static uint32_t iap_calc_crc(void);
|
|
||||||
static void read_description(uint8_t *);
|
|
||||||
void firmwareiapobj_callback(AhrsObjHandle obj);
|
void firmwareiapobj_callback(AhrsObjHandle obj);
|
||||||
volatile uint8_t reset_count=0;
|
volatile uint8_t reset_count=0;
|
||||||
|
|
||||||
@ -1249,36 +1247,15 @@ void firmwareiapobj_callback(AhrsObjHandle obj)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(firmwareIAPObj.BoardType==BOARD_TYPE && firmwareIAPObj.crc!=iap_calc_crc())
|
else if(firmwareIAPObj.BoardType==BOARD_TYPE && firmwareIAPObj.crc!=PIOS_BL_HELPER_CRC_Memory_Calc())
|
||||||
{
|
{
|
||||||
read_description(firmwareIAPObj.Description);
|
PIOS_BL_HELPER_FLASH_Read_Description(firmwareIAPObj.Description,SIZE_OF_DESCRIPTION);
|
||||||
firmwareIAPObj.crc=iap_calc_crc();
|
firmwareIAPObj.crc=PIOS_BL_HELPER_CRC_Memory_Calc();
|
||||||
firmwareIAPObj.BoardRevision=BOARD_REVISION;
|
firmwareIAPObj.BoardRevision=BOARD_REVISION;
|
||||||
FirmwareIAPObjSet(&firmwareIAPObj);
|
FirmwareIAPObjSet(&firmwareIAPObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t iap_calc_crc(void)
|
|
||||||
{
|
|
||||||
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_CRC, ENABLE);
|
|
||||||
CRC_ResetDR();
|
|
||||||
CRC_CalcBlockCRC((uint32_t *) START_OF_USER_CODE, (SIZE_OF_CODE) >> 2);
|
|
||||||
return CRC_GetCRC();
|
|
||||||
}
|
|
||||||
static uint8_t *FLASH_If_Read(uint32_t SectorAddress)
|
|
||||||
{
|
|
||||||
return (uint8_t *) (SectorAddress);
|
|
||||||
}
|
|
||||||
static void read_description(uint8_t * array)
|
|
||||||
{
|
|
||||||
uint8_t x = 0;
|
|
||||||
for (uint32_t i = START_OF_USER_CODE + SIZE_OF_CODE; i < START_OF_USER_CODE + SIZE_OF_CODE + SIZE_OF_DESCRIPTION; ++i) {
|
|
||||||
array[x] = *FLASH_If_Read(i);
|
|
||||||
++x;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
@ -40,5 +40,6 @@
|
|||||||
#define PIOS_INCLUDE_HMC5843
|
#define PIOS_INCLUDE_HMC5843
|
||||||
#define PIOS_INCLUDE_GPIO
|
#define PIOS_INCLUDE_GPIO
|
||||||
#define PIOS_INCLUDE_EXTI
|
#define PIOS_INCLUDE_EXTI
|
||||||
|
#define PIOS_INCLUDE_BL_HELPER
|
||||||
|
|
||||||
#endif /* PIOS_CONFIG_H */
|
#endif /* PIOS_CONFIG_H */
|
||||||
|
@ -291,31 +291,8 @@ LDFLAGS += -lc -lgcc
|
|||||||
# Set linker-script name depending on selected submodel name
|
# Set linker-script name depending on selected submodel name
|
||||||
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_stm32f10x_$(MODEL).ld
|
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_stm32f10x_$(MODEL).ld
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
||||||
# Options for OpenOCD flash-programming
|
# Program
|
||||||
# see openocd.pdf/openocd.texi for further information
|
|
||||||
#
|
|
||||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
|
||||||
# if OpenOCD is in the $PATH just set OPENOCDEXE=openocd
|
|
||||||
OOCD_EXE=openocd
|
|
||||||
# debug level
|
|
||||||
OOCD_CL=-d0
|
|
||||||
# interface and board/target settings (using the OOCD target-library here)
|
|
||||||
UNAME := $(shell uname)
|
|
||||||
ifeq ($(UNAME), Darwin)
|
|
||||||
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.ahrs.osx.cfg -f ../../Project/OpenOCD/stm32.cfg
|
|
||||||
else
|
|
||||||
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.ahrs.cfg -f ../../Project/OpenOCD/stm32.cfg
|
|
||||||
endif
|
|
||||||
# initialize
|
|
||||||
OOCD_CL+=-c init
|
|
||||||
# show the targets
|
|
||||||
OOCD_CL+=-c targets
|
|
||||||
# commands to prepare flash-write
|
|
||||||
OOCD_CL+= -c "reset halt"
|
|
||||||
# flash erase
|
|
||||||
OOCD_CL+=-c "stm32x mass_erase 0"
|
|
||||||
# flash-write
|
|
||||||
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
||||||
# Verify
|
# Verify
|
||||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
||||||
@ -323,8 +300,6 @@ OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
|||||||
OOCD_CL+=-c "reset run"
|
OOCD_CL+=-c "reset run"
|
||||||
# terminate OOCD after programming
|
# terminate OOCD after programming
|
||||||
OOCD_CL+=-c shutdown
|
OOCD_CL+=-c shutdown
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
# Define programs and commands.
|
# Define programs and commands.
|
||||||
REMOVE = $(REMOVE_CMD) -f
|
REMOVE = $(REMOVE_CMD) -f
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#define PIOS_INCLUDE_SPI
|
#define PIOS_INCLUDE_SPI
|
||||||
#define PIOS_INCLUDE_SYS
|
#define PIOS_INCLUDE_SYS
|
||||||
#define PIOS_INCLUDE_BL_HELPER
|
#define PIOS_INCLUDE_BL_HELPER
|
||||||
|
#define PIOS_INCLUDE_BL_HELPER_WRITE_SUPPORT
|
||||||
#define PIOS_INCLUDE_GPIO
|
#define PIOS_INCLUDE_GPIO
|
||||||
|
|
||||||
#endif /* PIOS_CONFIG_H */
|
#endif /* PIOS_CONFIG_H */
|
||||||
|
@ -96,7 +96,7 @@ int main() {
|
|||||||
}
|
}
|
||||||
PIOS_Board_Init();
|
PIOS_Board_Init();
|
||||||
boot_status = idle;
|
boot_status = idle;
|
||||||
Fw_crc = crc_memory_calc();
|
Fw_crc = PIOS_BL_HELPER_CRC_Memory_Calc();
|
||||||
PIOS_LED_On(LED1);
|
PIOS_LED_On(LED1);
|
||||||
while (1) {
|
while (1) {
|
||||||
process_spi_request();
|
process_spi_request();
|
||||||
@ -146,7 +146,7 @@ void process_spi_request(void) {
|
|||||||
|
|
||||||
case OPAHRS_MSG_V0_REQ_FWUP_VERIFY:
|
case OPAHRS_MSG_V0_REQ_FWUP_VERIFY:
|
||||||
opahrs_msg_v0_init_user_tx(&user_tx_v0, OPAHRS_MSG_V0_RSP_FWUP_STATUS);
|
opahrs_msg_v0_init_user_tx(&user_tx_v0, OPAHRS_MSG_V0_RSP_FWUP_STATUS);
|
||||||
Fw_crc = crc_memory_calc();
|
Fw_crc = PIOS_BL_HELPER_CRC_Memory_Calc();
|
||||||
lfsm_user_set_tx_v0(&user_tx_v0);
|
lfsm_user_set_tx_v0(&user_tx_v0);
|
||||||
boot_status = idle;
|
boot_status = idle;
|
||||||
PIOS_LED_Off(LED1);
|
PIOS_LED_Off(LED1);
|
||||||
@ -216,7 +216,7 @@ void process_spi_request(void) {
|
|||||||
uint32_t adr=user_rx_v0.payload.user.v.req.fwdn_data.adress;
|
uint32_t adr=user_rx_v0.payload.user.v.req.fwdn_data.adress;
|
||||||
for(uint8_t x=0;x<4;++x)
|
for(uint8_t x=0;x<4;++x)
|
||||||
{
|
{
|
||||||
user_tx_v0.payload.user.v.rsp.fw_dn.data[x]=*FLASH_If_Read(adr+x);
|
user_tx_v0.payload.user.v.rsp.fw_dn.data[x]=*PIOS_BL_HELPER_FLASH_If_Read(adr+x);
|
||||||
}
|
}
|
||||||
lfsm_user_set_tx_v0(&user_tx_v0);
|
lfsm_user_set_tx_v0(&user_tx_v0);
|
||||||
break;
|
break;
|
||||||
@ -226,7 +226,7 @@ void process_spi_request(void) {
|
|||||||
user_tx_v0.payload.user.v.rsp.fwup_status.status = boot_status;
|
user_tx_v0.payload.user.v.rsp.fwup_status.status = boot_status;
|
||||||
lfsm_user_set_tx_v0(&user_tx_v0);
|
lfsm_user_set_tx_v0(&user_tx_v0);
|
||||||
PIOS_LED_On(LED1);
|
PIOS_LED_On(LED1);
|
||||||
if (FLASH_Start() == TRUE) {
|
if (PIOS_BL_HELPER_FLASH_Start() == TRUE) {
|
||||||
boot_status = started;
|
boot_status = started;
|
||||||
PIOS_LED_Off(LED1);
|
PIOS_LED_Off(LED1);
|
||||||
} else {
|
} else {
|
||||||
|
@ -64,8 +64,8 @@ USE_THUMB_MODE = YES
|
|||||||
# - MODEL used for linker-script name (-T) and passed as define
|
# - MODEL used for linker-script name (-T) and passed as define
|
||||||
# - BOARD just passed as define (optional)
|
# - BOARD just passed as define (optional)
|
||||||
MCU = cortex-m3
|
MCU = cortex-m3
|
||||||
CHIP = STM32F103CBT
|
CHIP = STM32F103CBT
|
||||||
BOARD ?= NULL
|
BOARD ?= NULL
|
||||||
MODEL ?= NULL
|
MODEL ?= NULL
|
||||||
|
|
||||||
ifeq ($(USE_BOOTLOADER), YES)
|
ifeq ($(USE_BOOTLOADER), YES)
|
||||||
@ -330,41 +330,15 @@ else
|
|||||||
quote =
|
quote =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
||||||
# Options for OpenOCD flash-programming
|
# Program
|
||||||
# see openocd.pdf/openocd.texi for further information
|
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
||||||
#
|
|
||||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
|
||||||
# if OpenOCD is in the $PATH just set OOCD_EXE=openocd
|
|
||||||
OOCD_EXE=openocd
|
|
||||||
# debug level
|
|
||||||
OOCD_CL=-d0
|
|
||||||
# interface and board/target settings (using the OOCD target-library here)
|
|
||||||
UNAME := $(shell uname)
|
|
||||||
|
|
||||||
ifeq ($(UNAME), Darwin)
|
|
||||||
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.openpilot.osx.cfg -f ../../Project/OpenOCD/stm32.cfg
|
|
||||||
else
|
|
||||||
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.openpilot.cfg -f ../../Project/OpenOCD/stm32.cfg
|
|
||||||
endif
|
|
||||||
# initialize
|
|
||||||
OOCD_CL+=-c init
|
|
||||||
# show the targets
|
|
||||||
OOCD_CL+=-c targets
|
|
||||||
# commands to prepare flash-write
|
|
||||||
OOCD_CL+= -c "reset halt"
|
|
||||||
# flash erase
|
|
||||||
OOCD_CL+=-c "stm32x mass_erase 0"
|
|
||||||
# flash-write
|
|
||||||
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
|
||||||
# Verify
|
# Verify
|
||||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
||||||
# reset target
|
# reset target
|
||||||
OOCD_CL+=-c "reset run"
|
OOCD_CL+=-c "reset run"
|
||||||
# terminate OOCD after programming
|
# terminate OOCD after programming
|
||||||
OOCD_CL+=-c shutdown
|
OOCD_CL+=-c shutdown
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
# Define programs and commands.
|
# Define programs and commands.
|
||||||
CC = $(TCHAIN_PREFIX)gcc
|
CC = $(TCHAIN_PREFIX)gcc
|
||||||
|
@ -370,40 +370,15 @@ LDFLAGS += -lc -lgcc
|
|||||||
# Set linker-script name depending on selected submodel name
|
# Set linker-script name depending on selected submodel name
|
||||||
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_stm32f10x_$(MODEL).ld
|
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_stm32f10x_$(MODEL).ld
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
||||||
# Options for OpenOCD flash-programming
|
# Program
|
||||||
# see openocd.pdf/openocd.texi for further information
|
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
||||||
#
|
|
||||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
|
||||||
# if OpenOCD is in the $PATH just set OOCD_EXE=openocd
|
|
||||||
OOCD_EXE=openocd
|
|
||||||
# debug level
|
|
||||||
OOCD_CL=-d0
|
|
||||||
# interface and board/target settings (using the OOCD target-library here)
|
|
||||||
UNAME := $(shell uname)
|
|
||||||
ifeq ($(UNAME), Darwin)
|
|
||||||
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.openpilot.osx.cfg -f ../../Project/OpenOCD/stm32.cfg
|
|
||||||
else
|
|
||||||
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.openpilot.cfg -f ../../Project/OpenOCD/stm32.cfg
|
|
||||||
endif
|
|
||||||
# initialize
|
|
||||||
OOCD_CL+=-c init
|
|
||||||
# show the targets
|
|
||||||
OOCD_CL+=-c targets
|
|
||||||
# commands to prepare flash-write
|
|
||||||
OOCD_CL+= -c "reset halt"
|
|
||||||
# flash erase
|
|
||||||
OOCD_CL+=-c "stm32x mass_erase 0"
|
|
||||||
# flash-write
|
|
||||||
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
|
||||||
# Verify
|
# Verify
|
||||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
||||||
# reset target
|
# reset target
|
||||||
OOCD_CL+=-c "reset run"
|
OOCD_CL+=-c "reset run"
|
||||||
# terminate OOCD after programming
|
# terminate OOCD after programming
|
||||||
OOCD_CL+=-c shutdown
|
OOCD_CL+=-c shutdown
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
# Define programs and commands.
|
# Define programs and commands.
|
||||||
REMOVE = $(REMOVE_CMD) -f
|
REMOVE = $(REMOVE_CMD) -f
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#ifndef PIOS_CONFIG_H
|
#ifndef PIOS_CONFIG_H
|
||||||
#define PIOS_CONFIG_H
|
#define PIOS_CONFIG_H
|
||||||
#define PIOS_INCLUDE_BL_HELPER
|
#define PIOS_INCLUDE_BL_HELPER
|
||||||
|
#define PIOS_INCLUDE_BL_HELPER_WRITE_SUPPORT
|
||||||
#define USB_HID
|
#define USB_HID
|
||||||
/* Enable/Disable PiOS Modules */
|
/* Enable/Disable PiOS Modules */
|
||||||
#define PIOS_INCLUDE_DELAY
|
#define PIOS_INCLUDE_DELAY
|
||||||
@ -61,4 +62,4 @@
|
|||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
@ -116,10 +116,10 @@ void DataDownload(DownloadAction action) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Self_flash:
|
case Self_flash:
|
||||||
SendBuffer[6 + (x * 4)] = *FLASH_If_Read(offset);
|
SendBuffer[6 + (x * 4)] = *PIOS_BL_HELPER_FLASH_If_Read(offset);
|
||||||
SendBuffer[7 + (x * 4)] = *FLASH_If_Read(offset + 1);
|
SendBuffer[7 + (x * 4)] = *PIOS_BL_HELPER_FLASH_If_Read(offset + 1);
|
||||||
SendBuffer[8 + (x * 4)] = *FLASH_If_Read(offset + 2);
|
SendBuffer[8 + (x * 4)] = *PIOS_BL_HELPER_FLASH_If_Read(offset + 2);
|
||||||
SendBuffer[9 + (x * 4)] = *FLASH_If_Read(offset + 3);
|
SendBuffer[9 + (x * 4)] = *PIOS_BL_HELPER_FLASH_If_Read(offset + 3);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
@ -178,7 +178,7 @@ void processComand(uint8_t *xReceive_Buffer) {
|
|||||||
uint8_t result = 0;
|
uint8_t result = 0;
|
||||||
switch (currentProgrammingDestination) {
|
switch (currentProgrammingDestination) {
|
||||||
case Self_flash:
|
case Self_flash:
|
||||||
result = FLASH_Ini();
|
result = PIOS_BL_HELPER_FLASH_Ini();
|
||||||
break;
|
break;
|
||||||
case Remote_flash_via_spi:
|
case Remote_flash_via_spi:
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
@ -214,7 +214,7 @@ void processComand(uint8_t *xReceive_Buffer) {
|
|||||||
if (TransferType == FW) {
|
if (TransferType == FW) {
|
||||||
switch (currentProgrammingDestination) {
|
switch (currentProgrammingDestination) {
|
||||||
case Self_flash:
|
case Self_flash:
|
||||||
result = FLASH_Start();
|
result = PIOS_BL_HELPER_FLASH_Start();
|
||||||
break;
|
break;
|
||||||
case Remote_flash_via_spi:
|
case Remote_flash_via_spi:
|
||||||
result = FALSE;
|
result = FALSE;
|
||||||
@ -459,7 +459,7 @@ uint8_t isBiggerThanAvailable(DFUTransfer type, uint32_t size) {
|
|||||||
uint32_t CalcFirmCRC() {
|
uint32_t CalcFirmCRC() {
|
||||||
switch (currentProgrammingDestination) {
|
switch (currentProgrammingDestination) {
|
||||||
case Self_flash:
|
case Self_flash:
|
||||||
return crc_memory_calc();
|
return PIOS_BL_HELPER_CRC_Memory_Calc();
|
||||||
break;
|
break;
|
||||||
case Remote_flash_via_spi:
|
case Remote_flash_via_spi:
|
||||||
return 0;
|
return 0;
|
||||||
@ -484,7 +484,7 @@ bool flash_read(uint8_t * buffer, uint32_t adr, DFUProgType type) {
|
|||||||
break;
|
break;
|
||||||
case Self_flash:
|
case Self_flash:
|
||||||
for (uint8_t x = 0; x < 4; ++x) {
|
for (uint8_t x = 0; x < 4; ++x) {
|
||||||
buffer[x] = *FLASH_If_Read(adr + x);
|
buffer[x] = *PIOS_BL_HELPER_FLASH_If_Read(adr + x);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
|
@ -371,40 +371,15 @@ LDFLAGS += -lc -lgcc
|
|||||||
# Set linker-script name depending on selected submodel name
|
# Set linker-script name depending on selected submodel name
|
||||||
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_stm32f10x_$(MODEL).ld
|
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_stm32f10x_$(MODEL).ld
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
||||||
# Options for OpenOCD flash-programming
|
# Program
|
||||||
# see openocd.pdf/openocd.texi for further information
|
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
||||||
#
|
|
||||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
|
||||||
# if OpenOCD is in the $PATH just set OOCD_EXE=openocd
|
|
||||||
OOCD_EXE=openocd
|
|
||||||
# debug level
|
|
||||||
OOCD_CL=-d0
|
|
||||||
# interface and board/target settings (using the OOCD target-library here)
|
|
||||||
UNAME := $(shell uname)
|
|
||||||
ifeq ($(UNAME), Darwin)
|
|
||||||
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.openpilot.osx.cfg -f ../../Project/OpenOCD/stm32.cfg
|
|
||||||
else
|
|
||||||
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.openpilot.cfg -f ../../Project/OpenOCD/stm32.cfg
|
|
||||||
endif
|
|
||||||
# initialize
|
|
||||||
OOCD_CL+=-c init
|
|
||||||
# show the targets
|
|
||||||
OOCD_CL+=-c targets
|
|
||||||
# commands to prepare flash-write
|
|
||||||
OOCD_CL+= -c "reset halt"
|
|
||||||
# flash erase
|
|
||||||
OOCD_CL+=-c "stm32x mass_erase 0"
|
|
||||||
# flash-write
|
|
||||||
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
|
||||||
# Verify
|
# Verify
|
||||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
||||||
# reset target
|
# reset target
|
||||||
OOCD_CL+=-c "reset run"
|
OOCD_CL+=-c "reset run"
|
||||||
# terminate OOCD after programming
|
# terminate OOCD after programming
|
||||||
OOCD_CL+=-c shutdown
|
OOCD_CL+=-c shutdown
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
# Define programs and commands.
|
# Define programs and commands.
|
||||||
REMOVE = $(REMOVE_CMD) -f
|
REMOVE = $(REMOVE_CMD) -f
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#ifndef PIOS_CONFIG_H
|
#ifndef PIOS_CONFIG_H
|
||||||
#define PIOS_CONFIG_H
|
#define PIOS_CONFIG_H
|
||||||
#define PIOS_INCLUDE_BL_HELPER
|
#define PIOS_INCLUDE_BL_HELPER
|
||||||
|
#define PIOS_INCLUDE_BL_HELPER_WRITE_SUPPORT
|
||||||
#define USB_HID
|
#define USB_HID
|
||||||
/* Enable/Disable PiOS Modules */
|
/* Enable/Disable PiOS Modules */
|
||||||
#define PIOS_INCLUDE_DELAY
|
#define PIOS_INCLUDE_DELAY
|
||||||
@ -64,4 +65,4 @@
|
|||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
@ -158,7 +158,7 @@ void processComand(uint8_t *xReceive_Buffer) {
|
|||||||
uint8_t result = 0;
|
uint8_t result = 0;
|
||||||
switch (currentProgrammingDestination) {
|
switch (currentProgrammingDestination) {
|
||||||
case Self_flash:
|
case Self_flash:
|
||||||
result = FLASH_Ini();
|
result = PIOS_BL_HELPER_FLASH_Ini();
|
||||||
break;
|
break;
|
||||||
case Remote_flash_via_spi:
|
case Remote_flash_via_spi:
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
@ -195,7 +195,7 @@ void processComand(uint8_t *xReceive_Buffer) {
|
|||||||
if (TransferType == FW) {
|
if (TransferType == FW) {
|
||||||
switch (currentProgrammingDestination) {
|
switch (currentProgrammingDestination) {
|
||||||
case Self_flash:
|
case Self_flash:
|
||||||
result = FLASH_Start();
|
result = PIOS_BL_HELPER_FLASH_Start();
|
||||||
break;
|
break;
|
||||||
case Remote_flash_via_spi:
|
case Remote_flash_via_spi:
|
||||||
PIOS_OPAHRS_bl_FwupStart(&rsp);
|
PIOS_OPAHRS_bl_FwupStart(&rsp);
|
||||||
@ -525,7 +525,7 @@ uint32_t CalcFirmCRC() {
|
|||||||
struct opahrs_msg_v0 rsp;
|
struct opahrs_msg_v0 rsp;
|
||||||
switch (currentProgrammingDestination) {
|
switch (currentProgrammingDestination) {
|
||||||
case Self_flash:
|
case Self_flash:
|
||||||
return crc_memory_calc();
|
return PIOS_BL_HELPER_CRC_Memory_Calc();
|
||||||
break;
|
break;
|
||||||
case Remote_flash_via_spi:
|
case Remote_flash_via_spi:
|
||||||
PIOS_OPAHRS_bl_FwupVerify(&rsp);
|
PIOS_OPAHRS_bl_FwupVerify(&rsp);
|
||||||
@ -574,7 +574,7 @@ bool flash_read(uint8_t * buffer, uint32_t adr, DFUProgType type) {
|
|||||||
break;
|
break;
|
||||||
case Self_flash:
|
case Self_flash:
|
||||||
for (uint8_t x = 0; x < 4; ++x) {
|
for (uint8_t x = 0; x < 4; ++x) {
|
||||||
buffer[x] = *FLASH_If_Read(adr + x);
|
buffer[x] = *PIOS_BL_HELPER_FLASH_If_Read(adr + x);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
|
@ -370,40 +370,15 @@ LDFLAGS += -lc -lgcc
|
|||||||
# Set linker-script name depending on selected submodel name
|
# Set linker-script name depending on selected submodel name
|
||||||
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_stm32f10x_$(MODEL).ld
|
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_stm32f10x_$(MODEL).ld
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
||||||
# Options for OpenOCD flash-programming
|
# Program
|
||||||
# see openocd.pdf/openocd.texi for further information
|
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
||||||
#
|
|
||||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
|
||||||
# if OpenOCD is in the $PATH just set OOCD_EXE=openocd
|
|
||||||
OOCD_EXE=openocd
|
|
||||||
# debug level
|
|
||||||
OOCD_CL=-d0
|
|
||||||
# interface and board/target settings (using the OOCD target-library here)
|
|
||||||
UNAME := $(shell uname)
|
|
||||||
ifeq ($(UNAME), Darwin)
|
|
||||||
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.openpilot.osx.cfg -f ../../Project/OpenOCD/stm32.cfg
|
|
||||||
else
|
|
||||||
OOCD_CL+=-f ../../Project/OpenOCD/floss-jtag.openpilot.cfg -f ../../Project/OpenOCD/stm32.cfg
|
|
||||||
endif
|
|
||||||
# initialize
|
|
||||||
OOCD_CL+=-c init
|
|
||||||
# show the targets
|
|
||||||
OOCD_CL+=-c targets
|
|
||||||
# commands to prepare flash-write
|
|
||||||
OOCD_CL+= -c "reset halt"
|
|
||||||
# flash erase
|
|
||||||
OOCD_CL+=-c "stm32x mass_erase 0"
|
|
||||||
# flash-write
|
|
||||||
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
|
||||||
# Verify
|
# Verify
|
||||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
||||||
# reset target
|
# reset target
|
||||||
OOCD_CL+=-c "reset run"
|
OOCD_CL+=-c "reset run"
|
||||||
# terminate OOCD after programming
|
# terminate OOCD after programming
|
||||||
OOCD_CL+=-c shutdown
|
OOCD_CL+=-c shutdown
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
# Define programs and commands.
|
# Define programs and commands.
|
||||||
REMOVE = $(REMOVE_CMD) -f
|
REMOVE = $(REMOVE_CMD) -f
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#ifndef PIOS_CONFIG_H
|
#ifndef PIOS_CONFIG_H
|
||||||
#define PIOS_CONFIG_H
|
#define PIOS_CONFIG_H
|
||||||
#define PIOS_INCLUDE_BL_HELPER
|
#define PIOS_INCLUDE_BL_HELPER
|
||||||
|
#define PIOS_INCLUDE_BL_HELPER_WRITE_SUPPORT
|
||||||
#define USB_HID
|
#define USB_HID
|
||||||
/* Enable/Disable PiOS Modules */
|
/* Enable/Disable PiOS Modules */
|
||||||
#define PIOS_INCLUDE_DELAY
|
#define PIOS_INCLUDE_DELAY
|
||||||
@ -61,4 +62,4 @@
|
|||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
@ -116,10 +116,10 @@ void DataDownload(DownloadAction action) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Self_flash:
|
case Self_flash:
|
||||||
SendBuffer[6 + (x * 4)] = *FLASH_If_Read(offset);
|
SendBuffer[6 + (x * 4)] = *PIOS_BL_HELPER_FLASH_If_Read(offset);
|
||||||
SendBuffer[7 + (x * 4)] = *FLASH_If_Read(offset + 1);
|
SendBuffer[7 + (x * 4)] = *PIOS_BL_HELPER_FLASH_If_Read(offset + 1);
|
||||||
SendBuffer[8 + (x * 4)] = *FLASH_If_Read(offset + 2);
|
SendBuffer[8 + (x * 4)] = *PIOS_BL_HELPER_FLASH_If_Read(offset + 2);
|
||||||
SendBuffer[9 + (x * 4)] = *FLASH_If_Read(offset + 3);
|
SendBuffer[9 + (x * 4)] = *PIOS_BL_HELPER_FLASH_If_Read(offset + 3);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
@ -178,7 +178,7 @@ void processComand(uint8_t *xReceive_Buffer) {
|
|||||||
uint8_t result = 0;
|
uint8_t result = 0;
|
||||||
switch (currentProgrammingDestination) {
|
switch (currentProgrammingDestination) {
|
||||||
case Self_flash:
|
case Self_flash:
|
||||||
result = FLASH_Ini();
|
result = PIOS_BL_HELPER_FLASH_Ini();
|
||||||
break;
|
break;
|
||||||
case Remote_flash_via_spi:
|
case Remote_flash_via_spi:
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
@ -214,7 +214,7 @@ void processComand(uint8_t *xReceive_Buffer) {
|
|||||||
if (TransferType == FW) {
|
if (TransferType == FW) {
|
||||||
switch (currentProgrammingDestination) {
|
switch (currentProgrammingDestination) {
|
||||||
case Self_flash:
|
case Self_flash:
|
||||||
result = FLASH_Start();
|
result = PIOS_BL_HELPER_FLASH_Start();
|
||||||
break;
|
break;
|
||||||
case Remote_flash_via_spi:
|
case Remote_flash_via_spi:
|
||||||
result = FALSE;
|
result = FALSE;
|
||||||
@ -459,7 +459,7 @@ uint8_t isBiggerThanAvailable(DFUTransfer type, uint32_t size) {
|
|||||||
uint32_t CalcFirmCRC() {
|
uint32_t CalcFirmCRC() {
|
||||||
switch (currentProgrammingDestination) {
|
switch (currentProgrammingDestination) {
|
||||||
case Self_flash:
|
case Self_flash:
|
||||||
return crc_memory_calc();
|
return PIOS_BL_HELPER_CRC_Memory_Calc();
|
||||||
break;
|
break;
|
||||||
case Remote_flash_via_spi:
|
case Remote_flash_via_spi:
|
||||||
return 0;
|
return 0;
|
||||||
@ -484,7 +484,7 @@ bool flash_read(uint8_t * buffer, uint32_t adr, DFUProgType type) {
|
|||||||
break;
|
break;
|
||||||
case Self_flash:
|
case Self_flash:
|
||||||
for (uint8_t x = 0; x < 4; ++x) {
|
for (uint8_t x = 0; x < 4; ++x) {
|
||||||
buffer[x] = *FLASH_If_Read(adr + x);
|
buffer[x] = *PIOS_BL_HELPER_FLASH_If_Read(adr + x);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
|
@ -216,6 +216,7 @@ SRC += $(PIOSCOMMON)/pios_adxl345.c
|
|||||||
SRC += $(PIOSCOMMON)/pios_com.c
|
SRC += $(PIOSCOMMON)/pios_com.c
|
||||||
SRC += $(PIOSCOMMON)/pios_i2c_esc.c
|
SRC += $(PIOSCOMMON)/pios_i2c_esc.c
|
||||||
SRC += $(PIOSCOMMON)/pios_iap.c
|
SRC += $(PIOSCOMMON)/pios_iap.c
|
||||||
|
SRC += $(PIOSCOMMON)/pios_bl_helper.c
|
||||||
SRC += $(PIOSCOMMON)/printf-stdarg.c
|
SRC += $(PIOSCOMMON)/printf-stdarg.c
|
||||||
## Libraries for flight calculations
|
## Libraries for flight calculations
|
||||||
SRC += $(FLIGHTLIB)/fifo_buffer.c
|
SRC += $(FLIGHTLIB)/fifo_buffer.c
|
||||||
@ -477,31 +478,8 @@ LDFLAGS += -lc -lgcc
|
|||||||
# Set linker-script name depending on selected submodel name
|
# Set linker-script name depending on selected submodel name
|
||||||
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
|
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
||||||
# Options for OpenOCD flash-programming
|
# Program
|
||||||
# see openocd.pdf/openocd.texi for further information
|
|
||||||
#
|
|
||||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
|
||||||
# if OpenOCD is in the $PATH just set OOCD_EXE=openocd
|
|
||||||
OOCD_EXE=openocd
|
|
||||||
# debug level
|
|
||||||
OOCD_CL=-d0
|
|
||||||
# interface and board/target settings (using the OOCD target-library here)
|
|
||||||
UNAME := $(shell uname)
|
|
||||||
ifeq ($(UNAME), Darwin)
|
|
||||||
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.openpilot.osx.cfg -f ../Project/OpenOCD/stm32.cfg
|
|
||||||
else
|
|
||||||
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.openpilot.cfg -f ../Project/OpenOCD/stm32.cfg
|
|
||||||
endif
|
|
||||||
# initialize
|
|
||||||
OOCD_CL+=-c init
|
|
||||||
# show the targets
|
|
||||||
OOCD_CL+=-c targets
|
|
||||||
# commands to prepare flash-write
|
|
||||||
OOCD_CL+= -c "reset halt"
|
|
||||||
# flash erase
|
|
||||||
OOCD_CL+=-c "stm32x mass_erase 0"
|
|
||||||
# flash-write
|
|
||||||
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
||||||
# Verify
|
# Verify
|
||||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
||||||
@ -509,7 +487,6 @@ OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
|||||||
OOCD_CL+=-c "reset run"
|
OOCD_CL+=-c "reset run"
|
||||||
# terminate OOCD after programming
|
# terminate OOCD after programming
|
||||||
OOCD_CL+=-c shutdown
|
OOCD_CL+=-c shutdown
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# Define programs and commands.
|
# Define programs and commands.
|
||||||
REMOVE = $(REMOVE_CMD) -f
|
REMOVE = $(REMOVE_CMD) -f
|
||||||
|
@ -77,7 +77,6 @@ int32_t AlarmsSet(SystemAlarmsAlarmElem alarm, SystemAlarmsAlarmOptions severity
|
|||||||
{
|
{
|
||||||
alarms.Alarm[alarm] = severity;
|
alarms.Alarm[alarm] = severity;
|
||||||
SystemAlarmsSet(&alarms);
|
SystemAlarmsSet(&alarms);
|
||||||
SystemAlarmsUpdated(); // force telemetry update since the alarm was changed
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Release lock
|
// Release lock
|
||||||
|
@ -65,6 +65,7 @@
|
|||||||
#define PIOS_INCLUDE_GPIO
|
#define PIOS_INCLUDE_GPIO
|
||||||
#define PIOS_INCLUDE_EXTI
|
#define PIOS_INCLUDE_EXTI
|
||||||
#define PIOS_INCLUDE_WDG
|
#define PIOS_INCLUDE_WDG
|
||||||
|
#define PIOS_INCLUDE_BL_HELPER
|
||||||
|
|
||||||
#define PIOS_INCLUDE_ADXL345
|
#define PIOS_INCLUDE_ADXL345
|
||||||
#define PIOS_INCLUDE_FLASH
|
#define PIOS_INCLUDE_FLASH
|
||||||
|
@ -313,39 +313,15 @@ LDFLAGS += -lc -lgcc
|
|||||||
# Set linker-script name depending on selected submodel name
|
# Set linker-script name depending on selected submodel name
|
||||||
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
|
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
||||||
# Options for OpenOCD flash-programming
|
# Program
|
||||||
# see openocd.pdf/openocd.texi for further information
|
|
||||||
#
|
|
||||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
|
||||||
# if OpenOCD is in the $PATH just set OPENOCDEXE=openocd
|
|
||||||
OOCD_EXE=openocd
|
|
||||||
# debug level
|
|
||||||
OOCD_CL=-d0
|
|
||||||
# interface and board/target settings (using the OOCD target-library here)
|
|
||||||
UNAME := $(shell uname)
|
|
||||||
ifeq ($(UNAME), Darwin)
|
|
||||||
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.openpilot.osx.cfg -f ../Project/OpenOCD/stm32.cfg
|
|
||||||
else
|
|
||||||
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.openpilot.cfg -f ../Project/OpenOCD/stm32.cfg
|
|
||||||
endif
|
|
||||||
# initialize
|
|
||||||
OOCD_CL+=-c init
|
|
||||||
# show the targets
|
|
||||||
OOCD_CL+=-c targets
|
|
||||||
# commands to prepare flash-write
|
|
||||||
OOCD_CL+= -c "reset halt"
|
|
||||||
# flash erase
|
|
||||||
OOCD_CL+=-c "stm32x mass_erase 0"
|
|
||||||
# flash-write
|
|
||||||
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
||||||
# Verify
|
# Verify
|
||||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
||||||
# reset target
|
# reset target
|
||||||
OOCD_CL+=-c "reset run"
|
OOCD_CL+=-c "reset run"
|
||||||
# terminate OOCD after programming
|
# # terminate OOCD after programming
|
||||||
OOCD_CL+=-c shutdown
|
OOCD_CL+=-c shutdown
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# Define programs and commands.
|
# Define programs and commands.
|
||||||
REMOVE = $(REMOVE_CMD) -f
|
REMOVE = $(REMOVE_CMD) -f
|
||||||
|
@ -47,7 +47,6 @@
|
|||||||
|
|
||||||
#define RESET_DELAY 500 /* delay between sending reset ot INS */
|
#define RESET_DELAY 500 /* delay between sending reset ot INS */
|
||||||
|
|
||||||
|
|
||||||
#define TICKS2MS(t) ((t)/portTICK_RATE_MS)
|
#define TICKS2MS(t) ((t)/portTICK_RATE_MS)
|
||||||
#define MS2TICKS(m) ((m)*portTICK_RATE_MS)
|
#define MS2TICKS(m) ((m)*portTICK_RATE_MS)
|
||||||
|
|
||||||
@ -59,18 +58,12 @@ const uint32_t iap_time_3_high_end = 5000;
|
|||||||
// Private types
|
// Private types
|
||||||
|
|
||||||
// Private variables
|
// Private variables
|
||||||
const static uint8_t version[] = { 0, 0, 1 };
|
|
||||||
const static uint16_t SVN = 12345;
|
|
||||||
static uint8_t reset_count = 0;
|
static uint8_t reset_count = 0;
|
||||||
static portTickType lastResetSysTime;
|
static portTickType lastResetSysTime;
|
||||||
|
|
||||||
// Private functions
|
// Private functions
|
||||||
static void FirmwareIAPCallback(UAVObjEvent* ev);
|
static void FirmwareIAPCallback(UAVObjEvent* ev);
|
||||||
|
|
||||||
static uint32_t iap_calc_crc(void);
|
|
||||||
|
|
||||||
static void read_description(uint8_t *);
|
|
||||||
|
|
||||||
FirmwareIAPObjData data;
|
FirmwareIAPObjData data;
|
||||||
|
|
||||||
static uint32_t get_time(void);
|
static uint32_t get_time(void);
|
||||||
@ -97,7 +90,8 @@ static void resetTask(UAVObjEvent *);
|
|||||||
int32_t FirmwareIAPInitialize()
|
int32_t FirmwareIAPInitialize()
|
||||||
{
|
{
|
||||||
data.BoardType= BOARD_TYPE;
|
data.BoardType= BOARD_TYPE;
|
||||||
read_description(data.Description);
|
PIOS_BL_HELPER_FLASH_Read_Description(data.Description,FIRMWAREIAPOBJ_DESCRIPTION_NUMELEM);
|
||||||
|
PIOS_SYS_SerialNumberGetBinary(data.CPUSerial);
|
||||||
data.BoardRevision= BOARD_REVISION;
|
data.BoardRevision= BOARD_REVISION;
|
||||||
data.ArmReset=0;
|
data.ArmReset=0;
|
||||||
data.crc = 0;
|
data.crc = 0;
|
||||||
@ -130,11 +124,12 @@ static void FirmwareIAPCallback(UAVObjEvent* ev)
|
|||||||
this_time = get_time();
|
this_time = get_time();
|
||||||
delta = this_time - last_time;
|
delta = this_time - last_time;
|
||||||
last_time = this_time;
|
last_time = this_time;
|
||||||
if((data.BoardType==BOARD_TYPE)&&(data.crc != iap_calc_crc()))
|
if((data.BoardType==BOARD_TYPE)&&(data.crc != PIOS_BL_HELPER_CRC_Memory_Calc()))
|
||||||
{
|
{
|
||||||
read_description(data.Description);
|
PIOS_BL_HELPER_FLASH_Read_Description(data.Description,FIRMWAREIAPOBJ_DESCRIPTION_NUMELEM);
|
||||||
|
PIOS_SYS_SerialNumberGetBinary(data.CPUSerial);
|
||||||
data.BoardRevision=BOARD_REVISION;
|
data.BoardRevision=BOARD_REVISION;
|
||||||
data.crc = iap_calc_crc();
|
data.crc = PIOS_BL_HELPER_CRC_Memory_Calc();
|
||||||
FirmwareIAPObjSet( &data );
|
FirmwareIAPObjSet( &data );
|
||||||
}
|
}
|
||||||
if((data.ArmReset==1)&&(iap_state!=IAP_STATE_RESETTING))
|
if((data.ArmReset==1)&&(iap_state!=IAP_STATE_RESETTING))
|
||||||
@ -213,41 +208,6 @@ static uint32_t get_time(void)
|
|||||||
return TICKS2MS(ticks);
|
return TICKS2MS(ticks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief Calculate the CRC value of the code in flash.
|
|
||||||
* \param None
|
|
||||||
* \return calculated CRC value using STM32's builtin CRC hardware
|
|
||||||
*
|
|
||||||
* \note
|
|
||||||
* I copied this function as the function crc calc function in pios_bl_helper.c
|
|
||||||
* is only included when the PIOS_BL_HELPER is defined, but this also includes
|
|
||||||
* the flash unlock and erase functions. It is safer to only have the flash
|
|
||||||
* functions in the bootloader.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
static uint32_t iap_calc_crc(void)
|
|
||||||
{
|
|
||||||
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_CRC, ENABLE);
|
|
||||||
CRC_ResetDR();
|
|
||||||
CRC_CalcBlockCRC((uint32_t *) START_OF_USER_CODE, (SIZE_OF_CODE) >> 2);
|
|
||||||
return CRC_GetCRC();
|
|
||||||
}
|
|
||||||
static uint8_t *FLASH_If_Read(uint32_t SectorAddress)
|
|
||||||
{
|
|
||||||
return (uint8_t *) (SectorAddress);
|
|
||||||
}
|
|
||||||
static void read_description(uint8_t * array)
|
|
||||||
{
|
|
||||||
uint8_t x = 0;
|
|
||||||
for (uint32_t i = START_OF_USER_CODE + SIZE_OF_CODE; i < START_OF_USER_CODE + SIZE_OF_CODE + SIZE_OF_DESCRIPTION; ++i) {
|
|
||||||
array[x] = *FLASH_If_Read(i);
|
|
||||||
++x;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executed by event dispatcher callback to reset INS before resetting OP
|
* Executed by event dispatcher callback to reset INS before resetting OP
|
||||||
*/
|
*/
|
||||||
|
@ -322,11 +322,12 @@ static void gpsTask(void *parameters)
|
|||||||
else
|
else
|
||||||
{ // we appear to be receiving GPS sentences OK, we've had an update
|
{ // we appear to be receiving GPS sentences OK, we've had an update
|
||||||
|
|
||||||
|
GPSPositionGet(&GpsData);
|
||||||
|
|
||||||
#ifdef PIOS_GPS_SETS_HOMELOCATION
|
#ifdef PIOS_GPS_SETS_HOMELOCATION
|
||||||
HomeLocationData home;
|
HomeLocationData home;
|
||||||
HomeLocationGet(&home);
|
HomeLocationGet(&home);
|
||||||
|
|
||||||
GPSPositionGet(&GpsData);
|
|
||||||
if ((GpsData.Status == GPSPOSITION_STATUS_FIX3D) && (home.Set == HOMELOCATION_SET_FALSE))
|
if ((GpsData.Status == GPSPOSITION_STATUS_FIX3D) && (home.Set == HOMELOCATION_SET_FALSE))
|
||||||
setHomeLocation(&GpsData);
|
setHomeLocation(&GpsData);
|
||||||
#endif
|
#endif
|
||||||
|
@ -208,6 +208,7 @@ SRC += $(PIOSCOMMON)/pios_bmp085.c
|
|||||||
SRC += $(PIOSCOMMON)/pios_hcsr04.c
|
SRC += $(PIOSCOMMON)/pios_hcsr04.c
|
||||||
SRC += $(PIOSCOMMON)/pios_i2c_esc.c
|
SRC += $(PIOSCOMMON)/pios_i2c_esc.c
|
||||||
SRC += $(PIOSCOMMON)/pios_iap.c
|
SRC += $(PIOSCOMMON)/pios_iap.c
|
||||||
|
SRC += $(PIOSCOMMON)/pios_bl_helper.c
|
||||||
SRC += $(PIOSCOMMON)/printf-stdarg.c
|
SRC += $(PIOSCOMMON)/printf-stdarg.c
|
||||||
SRC += $(FLIGHTLIB)/ahrs_spi_comm.c
|
SRC += $(FLIGHTLIB)/ahrs_spi_comm.c
|
||||||
SRC += $(FLIGHTLIB)/ahrs_comm_objects.c
|
SRC += $(FLIGHTLIB)/ahrs_comm_objects.c
|
||||||
@ -459,31 +460,8 @@ LDFLAGS += -lc -lgcc
|
|||||||
# Set linker-script name depending on selected submodel name
|
# Set linker-script name depending on selected submodel name
|
||||||
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
|
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
||||||
# Options for OpenOCD flash-programming
|
# Program
|
||||||
# see openocd.pdf/openocd.texi for further information
|
|
||||||
#
|
|
||||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
|
||||||
# if OpenOCD is in the $PATH just set OOCD_EXE=openocd
|
|
||||||
OOCD_EXE=openocd
|
|
||||||
# debug level
|
|
||||||
OOCD_CL=-d0
|
|
||||||
# interface and board/target settings (using the OOCD target-library here)
|
|
||||||
UNAME := $(shell uname)
|
|
||||||
ifeq ($(UNAME), Darwin)
|
|
||||||
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.openpilot.osx.cfg -f ../Project/OpenOCD/stm32.cfg
|
|
||||||
else
|
|
||||||
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.openpilot.cfg -f ../Project/OpenOCD/stm32.cfg
|
|
||||||
endif
|
|
||||||
# initialize
|
|
||||||
OOCD_CL+=-c init
|
|
||||||
# show the targets
|
|
||||||
OOCD_CL+=-c targets
|
|
||||||
# commands to prepare flash-write
|
|
||||||
OOCD_CL+= -c "reset halt"
|
|
||||||
# flash erase
|
|
||||||
OOCD_CL+=-c "stm32x mass_erase 0"
|
|
||||||
# flash-write
|
|
||||||
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
||||||
# Verify
|
# Verify
|
||||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
||||||
@ -491,7 +469,7 @@ OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
|||||||
OOCD_CL+=-c "reset run"
|
OOCD_CL+=-c "reset run"
|
||||||
# terminate OOCD after programming
|
# terminate OOCD after programming
|
||||||
OOCD_CL+=-c shutdown
|
OOCD_CL+=-c shutdown
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# Define programs and commands.
|
# Define programs and commands.
|
||||||
REMOVE = $(REMOVE_CMD) -f
|
REMOVE = $(REMOVE_CMD) -f
|
||||||
|
@ -77,7 +77,6 @@ int32_t AlarmsSet(SystemAlarmsAlarmElem alarm, SystemAlarmsAlarmOptions severity
|
|||||||
{
|
{
|
||||||
alarms.Alarm[alarm] = severity;
|
alarms.Alarm[alarm] = severity;
|
||||||
SystemAlarmsSet(&alarms);
|
SystemAlarmsSet(&alarms);
|
||||||
SystemAlarmsUpdated(); // force telemetry update since the alarm was changed
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Release lock
|
// Release lock
|
||||||
|
@ -66,6 +66,7 @@
|
|||||||
#define PIOS_INCLUDE_RTC
|
#define PIOS_INCLUDE_RTC
|
||||||
#define PIOS_INCLUDE_WDG
|
#define PIOS_INCLUDE_WDG
|
||||||
#define PIOS_INCLUDE_I2C_ESC
|
#define PIOS_INCLUDE_I2C_ESC
|
||||||
|
#define PIOS_INCLUDE_BL_HELPER
|
||||||
|
|
||||||
/* Defaults for Logging */
|
/* Defaults for Logging */
|
||||||
#define LOG_FILENAME "PIOS.LOG"
|
#define LOG_FILENAME "PIOS.LOG"
|
||||||
|
@ -33,18 +33,19 @@
|
|||||||
#if defined(PIOS_INCLUDE_BL_HELPER)
|
#if defined(PIOS_INCLUDE_BL_HELPER)
|
||||||
#include "stm32f10x_flash.h"
|
#include "stm32f10x_flash.h"
|
||||||
|
|
||||||
uint8_t *FLASH_If_Read(uint32_t SectorAddress)
|
uint8_t *PIOS_BL_HELPER_FLASH_If_Read(uint32_t SectorAddress)
|
||||||
{
|
{
|
||||||
return (uint8_t *) (SectorAddress);
|
return (uint8_t *) (SectorAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t FLASH_Ini()
|
#if defined(PIOS_INCLUDE_BL_HELPER_WRITE_SUPPORT)
|
||||||
|
uint8_t PIOS_BL_HELPER_FLASH_Ini()
|
||||||
{
|
{
|
||||||
FLASH_Unlock();
|
FLASH_Unlock();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t FLASH_Start()
|
uint8_t PIOS_BL_HELPER_FLASH_Start()
|
||||||
{
|
{
|
||||||
uint32_t pageAdress;
|
uint32_t pageAdress;
|
||||||
pageAdress = START_OF_USER_CODE;
|
pageAdress = START_OF_USER_CODE;
|
||||||
@ -70,24 +71,27 @@ uint8_t FLASH_Start()
|
|||||||
|
|
||||||
return (fail == TRUE) ? 0 : 1;
|
return (fail == TRUE) ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
uint32_t crc_memory_calc()
|
uint32_t PIOS_BL_HELPER_CRC_Memory_Calc()
|
||||||
{
|
{
|
||||||
|
PIOS_BL_HELPER_CRC_Ini();
|
||||||
CRC_ResetDR();
|
CRC_ResetDR();
|
||||||
CRC_CalcBlockCRC((uint32_t *) START_OF_USER_CODE, (SIZE_OF_CODE) >> 2);
|
CRC_CalcBlockCRC((uint32_t *) START_OF_USER_CODE, (SIZE_OF_CODE) >> 2);
|
||||||
return CRC_GetCRC();
|
return CRC_GetCRC();
|
||||||
}
|
}
|
||||||
|
|
||||||
void read_description(uint8_t * array)
|
void PIOS_BL_HELPER_FLASH_Read_Description(uint8_t * array, uint8_t size)
|
||||||
{
|
{
|
||||||
uint8_t x = 0;
|
uint8_t x = 0;
|
||||||
for (uint32_t i = START_OF_USER_CODE + SIZE_OF_CODE; i < START_OF_USER_CODE + SIZE_OF_CODE + SIZE_OF_DESCRIPTION; ++i) {
|
if (size>SIZE_OF_DESCRIPTION) size = SIZE_OF_DESCRIPTION;
|
||||||
array[x] = *FLASH_If_Read(i);
|
for (uint32_t i = START_OF_USER_CODE + SIZE_OF_CODE; i < START_OF_USER_CODE + SIZE_OF_CODE + size; ++i) {
|
||||||
|
array[x] = *PIOS_BL_HELPER_FLASH_If_Read(i);
|
||||||
++x;
|
++x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRC_Ini()
|
void PIOS_BL_HELPER_CRC_Ini()
|
||||||
{
|
{
|
||||||
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_CRC, ENABLE);
|
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_CRC, ENABLE);
|
||||||
}
|
}
|
||||||
|
@ -134,6 +134,27 @@ uint32_t PIOS_SYS_getCPUFlashSize(void)
|
|||||||
return ((uint32_t) MEM16(0x1FFFF7E0) * 1000);
|
return ((uint32_t) MEM16(0x1FFFF7E0) * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the serial number as a string
|
||||||
|
* param[out] str pointer to a string which can store at least 32 digits + zero terminator!
|
||||||
|
* (24 digits returned for STM32)
|
||||||
|
* return < 0 if feature not supported
|
||||||
|
*/
|
||||||
|
int32_t PIOS_SYS_SerialNumberGetBinary(uint8_t *array)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
/* Stored in the so called "electronic signature" */
|
||||||
|
for (i = 0; i < 12; ++i) {
|
||||||
|
uint8_t b = MEM8(0x1ffff7e8 + i);
|
||||||
|
|
||||||
|
array[i] = b;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* No error */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the serial number as a string
|
* Returns the serial number as a string
|
||||||
* param[out] str pointer to a string which can store at least 32 digits + zero terminator!
|
* param[out] str pointer to a string which can store at least 32 digits + zero terminator!
|
||||||
|
@ -31,16 +31,16 @@
|
|||||||
#ifndef PIOS_BL_HELPER_H_
|
#ifndef PIOS_BL_HELPER_H_
|
||||||
#define PIOS_BL_HELPER_H_
|
#define PIOS_BL_HELPER_H_
|
||||||
|
|
||||||
extern uint8_t *FLASH_If_Read(uint32_t SectorAddress);
|
extern uint8_t *PIOS_BL_HELPER_FLASH_If_Read(uint32_t SectorAddress);
|
||||||
|
|
||||||
extern uint8_t FLASH_Ini();
|
extern uint8_t PIOS_BL_HELPER_FLASH_Ini();
|
||||||
|
|
||||||
extern uint32_t crc_memory_calc();
|
extern uint32_t PIOS_BL_HELPER_CRC_Memory_Calc();
|
||||||
|
|
||||||
extern void read_description(uint8_t * array);
|
extern void PIOS_BL_HELPER_FLASH_Read_Description(uint8_t * array, uint8_t size);
|
||||||
|
|
||||||
extern uint8_t FLASH_Start();
|
extern uint8_t PIOS_BL_HELPER_FLASH_Start();
|
||||||
|
|
||||||
extern void CRC_Ini();
|
extern void PIOS_BL_HELPER_CRC_Ini();
|
||||||
|
|
||||||
#endif /* PIOS_BL_HELPER_H_ */
|
#endif /* PIOS_BL_HELPER_H_ */
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
extern void PIOS_SYS_Init(void);
|
extern void PIOS_SYS_Init(void);
|
||||||
extern int32_t PIOS_SYS_Reset(void);
|
extern int32_t PIOS_SYS_Reset(void);
|
||||||
extern uint32_t PIOS_SYS_getCPUFlashSize(void);
|
extern uint32_t PIOS_SYS_getCPUFlashSize(void);
|
||||||
|
extern int32_t PIOS_SYS_SerialNumberGetBinary(uint8_t *array);
|
||||||
extern int32_t PIOS_SYS_SerialNumberGet(char *str);
|
extern int32_t PIOS_SYS_SerialNumberGet(char *str);
|
||||||
|
|
||||||
#endif /* PIOS_SYS_H */
|
#endif /* PIOS_SYS_H */
|
||||||
|
@ -349,40 +349,15 @@ LDFLAGS += -lc -lgcc
|
|||||||
# Set linker-script name depending on selected submodel name
|
# Set linker-script name depending on selected submodel name
|
||||||
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
|
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
||||||
# Options for OpenOCD flash-programming
|
# Program
|
||||||
# see openocd.pdf/openocd.texi for further information
|
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
||||||
#
|
|
||||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
|
||||||
# if OpenOCD is in the $PATH just set OPENOCDEXE=openocd
|
|
||||||
OOCD_EXE=openocd
|
|
||||||
# debug level
|
|
||||||
OOCD_CL=-d0
|
|
||||||
# interface and board/target settings (using the OOCD target-library here)
|
|
||||||
UNAME := $(shell uname)
|
|
||||||
ifeq ($(UNAME), Darwin)
|
|
||||||
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.pipxtreme.osx.cfg -f ../Project/OpenOCD/stm32.cfg
|
|
||||||
else
|
|
||||||
OOCD_CL+=-f ../Project/OpenOCD/floss-jtag.pipxtreme.cfg -f ../Project/OpenOCD/stm32.cfg
|
|
||||||
endif
|
|
||||||
# initialize
|
|
||||||
OOCD_CL+=-c init
|
|
||||||
# show the targets
|
|
||||||
OOCD_CL+=-c targets
|
|
||||||
# commands to prepare flash-write
|
|
||||||
OOCD_CL+= -c "reset halt"
|
|
||||||
# flash erase
|
|
||||||
OOCD_CL+=-c "stm32x mass_erase 0"
|
|
||||||
# flash-write
|
|
||||||
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
|
||||||
# Verify
|
# Verify
|
||||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
||||||
# reset target
|
# reset target
|
||||||
OOCD_CL+=-c "reset run"
|
OOCD_CL+=-c "reset run"
|
||||||
# terminate OOCD after programming
|
# terminate OOCD after programming
|
||||||
OOCD_CL+=-c shutdown
|
OOCD_CL+=-c shutdown
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
# Define programs and commands.
|
# Define programs and commands.
|
||||||
REMOVE = $(REMOVE_CMD) -f
|
REMOVE = $(REMOVE_CMD) -f
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
#
|
|
||||||
# Floss JTAG for AHRS
|
|
||||||
#
|
|
||||||
|
|
||||||
interface ft2232
|
|
||||||
ft2232_vid_pid 0x0403 0x6010
|
|
||||||
ft2232_device_desc "Dual RS232-HS"
|
|
||||||
#ft2232_bus_addr "002:103"
|
|
||||||
#ft2232_serial "1234567890"
|
|
||||||
ft2232_layout "usbjtag"
|
|
||||||
ft2232_latency 2
|
|
||||||
|
|
||||||
gdb_port 3334
|
|
||||||
tcl_port 6667
|
|
||||||
telnet_port 4445
|
|
@ -1,15 +0,0 @@
|
|||||||
#
|
|
||||||
# Floss JTAG OpenPilot
|
|
||||||
#
|
|
||||||
|
|
||||||
interface ft2232
|
|
||||||
ft2232_vid_pid 0x0403 0x6010
|
|
||||||
ft2232_device_desc "Dual RS232-HS"
|
|
||||||
#ft2232_bus_addr "002:088"
|
|
||||||
#ft2232_serial "1234567890"
|
|
||||||
ft2232_layout "usbjtag"
|
|
||||||
ft2232_latency 2
|
|
||||||
|
|
||||||
gdb_port 3333
|
|
||||||
tcl_port 6666
|
|
||||||
telnet_port 4444
|
|
@ -1,15 +0,0 @@
|
|||||||
#
|
|
||||||
# Floss JTAG OpenPilot
|
|
||||||
#
|
|
||||||
|
|
||||||
interface ft2232
|
|
||||||
ft2232_vid_pid 0x0403 0x6010
|
|
||||||
#ft2232_device_desc "Dual RS232-HS"
|
|
||||||
#ft2232_bus_addr "002:088"
|
|
||||||
#ft2232_serial "1234567890"
|
|
||||||
ft2232_layout "usbjtag"
|
|
||||||
ft2232_latency 2
|
|
||||||
|
|
||||||
gdb_port 3333
|
|
||||||
tcl_port 6666
|
|
||||||
telnet_port 4444
|
|
@ -1,15 +0,0 @@
|
|||||||
#
|
|
||||||
# Floss JTAG for AHRS
|
|
||||||
#
|
|
||||||
|
|
||||||
interface ft2232
|
|
||||||
ft2232_vid_pid 0x0403 0x6010
|
|
||||||
ft2232_device_desc "Dual RS232-HS"
|
|
||||||
#ft2232_bus_addr "002:103"
|
|
||||||
#ft2232_serial "1234567890"
|
|
||||||
ft2232_layout "usbjtag"
|
|
||||||
ft2232_latency 2
|
|
||||||
|
|
||||||
gdb_port 3334
|
|
||||||
tcl_port 6667
|
|
||||||
telnet_port 4445
|
|
@ -1,15 +0,0 @@
|
|||||||
#
|
|
||||||
# Floss JTAG OpenPilot
|
|
||||||
#
|
|
||||||
|
|
||||||
interface ft2232
|
|
||||||
ft2232_vid_pid 0x0403 0x6010
|
|
||||||
#ft2232_device_desc "Dual RS232-HS"
|
|
||||||
#ft2232_bus_addr "002:088"
|
|
||||||
#ft2232_serial "1234567890"
|
|
||||||
ft2232_layout "usbjtag"
|
|
||||||
ft2232_latency 2
|
|
||||||
|
|
||||||
gdb_port 3334
|
|
||||||
tcl_port 6666
|
|
||||||
telnet_port 4444
|
|
@ -1,5 +1,5 @@
|
|||||||
define connect
|
define connect
|
||||||
target remote localhost:3334
|
target remote localhost:3333
|
||||||
monitor cortex_m3 vector_catch all
|
monitor cortex_m3 vector_catch all
|
||||||
file ./Build/PipXtreme.elf
|
file ./Build/PipXtreme.elf
|
||||||
end
|
end
|
||||||
|
@ -63,10 +63,10 @@ typedef struct {
|
|||||||
uint8_t gcsAccess; /** Defines the access level for the local GCS transactions (readonly and readwrite), not used in the flight s/w */
|
uint8_t gcsAccess; /** Defines the access level for the local GCS transactions (readonly and readwrite), not used in the flight s/w */
|
||||||
uint8_t telemetryAcked; /** Defines if an ack is required for the transactions of this object (1:acked, 0:not acked) */
|
uint8_t telemetryAcked; /** Defines if an ack is required for the transactions of this object (1:acked, 0:not acked) */
|
||||||
uint8_t telemetryUpdateMode; /** Update mode used by the telemetry module (UAVObjUpdateMode) */
|
uint8_t telemetryUpdateMode; /** Update mode used by the telemetry module (UAVObjUpdateMode) */
|
||||||
int32_t telemetryUpdatePeriod; /** Update period used by the telemetry module (only if telemetry mode is PERIODIC) */
|
uint32_t telemetryUpdatePeriod; /** Update period used by the telemetry module (only if telemetry mode is PERIODIC) */
|
||||||
uint8_t gcsTelemetryAcked; /** Defines if an ack is required for the transactions of this object (1:acked, 0:not acked) */
|
uint8_t gcsTelemetryAcked; /** Defines if an ack is required for the transactions of this object (1:acked, 0:not acked) */
|
||||||
uint8_t gcsTelemetryUpdateMode; /** Update mode used by the GCS (UAVObjUpdateMode) */
|
uint8_t gcsTelemetryUpdateMode; /** Update mode used by the GCS (UAVObjUpdateMode) */
|
||||||
int32_t gcsTelemetryUpdatePeriod; /** Update period used by the GCS (only if telemetry mode is PERIODIC) */
|
uint32_t gcsTelemetryUpdatePeriod; /** Update period used by the GCS (only if telemetry mode is PERIODIC) */
|
||||||
uint8_t loggingUpdateMode; /** Update mode used by the logging module (UAVObjUpdateMode) */
|
uint8_t loggingUpdateMode; /** Update mode used by the logging module (UAVObjUpdateMode) */
|
||||||
uint32_t loggingUpdatePeriod; /** Update period used by the logging module (only if logging mode is PERIODIC) */
|
uint32_t loggingUpdatePeriod; /** Update period used by the logging module (only if logging mode is PERIODIC) */
|
||||||
} __attribute__((packed)) UAVObjMetadata;
|
} __attribute__((packed)) UAVObjMetadata;
|
||||||
|
@ -408,7 +408,7 @@ bool UAVTalk::receiveObject(quint8 type, quint32 objId, quint16 instId, quint8*
|
|||||||
|
|
||||||
UAVObject* obj = NULL;
|
UAVObject* obj = NULL;
|
||||||
bool error = false;
|
bool error = false;
|
||||||
bool allInstances = (instId == ALL_INSTANCES? true : false);
|
bool allInstances = (instId == ALL_INSTANCES);
|
||||||
|
|
||||||
// Process message type
|
// Process message type
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -143,3 +143,25 @@ $($(1):.c=.s) : %.s : %.c
|
|||||||
$(V1) $(CC) -S $$(CFLAGS) $$(CONLYFLAGS) $$< -o $$@
|
$(V1) $(CC) -S $$(CFLAGS) $$(CONLYFLAGS) $$< -o $$@
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# # Options for OpenOCD flash-programming
|
||||||
|
# see openocd.pdf/openocd.texi for further information
|
||||||
|
# #
|
||||||
|
# OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
||||||
|
# if OpenOCD is in the $PATH just set OPENOCDEXE=openocd
|
||||||
|
OOCD_EXE=openocd
|
||||||
|
# debug level
|
||||||
|
OOCD_CL=-d0
|
||||||
|
# interface and board/target settings (using the OOCD target-library here)
|
||||||
|
OOCD_CL+=-s $(TOP)/flight/Project/OpenOCD
|
||||||
|
OOCD_CL+=-f foss-jtag.revb.cfg -f stm32.cfg
|
||||||
|
|
||||||
|
# initialize
|
||||||
|
OOCD_CL+=-c init
|
||||||
|
# show the targets
|
||||||
|
OOCD_CL+=-c targets
|
||||||
|
# commands to prepare flash-write
|
||||||
|
OOCD_CL+= -c "reset halt"
|
||||||
|
# flash erase
|
||||||
|
OOCD_CL+=-c "stm32x mass_erase 0"
|
||||||
|
# flash-write
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
<xml>
|
<xml>
|
||||||
<object name="FirmwareIAPObj" singleinstance="true" settings="false">
|
<object name="FirmwareIAPObj" singleinstance="true" settings="false">
|
||||||
<description>Firmware IAP</description>
|
<description>Queries board for SN, model, revision, and sends reset command</description>
|
||||||
<field name="Command" units="" type="uint16" elements="1"/>
|
<field name="Command" units="" type="uint16" elements="1"/>
|
||||||
<field name="Description" units="" type="uint8" elements="100"/>
|
<field name="Description" units="" type="uint8" elements="40"/>
|
||||||
|
<field name="CPUSerial" units="" type="uint8" elements="12" />
|
||||||
<field name="BoardRevision" units="" type="uint16" elements="1"/>
|
<field name="BoardRevision" units="" type="uint16" elements="1"/>
|
||||||
<field name="BoardType" units="" type="uint8" elements="1"/>
|
<field name="BoardType" units="" type="uint8" elements="1"/>
|
||||||
<field name="ArmReset" units="" type="uint8" elements="1"/>
|
<field name="ArmReset" units="" type="uint8" elements="1"/>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
elementnames="OutOfMemory,StackOverflow,CPUOverload,EventSystem,SDCard,Telemetry,ManualControl,Actuator,Attitude,Stabilization,Guidance,AHRSComms,Battery,FlightTime,I2C,GPS" defaultvalue="Uninitialised"/>
|
elementnames="OutOfMemory,StackOverflow,CPUOverload,EventSystem,SDCard,Telemetry,ManualControl,Actuator,Attitude,Stabilization,Guidance,AHRSComms,Battery,FlightTime,I2C,GPS" defaultvalue="Uninitialised"/>
|
||||||
<access gcs="readwrite" flight="readwrite"/>
|
<access gcs="readwrite" flight="readwrite"/>
|
||||||
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
|
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
|
||||||
<telemetryflight acked="true" updatemode="periodic" period="4000"/>
|
<telemetryflight acked="true" updatemode="onchange" period="0"/>
|
||||||
<logging updatemode="periodic" period="1000"/>
|
<logging updatemode="periodic" period="1000"/>
|
||||||
</object>
|
</object>
|
||||||
</xml>
|
</xml>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user