Skip to content

Commit

Permalink
Allow specification of EXST flash chip.
Browse files Browse the repository at this point in the history
e.g.

```
make CONFIG=SPRACINGH7EXTREME EXST_FLASH_CHIP=W25N01GV
make CONFIG=SPRACINGH7EXTREME EXST_FLASH_CHIP=W25Q128JV
```

If flash chip is not specified, the target configured default one is
used.

Flash chip and load address is added to the build file.

e.g.

```
./obj/betaflight_4.2.0_SPRACINGH7EXTREME-W25N01GV_<revision>.bin
./obj/betaflight_4.2.0_SPRACINGH7EXTREME-W25Q128JV_<norevision>.bin
```
  • Loading branch information
hydra committed Apr 3, 2024
1 parent 7c17023 commit c3a3901
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ OPTIONS ?=

# compile for External Storage Bootloader support
EXST ?= no
EXST_FLASH_CHIP ?=

# compile for target loaded into RAM
RAM_BASED ?= no
Expand All @@ -48,6 +49,7 @@ SERIAL_DEVICE ?= $(firstword $(wildcard /dev/ttyACM*) $(firstword $(wildcard /
# Flash size (KB). Some low-end chips actually have more flash than advertised, use this to override.
FLASH_SIZE ?=


###############################################################################
# Things that need to be maintained as the source changes
#
Expand Down Expand Up @@ -316,6 +318,10 @@ ifeq ($(REV),yes)
TARGET_NAME := $(TARGET_NAME)_$(REVISION)
endif

ifeq ($(EXST),yes)
TARGET_NAME := $(TARGET_NAME)-$(EXST_FLASH_CHIP)
endif

TARGET_FULLNAME = $(FORKNAME)_$(FC_VER)_$(TARGET_NAME)
#
# Things we will build
Expand Down
21 changes: 21 additions & 0 deletions src/main/target/STM32H750/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,24 @@ ifneq ($(EXST),yes)
TARGET_FLASH_SIZE := 1024
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_h750_1m.ld
endif

ifeq ($(EXST),yes)
# EXST flash chip configuration

ifeq ($(EXST_FLASH_CHIP),)
EXST_FLASH_CHIP = W25N01GV
endif

ifeq ($(EXST_FLASH_CHIP),W25N01GV)
EXST_ADJUST_VMA = 0x97CE0000 # 128MB NAND flash
else
ifeq ($(EXST_FLASH_CHIP),W25Q128JV)
EXST_ADJUST_VMA = 0x90F90000 # 16MB NOR flash
endif
endif

#ifeq ($(EXST_ADJUST_VMA),)
#EXST_ADJUST_VMA = 0x97CE0000
#endif

endif

0 comments on commit c3a3901

Please sign in to comment.