Skip to content

Commit

Permalink
add missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed Apr 23, 2018
1 parent 50e7a4c commit ce9f05f
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

Expand All @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion ports/nrf/boards/feather52840/mpconfigboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 8 additions & 4 deletions ports/nrf/boards/feather52840/mpconfigboard_s140.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 = \
Expand All @@ -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
6 changes: 5 additions & 1 deletion ports/nrf/drivers/bluetooth/bluetooth_common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions ports/nrf/drivers/bluetooth/download_ble_stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,32 @@ 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
echo "No Bluetooth LE stack defined, downloading all."
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" )
Expand All @@ -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

Expand Down

0 comments on commit ce9f05f

Please sign in to comment.