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

Updated open_bootloader to SDK 17.0.2 #47

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
40 changes: 21 additions & 19 deletions examples/nrf5-sdk/open_bootloader/armgcc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ PROJECT_NAME := nrf52840_mdk_usb_dongle_open_bootloader
TARGETS := nrf52840_xxaa
OUTPUT_DIRECTORY := _build
FW_VERSION_MAJOR := 1
FW_VERSION_MINOR := 2
FW_VERSION_MINOR := 3
FW_VERSION_PATCH := 0
FW_VERSION := $(FW_VERSION_MAJOR).$(FW_VERSION_MINOR).$(FW_VERSION_PATCH)

MDK_ROOT := ../../../..
SDK_ROOT := $(MDK_ROOT)/nrf_sdks/nRF5_SDK_15.2.0_9412b96
SDK_ROOT := $(MDK_ROOT)/nrf_sdks/nRF5_SDK_17.0.2_d674dde
PROJ_DIR := ..

$(OUTPUT_DIRECTORY)/nrf52840_xxaa.out: \
Expand All @@ -28,15 +28,15 @@ SRC_FILES += \
$(SDK_ROOT)/components/libraries/crypto/backend/cc310_bl/cc310_bl_backend_shared.c \
$(SDK_ROOT)/components/libraries/util/app_error_weak.c \
$(SDK_ROOT)/components/libraries/scheduler/app_scheduler.c \
$(SDK_ROOT)/components/libraries/timer/experimental/app_timer2.c \
$(SDK_ROOT)/components/libraries/timer/app_timer2.c \
$(SDK_ROOT)/components/libraries/usbd/app_usbd.c \
$(SDK_ROOT)/components/libraries/usbd/class/cdc/acm/app_usbd_cdc_acm.c \
$(SDK_ROOT)/components/libraries/usbd/app_usbd_core.c \
$(SDK_ROOT)/components/libraries/usbd/app_usbd_serial_num.c \
$(SDK_ROOT)/components/libraries/usbd/app_usbd_string_desc.c \
$(SDK_ROOT)/components/libraries/util/app_util_platform.c \
$(SDK_ROOT)/components/libraries/crc32/crc32.c \
$(SDK_ROOT)/components/libraries/timer/experimental/drv_rtc.c \
$(SDK_ROOT)/components/libraries/timer/drv_rtc.c \
$(SDK_ROOT)/components/libraries/led_softblink/led_softblink.c \
$(SDK_ROOT)/components/libraries/low_power_pwm/low_power_pwm.c \
$(SDK_ROOT)/components/libraries/mem_manager/mem_manager.c \
Expand All @@ -56,13 +56,14 @@ SRC_FILES += \
$(SDK_ROOT)/components/libraries/slip/slip.c \
$(SDK_ROOT)/integration/nrfx/legacy/nrf_drv_clock.c \
$(SDK_ROOT)/integration/nrfx/legacy/nrf_drv_power.c \
$(SDK_ROOT)/components/drivers_nrf/usbd/nrf_drv_usbd.c \
$(SDK_ROOT)/components/drivers_nrf/nrf_soc_nosd/nrf_nvic.c \
$(SDK_ROOT)/modules/nrfx/hal/nrf_nvmc.c \
$(SDK_ROOT)/components/drivers_nrf/nrf_soc_nosd/nrf_soc.c \
$(SDK_ROOT)/modules/nrfx/soc/nrfx_atomic.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_clock.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_power.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_power_clock.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_systick.c \
$(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_usbd.c \
$(SDK_ROOT)/components/libraries/crypto/nrf_crypto_ecc.c \
$(SDK_ROOT)/components/libraries/crypto/nrf_crypto_ecdsa.c \
$(SDK_ROOT)/components/libraries/crypto/nrf_crypto_hash.c \
Expand Down Expand Up @@ -112,7 +113,6 @@ INC_FOLDERS += \
$(SDK_ROOT)/components/libraries/fstorage \
$(SDK_ROOT)/components/libraries/util \
$(SDK_ROOT)/modules/nrfx \
$(SDK_ROOT)/components/libraries/timer/experimental \
$(SDK_ROOT)/components/libraries/timer \
$(SDK_ROOT)/components/libraries/log \
$(SDK_ROOT)/components/libraries/crypto/backend/oberon \
Expand All @@ -122,7 +122,6 @@ INC_FOLDERS += \
$(SDK_ROOT)/integration/nrfx \
$(SDK_ROOT)/components/libraries/crypto/backend/cc310_bl \
$(SDK_ROOT)/components/drivers_nrf/nrf_soc_nosd \
$(SDK_ROOT)/components/softdevice/mbr/nrf52840/headers \
$(SDK_ROOT)/components/libraries/log/src \
$(SDK_ROOT)/components/libraries/bootloader/dfu \
$(SDK_ROOT)/components/libraries/bootloader/serial_dfu \
Expand All @@ -140,33 +139,34 @@ INC_FOLDERS += \
$(SDK_ROOT)/components/boards \
$(SDK_ROOT)/components/libraries/crypto/backend/cc310 \
$(SDK_ROOT)/components/libraries/bootloader \
$(SDK_ROOT)/external/fprintf \
$(SDK_ROOT)/components/softdevice/mbr/headers \
$(SDK_ROOT)/components/libraries/crypto \
$(MDK_ROOT)/config \
$(PROJ_DIR)/config \
$(SDK_ROOT)/components/libraries/crypto/backend/optiga \
$(SDK_ROOT)/components/libraries/scheduler \
$(SDK_ROOT)/components/libraries/slip \
$(SDK_ROOT)/modules/nrfx/hal \
$(SDK_ROOT)/external/utf_converter \
$(SDK_ROOT)/external/fprintf \
$(SDK_ROOT)/components/toolchain/cmsis/include \
$(SDK_ROOT)/components/libraries/usbd/class/cdc/acm \
$(SDK_ROOT)/components/libraries/balloc \
$(SDK_ROOT)/components/libraries/atomic_fifo \
$(PROJ_DIR) \
$(SDK_ROOT)/components/libraries/sortlist \
$(SDK_ROOT)/external/utf_converter \
$(SDK_ROOT)/components/libraries/crypto/backend/nrf_sw \
$(SDK_ROOT)/modules/nrfx/mdk \
$(SDK_ROOT)/external/nrf_cc310/include \
$(SDK_ROOT)/external/nano-pb \
$(SDK_ROOT)/components/libraries/queue \
$(SDK_ROOT)/components/libraries/mutex \
$(SDK_ROOT)/components/drivers_nrf/usbd \
$(SDK_ROOT)/components/libraries/ringbuf \

# Libraries common to all targets
LIB_FILES += \
$(SDK_ROOT)/external/nrf_oberon/lib/nrf52/liboberon_2.0.5.a \
$(SDK_ROOT)/external/nrf_cc310_bl/lib/libnrf_cc310_bl_0.9.10.a \
$(SDK_ROOT)/external/nrf_oberon/lib/cortex-m4/hard-float/liboberon_3.0.6.a \
$(SDK_ROOT)/external/nrf_cc310_bl/lib/cortex-m4/hard-float/libnrf_cc310_bl_0.9.13.a \

# Optimization flags
OPT = -Os -g3
Expand All @@ -182,8 +182,9 @@ CFLAGS += -DNRF52840_MDK_USB_DONGLE
# Note: Comment CONFIG_GPIO_AS_PINRESET for nRF52840-MDK USB Dongle!
#CFLAGS += -DCONFIG_GPIO_AS_PINRESET
CFLAGS += -DFLOAT_ABI_HARD
CFLAGS += -DMBR_PRESENT
CFLAGS += -DNRF52840_XXAA
CFLAGS += -DNRF_DFU_SETTINGS_VERSION=1
CFLAGS += -DNRF_DFU_SETTINGS_VERSION=2
CFLAGS += -DSVC_INTERFACE_CALL_AS_NORMAL_FUNCTION
CFLAGS += -mcpu=cortex-m4
CFLAGS += -mthumb -mabi=aapcs
Expand All @@ -208,8 +209,9 @@ ASMFLAGS += -DNRF52840_MDK_USB_DONGLE
# Note: Comment CONFIG_GPIO_AS_PINRESET for nRF52840-MDK USB Dongle!
#ASMFLAGS += -DCONFIG_GPIO_AS_PINRESET
ASMFLAGS += -DFLOAT_ABI_HARD
ASMFLAGS += -DMBR_PRESENT
ASMFLAGS += -DNRF52840_XXAA
ASMFLAGS += -DNRF_DFU_SETTINGS_VERSION=1
ASMFLAGS += -DNRF_DFU_SETTINGS_VERSION=2
ASMFLAGS += -DSVC_INTERFACE_CALL_AS_NORMAL_FUNCTION

# Linker flags
Expand Down Expand Up @@ -259,16 +261,16 @@ flash: default

# Flash softdevice
flash_mbr:
@echo Flashing: mbr_nrf52_2.3.0_mbr.hex
pyocd flash -t nrf52840 -e sector --format hex $(SDK_ROOT)/components/softdevice/mbr/nrf52840/hex/mbr_nrf52_2.3.0_mbr.hex
@echo Flashing: mbr_nrf52_2.4.1_mbr.hex
pyocd flash -t nrf52840 -e sector --format hex $(SDK_ROOT)/components/softdevice/mbr/hex/mbr_nrf52_2.4.1_mbr.hex

erase:
pyocd erase -t nrf52840 -c

# Merge bootloader and mbr
merge_mbr: default
@echo Merging: mbr_nrf52_2.3.0_mbr.hex and nrf52840_xxaa.hex
mergehex -m $(SDK_ROOT)/components/softdevice/mbr/nrf52840/hex/mbr_nrf52_2.3.0_mbr.hex $(OUTPUT_DIRECTORY)/nrf52840_xxaa.hex -o $(OUTPUT_DIRECTORY)/nrf52840_xxaa_mbr.hex
@echo Merging: mbr_nrf52_2.4.1_mbr.hex and nrf52840_xxaa.hex
mergehex -m $(SDK_ROOT)/components/softdevice/mbr/hex/mbr_nrf52_2.4.1_mbr.hex $(OUTPUT_DIRECTORY)/nrf52840_xxaa.hex -o $(OUTPUT_DIRECTORY)/nrf52840_xxaa_mbr.hex

pkg: merge_mbr
@echo Generating DFU package...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,41 @@ MEMORY
FLASH (rx) : ORIGIN = 0xe0000, LENGTH = 0x1e000
RAM (rwx) : ORIGIN = 0x20000008, LENGTH = 0x3fff8
uicr_bootloader_start_address (r) : ORIGIN = 0x10001014, LENGTH = 0x4
mbr_params_page (r) : ORIGIN = 0x000FE000, LENGTH = 0x1000
bootloader_settings_page (r) : ORIGIN = 0x000FF000, LENGTH = 0x1000
uicr_mbr_params_page (r) : ORIGIN = 0x10001018, LENGTH = 0x4
mbr_params_page (r) : ORIGIN = 0x000FE000, LENGTH = 0x1000
}

SECTIONS
{
. = ALIGN(4);
.uicr_bootloader_start_address :
{
PROVIDE(__start_uicr_bootloader_start_address = .);
KEEP(*(SORT(.uicr_bootloader_start_address*)))
PROVIDE(__stop_uicr_bootloader_start_address = .);
} > uicr_bootloader_start_address
.mbr_params_page(NOLOAD) :
{
PROVIDE(__start_mbr_params_page = .);
KEEP(*(SORT(.mbr_params_page*)))
PROVIDE(__stop_mbr_params_page = .);
} > mbr_params_page
. = ALIGN(4);
.bootloader_settings_page(NOLOAD) :
{
PROVIDE(__start_bootloader_settings_page = .);
KEEP(*(SORT(.bootloader_settings_page*)))
PROVIDE(__stop_bootloader_settings_page = .);
} > bootloader_settings_page
. = ALIGN(4);
.uicr_mbr_params_page :
{
PROVIDE(__start_uicr_mbr_params_page = .);
KEEP(*(SORT(.uicr_mbr_params_page*)))
PROVIDE(__stop_uicr_mbr_params_page = .);
} > uicr_mbr_params_page
. = ALIGN(4);
.mbr_params_page(NOLOAD) :
{
PROVIDE(__start_mbr_params_page = .);
KEEP(*(SORT(.mbr_params_page*)))
PROVIDE(__stop_mbr_params_page = .);
} > mbr_params_page
}

SECTIONS
Expand Down Expand Up @@ -112,4 +116,5 @@ SECTIONS

} INSERT AFTER .text


INCLUDE "nrf_common.ld"
Loading