Skip to content

Commit

Permalink
Revert "Remove OpenPilot bootloader support."
Browse files Browse the repository at this point in the history
This reverts commit 0150abf.

Conflicts:
	src/main/target/CC3D/target.h
  • Loading branch information
borisbstyle committed Oct 15, 2015
1 parent e25087b commit 05dec6c
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 10 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ env:
- PUBLISHMETA=True
- PUBLISHDOCS=True
- TARGET=CC3D
- TARGET=CC3D OPBL=yes
- TARGET=COLIBRI_RACE
- TARGET=CHEBUZZF3
- TARGET=CJMCU
Expand Down
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ TARGET ?= NAZE
# Compile-time options
OPTIONS ?=

# compile for OpenPilot BootLoader support
OPBL ?=no

# Debugger optons, must be empty or GDB
DEBUG ?=

Expand All @@ -37,6 +40,9 @@ FORKNAME = betaflight

VALID_TARGETS = NAZE NAZE32PRO OLIMEXINO STM32F3DISCOVERY CHEBUZZF3 CC3D CJMCU EUSTM32F103RC SPRACINGF3 PORT103R SPARKY ALIENWIIF1 ALIENWIIF3 COLIBRI_RACE MOTOLAB RMDO

# Valid targets for OP BootLoader support
OPBL_VALID_TARGETS = CC3D

# Configure default flash sizes for the targets
ifeq ($(FLASH_SIZE),)
ifeq ($(TARGET),$(filter $(TARGET),CJMCU))
Expand Down Expand Up @@ -404,6 +410,16 @@ OLIMEXINO_SRC = startup_stm32f10x_md_gcc.S \
$(HIGHEND_SRC) \
$(COMMON_SRC)

ifeq ($(OPBL),yes)
ifneq ($(filter $(TARGET),$(OPBL_VALID_TARGETS)),)
TARGET_FLAGS := -DOPBL $(TARGET_FLAGS)
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f103_$(FLASH_SIZE)k_opbl.ld
.DEFAULT_GOAL := binary
else
$(error OPBL specified with a unsupported target)
endif
endif

CJMCU_SRC = \
startup_stm32f10x_md_gcc.S \
drivers/adc.c \
Expand Down
2 changes: 2 additions & 0 deletions docs/Sonar.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Current meter cannot be used in conjunction with Sonar.
| ------------- | ------------- | ------------------- |
| PB5 | PB0 | YES (3.3v input) |

Sonar support is not available when using the OpenPilot bootloader (OPBL).

#### Constraints

Sonar cannot be used in conjuction with SoftSerial or Parallel PWM.
6 changes: 6 additions & 0 deletions docs/development/Building in Mac OS X.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,9 @@ git pull
make clean TARGET=NAZE
make TARGET=NAZE
```

Or in the case of CC3D in need of a `obj/cleanflight_CC3D.bin`
```
make clean TARGET=CC3D
make TARGET=CC3D OPBL=yes
```
3 changes: 2 additions & 1 deletion fake_travis_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
targets=("PUBLISHMETA=True" \
"RUNTESTS=True" \
"TARGET=CC3D" \
"TARGET=CC3D OPBL=yes" \
"TARGET=CHEBUZZF3" \
"TARGET=CJMCU" \
"TARGET=COLIBRI_RACE" \
Expand All @@ -25,7 +26,7 @@ export TRAVIS_REPO_SLUG=${TRAVIS_REPO_SLUG:=$USER/simulated}

for target in "${targets[@]}"
do
unset RUNTESTS PUBLISHMETA TARGET
unset RUNTESTS PUBLISHMETA TARGET OPBL
eval "export $target"
make clean
./.travis.sh
Expand Down
11 changes: 2 additions & 9 deletions src/main/target/CC3D/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,13 @@
#define S1W_RX_GPIO GPIOB
#define S1W_RX_PIN GPIO_Pin_11

#if defined(OPBL)
// disabled some features for OPBL build due to code size.
#undef AUTOTUNE
#undef BARO
#if defined(OPBL) && defined(USE_SERIAL_1WIRE)
#undef DISPLAY
#undef SONAR
#undef BARO
#define SKIP_CLI_COMMAND_HELP
#endif

#if defined(OPBL) && defined(USE_SERIAL_1WIRE)
#undef DISPLAY
#endif


#define SPEKTRUM_BIND
// USART3, PB11 (Flexport)
#define BIND_PORT GPIOB
Expand Down
21 changes: 21 additions & 0 deletions src/main/target/stm32_flash_f103_128k_opbl.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
*****************************************************************************
**
** File : stm32_flash.ld
**
** Abstract : Linker script for STM32F103CB Device with
** 128KByte FLASH, 20KByte RAM
**
*****************************************************************************
*/

/* Specify the memory areas. */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08003000, LENGTH = 126K - 0x03000 /* last 2kb used for config storage first 12k for OP Bootloader*/

RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K
MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
}

INCLUDE "stm32_flash.ld"

0 comments on commit 05dec6c

Please sign in to comment.