From ce9f05f91b964c1f55d223fe06588ce08e076659 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 24 Apr 2018 00:51:44 +0700 Subject: [PATCH] add missing files --- .../bluefruit_nrf52840_s140_6.0.0.ld | 8 +++---- ports/nrf/boards/feather52840/mpconfigboard.h | 2 +- .../boards/feather52840/mpconfigboard_s140.mk | 12 +++++++---- .../nrf/drivers/bluetooth/bluetooth_common.mk | 6 +++++- .../drivers/bluetooth/download_ble_stack.sh | 21 +++++++++++++++++++ 5 files changed, 39 insertions(+), 10 deletions(-) diff --git a/ports/nrf/boards/feather52840/bluefruit_nrf52840_s140_6.0.0.ld b/ports/nrf/boards/feather52840/bluefruit_nrf52840_s140_6.0.0.ld index b5f36062499c..9882df4bbd47 100644 --- a/ports/nrf/boards/feather52840/bluefruit_nrf52840_s140_6.0.0.ld +++ b/ports/nrf/boards/feather52840/bluefruit_nrf52840_s140_6.0.0.ld @@ -13,8 +13,8 @@ 0x000F2000..0x000F2FFF ( 4KB ) User NVM data 0x000B2000..0x000F1FFF (256KB) User Filesystem - 0x00025000..0x000B1FFF (564KB) Application Code (including ISR vector) - 0x00001000..0x00024FFF (144KB) SoftDevice + 0x00026000..0x000B1FFF (560KB) Application Code (including ISR vector) + 0x00001000..0x00025FFF (148KB) SoftDevice 0x00000000..0x00000FFF (4KB) Master Boot Record */ @@ -23,8 +23,8 @@ MEMORY { FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x100000 - FLASH_ISR (rx) : ORIGIN = 0x00025000, LENGTH = 0x001000 - FLASH_TEXT (rx) : ORIGIN = 0x00026000, LENGTH = 0x08C000 + FLASH_ISR (rx) : ORIGIN = 0x00026000, LENGTH = 0x001000 + FLASH_TEXT (rx) : ORIGIN = 0x00027000, LENGTH = 0x08B000 FLASH_FATFS (r) : ORIGIN = 0x000B2000, LENGTH = 0x040000 /* 0x2000000 - RAM:ORIGIN is reserved for Softdevice */ diff --git a/ports/nrf/boards/feather52840/mpconfigboard.h b/ports/nrf/boards/feather52840/mpconfigboard.h index b99d9303d71b..70842717ea44 100644 --- a/ports/nrf/boards/feather52840/mpconfigboard.h +++ b/ports/nrf/boards/feather52840/mpconfigboard.h @@ -28,7 +28,7 @@ #define MICROPY_HW_BOARD_NAME "Feather52840" #define MICROPY_HW_MCU_NAME "NRF52840" -#define MICROPY_PY_SYS_PLATFORM "nrf52840-PDK" +#define MICROPY_PY_SYS_PLATFORM "nrf52840" #define MICROPY_PY_MACHINE_HW_PWM (1) #define MICROPY_PY_MACHINE_HW_SPI (1) diff --git a/ports/nrf/boards/feather52840/mpconfigboard_s140.mk b/ports/nrf/boards/feather52840/mpconfigboard_s140.mk index cc64b2c3ce30..d5f55e219e39 100644 --- a/ports/nrf/boards/feather52840/mpconfigboard_s140.mk +++ b/ports/nrf/boards/feather52840/mpconfigboard_s140.mk @@ -4,7 +4,8 @@ MCU_SUB_VARIANT = nrf52840 SOFTDEV_VERSION ?= 6.0.0-6.alpha LD_FILE = boards/feather52840/bluefruit_nrf52840_s140_6.0.0.ld -BOOTLOADER_FILENAME = boards/feather52840/bootloader/feather52840_bootloader_6.0.0_s140_single +BOOT_UART_FILE = boards/feather52840/bootloader/uart/feather52840_bootloader_6.0.0_s140_single +BOOT_USB_FILE = boards/feather52840/bootloader/usb/feather52840_bootloader_6.0.0_s140_single NRF_DEFINES += -DNRF52840_XXAA @@ -17,8 +18,8 @@ endif CFLAGS += -DADAFRUIT_FEATHER52840 ifeq ($(SD), ) -INC += -Idrivers/bluetooth/s140_$(MCU_VARIANT)_$(SOFTDEV_VERSION)/s140_$(MCU_SUB_VARIANT)_$(SOFTDEV_VERSION)_API/include -INC += -Idrivers/bluetooth/s140_$(MCU_VARIANT)_$(SOFTDEV_VERSION)/s140_$(MCU_SUB_VARIANT)_$(SOFTDEV_VERSION)_API/include/$(MCU_VARIANT) +INC += -Idrivers/bluetooth/s140_$(MCU_VARIANT)_$(SOFTDEV_VERSION)/s140_$(MCU_VARIANT)_$(SOFTDEV_VERSION)_API/include +INC += -Idrivers/bluetooth/s140_$(MCU_VARIANT)_$(SOFTDEV_VERSION)/s140_$(MCU_VARIANT)_$(SOFTDEV_VERSION)_API/include/$(MCU_VARIANT) endif check_defined = \ @@ -38,4 +39,7 @@ dfu-flash: $(NRFUTIL) --verbose dfu serial --package $(BUILD)/dfu-package.zip -p $(SERIAL) -b 115200 boot-flash: - nrfjprog --program $(BOOTLOADER_FILENAME).hex -f nrf52 --chiperase --reset + nrfjprog --program $(BOOT_UART_FILE).hex -f nrf52 --chiperase --reset + +boot-usb-flash: + nrfjprog --program $(BOOT_USB_FILE).hex -f nrf52 --chiperase --reset \ No newline at end of file diff --git a/ports/nrf/drivers/bluetooth/bluetooth_common.mk b/ports/nrf/drivers/bluetooth/bluetooth_common.mk index d52aaccfdc52..e9bd7b3df210 100644 --- a/ports/nrf/drivers/bluetooth/bluetooth_common.mk +++ b/ports/nrf/drivers/bluetooth/bluetooth_common.mk @@ -8,7 +8,11 @@ else ifeq ($(SOFTDEV_VERSION), 5.0.0) CFLAGS += -DBLE_API_VERSION=4 endif else ifeq ($(SD), s140) - SOFTDEV_VERSION_LONG = $(SD)_$(MCU_SUB_VARIANT)_$(SOFTDEV_VERSION) + ifeq ($(SOFTDEV_VERSION), 6.0.0-6.alpha) + SOFTDEV_VERSION_LONG = $(SD)_$(MCU_SUB_VARIANT)_$(SOFTDEV_VERSION) + else + SOFTDEV_VERSION_LONG = $(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION) + endif CFLAGS += -DBLUETOOTH_SD=140 CFLAGS += -DBLE_API_VERSION=4 diff --git a/ports/nrf/drivers/bluetooth/download_ble_stack.sh b/ports/nrf/drivers/bluetooth/download_ble_stack.sh index 87f54318ca4b..1fa1b99bb4a0 100755 --- a/ports/nrf/drivers/bluetooth/download_ble_stack.sh +++ b/ports/nrf/drivers/bluetooth/download_ble_stack.sh @@ -53,6 +53,24 @@ function download_s140_nrf52_6_0_0_6_alpha cd - } +function download_s140_nrf52_6_0_0 +{ + echo "" + echo "####################################" + echo "### Downloading s140_nrf52_6.0.0 ###" + echo "####################################" + echo "" + + mkdir -p "${1}/s140_nrf52_6.0.0" + cd "${1}/s140_nrf52_6.0.0" + + wget https://www.nordicsemi.com/eng/nordic/download_resource/60624/19/10544096/116072 + mv 116072 temp.zip + unzip -u temp.zip + rm temp.zip + cd - +} + SCRIPT_DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)" if [ $# -eq 0 ]; then @@ -60,6 +78,7 @@ if [ $# -eq 0 ]; then download_s132_nrf52_2_0_1 "${SCRIPT_DIR}" download_s132_nrf52_5_0_0 "${SCRIPT_DIR}" download_s140_nrf52_6_0_0_6_alpha "${SCRIPT_DIR}" + download_s140_nrf52_6_0_0 "${SCRIPT_DIR}" else case $1 in "s132_nrf52_2_0_1" ) @@ -68,6 +87,8 @@ else download_s132_nrf52_5_0_0 "${SCRIPT_DIR}" ;; "s140_nrf52_6_0_0_6_alpha" ) download_s140_nrf52_6_0_0_6_alpha "${SCRIPT_DIR}" ;; + "s140_nrf52_6_0_0" ) + download_s140_nrf52_6_0_0 "${SCRIPT_DIR}" ;; esac fi