diff --git a/hw/bsp/nordic_pca10121/bsp.yml b/hw/bsp/nordic_pca10121/bsp.yml index 148bf85b15..54a28e3a8f 100644 --- a/hw/bsp/nordic_pca10121/bsp.yml +++ b/hw/bsp/nordic_pca10121/bsp.yml @@ -28,7 +28,7 @@ bsp.linkerscript: bsp.linkerscript.BOOT_LOADER.OVERWRITE: - "hw/bsp/nordic_pca10121/boot-nrf5340.ld" - "@apache-mynewt-core/hw/mcu/nordic/nrf5340/nrf5340.ld" -bsp.downloadscript: "hw/bsp/nordic_pca10121/download.sh" +bsp.downloadscript: "hw/scripts/download.sh" bsp.debugscript: "hw/bsp/nordic_pca10121/debug.sh" bsp.flash_map: diff --git a/hw/bsp/nordic_pca10121/download.sh b/hw/bsp/nordic_pca10121/download.sh deleted file mode 100755 index c300b1f36e..0000000000 --- a/hw/bsp/nordic_pca10121/download.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Called with following variables set: -# - CORE_PATH is absolute path to @apache-mynewt-core -# - BSP_PATH is absolute path to hw/bsp/bsp_name -# - BIN_BASENAME is the path to prefix to target binary, -# .elf appended to name is the ELF file -# - IMAGE_SLOT is the image slot to download to (for non-mfg-image, non-boot) -# - FEATURES holds the target features string -# - EXTRA_JTAG_CMD holds extra parameters to pass to jtag software -# - MFG_IMAGE is "1" if this is a manufacturing image -# - FLASH_OFFSET contains the flash offset to download to -# - BOOT_LOADER is set if downloading a bootloader - -. $CORE_PATH/hw/scripts/jlink.sh - -if [ "$MFG_IMAGE" ]; then - FLASH_OFFSET=0x0 -fi - -JLINK_DEV="nrf5340_xxaa_app" - -common_file_to_load -jlink_load diff --git a/hw/bsp/nordic_pca10121/net/bsp.yml b/hw/bsp/nordic_pca10121/net/bsp.yml index 6eb4d88cca..e9c80409c5 100644 --- a/hw/bsp/nordic_pca10121/net/bsp.yml +++ b/hw/bsp/nordic_pca10121/net/bsp.yml @@ -28,7 +28,7 @@ bsp.linkerscript: bsp.linkerscript.BOOT_LOADER.OVERWRITE: - "hw/bsp/nordic_pca10095_net/boot-nrf5340_net.ld" - "@apache-mynewt-core/hw/mcu/nordic/nrf5340_net/nrf5340_net.ld" -bsp.downloadscript: "hw/bsp/nordic_pca10121/net/download.sh" +bsp.downloadscript: "hw/scripts/download.sh" bsp.debugscript: "hw/bsp/nordic_pca10121/net/debug.sh" bsp.flash_map: diff --git a/hw/bsp/nordic_pca10121/net/download.sh b/hw/bsp/nordic_pca10121/net/download.sh deleted file mode 100755 index c311284a2b..0000000000 --- a/hw/bsp/nordic_pca10121/net/download.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Called with following variables set: -# - CORE_PATH is absolute path to @apache-mynewt-core -# - BSP_PATH is absolute path to hw/bsp/bsp_name -# - BIN_BASENAME is the path to prefix to target binary, -# .elf appended to name is the ELF file -# - IMAGE_SLOT is the image slot to download to (for non-mfg-image, non-boot) -# - FEATURES holds the target features string -# - EXTRA_JTAG_CMD holds extra parameters to pass to jtag software -# - MFG_IMAGE is "1" if this is a manufacturing image -# - FLASH_OFFSET contains the flash offset to download to -# - BOOT_LOADER is set if downloading a bootloader - -. $CORE_PATH/hw/scripts/jlink.sh - -if [ "$MFG_IMAGE" ]; then - FLASH_OFFSET=0x01000000 -fi - -JLINK_DEV="nrf5340_xxaa_net" - -common_file_to_load -jlink_load diff --git a/hw/bsp/nordic_pca10121/net/pkg.yml b/hw/bsp/nordic_pca10121/net/pkg.yml index caf1dcb69f..13aff8c3da 100644 --- a/hw/bsp/nordic_pca10121/net/pkg.yml +++ b/hw/bsp/nordic_pca10121/net/pkg.yml @@ -31,6 +31,7 @@ pkg.cflags: - '-DNRF5340_XXAA_NETWORK' pkg.deps: + - "@apache-mynewt-core/hw/scripts" - "@apache-mynewt-core/hw/mcu/nordic/nrf5340_net" - "@apache-mynewt-core/libc" - "@apache-mynewt-core/sys/flash_map" diff --git a/hw/bsp/nordic_pca10121/net/syscfg.yml b/hw/bsp/nordic_pca10121/net/syscfg.yml index fbbe6bf1b7..9179b2e96c 100644 --- a/hw/bsp/nordic_pca10121/net/syscfg.yml +++ b/hw/bsp/nordic_pca10121/net/syscfg.yml @@ -68,6 +68,12 @@ syscfg.vals: # nRF5340 Network Core doesn't have floating point unit HARDFLOAT: 0 + # Flasher parameters + MYNEWT_DOWNLOADER: nrfjprog + JLINK_TARGET: NRF5340_XXAA_NET + NRFJPROG_COPROCESSOR: CP_NETWORK + MYNEWT_DOWNLOADER_MFG_IMAGE_FLASH_OFFSET: 0x0 + syscfg.vals.BLE_CONTROLLER: TIMER_0: 0 TIMER_3: 1 diff --git a/hw/bsp/nordic_pca10121/pkg.yml b/hw/bsp/nordic_pca10121/pkg.yml index c83d2ae552..634327d5e6 100644 --- a/hw/bsp/nordic_pca10121/pkg.yml +++ b/hw/bsp/nordic_pca10121/pkg.yml @@ -34,6 +34,7 @@ pkg.cflags.HARDFLOAT: - -mfloat-abi=hard -mfpu=fpv4-sp-d16 pkg.deps: + - "@apache-mynewt-core/hw/scripts" - "@apache-mynewt-core/hw/mcu/nordic/nrf5340" - "@apache-mynewt-core/libc" - "@apache-mynewt-core/sys/flash_map" diff --git a/hw/bsp/nordic_pca10121/syscfg.yml b/hw/bsp/nordic_pca10121/syscfg.yml index ebfbb24b45..64a48ec60d 100644 --- a/hw/bsp/nordic_pca10121/syscfg.yml +++ b/hw/bsp/nordic_pca10121/syscfg.yml @@ -96,6 +96,11 @@ syscfg.vals: QSPI_XIP_OFFSET: 0x10000000 FLASH_MAP_SYSINIT_STAGE: 15 + # Flasher parameters + MYNEWT_DOWNLOADER: nrfjprog + JLINK_TARGET: NRF5340_XXAA_APP + MYNEWT_DOWNLOADER_MFG_IMAGE_FLASH_OFFSET: 0x0 + syscfg.vals.!BOOT_LOADER: MCU_LFCLK_SOURCE: LFXO MCU_LFCLK_XO_INTCAP: c9pf