Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flash with more than 512kb #214

Merged
merged 4 commits into from
Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,17 @@ ifeq ($(MCU_SUB_VARIANT),nrf52)
SD_NAME = s132
DFU_DEV_REV = 0xADAF
CFLAGS += -DNRF52 -DNRF52832_XXAA -DS132
CFLAGS += -DDFU_APP_DATA_RESERVED=7*4096
else ifeq ($(MCU_SUB_VARIANT),nrf52833)
SD_NAME = s140
DFU_DEV_REV = 52840
CFLAGS += -DNRF52833_XXAA -DS140
CFLAGS += -DDFU_APP_DATA_RESERVED=7*4096
else ifeq ($(MCU_SUB_VARIANT),nrf52840)
SD_NAME = s140
DFU_DEV_REV = 52840
CFLAGS += -DNRF52840_XXAA -DS140
CFLAGS += -DDFU_APP_DATA_RESERVED=10*4096
else
$(error Sub Variant $(MCU_SUB_VARIANT) is unknown)
endif
Expand Down Expand Up @@ -232,15 +235,6 @@ IPATH += $(SD_PATH)/$(SD_FILENAME)_API/include/nrf52
# Compiler Flags
#------------------------------------------------------------------------------

# Debug option use RTT for printf
ifeq ($(DEBUG), 1)
RTT_SRC = lib/SEGGER_RTT

CFLAGS += -DCFG_DEBUG -DSEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
IPATH += $(RTT_SRC)/RTT
C_SRC += $(RTT_SRC)/RTT/SEGGER_RTT.c
endif

#flags common to all targets
CFLAGS += \
-mthumb \
Expand Down Expand Up @@ -286,14 +280,21 @@ ifneq ($(USE_NFCT),yes)
endif

CFLAGS += -DSOFTDEVICE_PRESENT
CFLAGS += -DDFU_APP_DATA_RESERVED=7*4096

CFLAGS += -DUF2_VERSION='"$(GIT_VERSION) $(GIT_SUBMODULE_VERSIONS)"'
CFLAGS += -DBLEDIS_FW_VERSION='"$(GIT_VERSION) $(SD_NAME) $(SD_VERSION)"'

_VER = $(subst ., ,$(word 1, $(subst -, ,$(GIT_VERSION))))
CFLAGS += -DMK_BOOTLOADER_VERSION='($(word 1,$(_VER)) << 16) + ($(word 2,$(_VER)) << 8) + $(word 3,$(_VER))'

# Debug option use RTT for printf
ifeq ($(DEBUG), 1)
RTT_SRC = lib/SEGGER_RTT

CFLAGS += -DCFG_DEBUG -DCFG_TUSB_DEBUG=1 -DSEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
IPATH += $(RTT_SRC)/RTT
C_SRC += $(RTT_SRC)/RTT/SEGGER_RTT.c
endif

#------------------------------------------------------------------------------
# Linker Flags
#------------------------------------------------------------------------------
Expand Down
Loading