You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2023/05/26 11:00:10 UTC
[mynewt-core] 07/08: hw/bsp: nordic_pca10095: Add syscfg selectable download script
This is an automated email from the ASF dual-hosted git repository.
jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit 482a5f60902bf216491281ccac13ddd46e33c413
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Fri May 19 14:27:33 2023 +0200
hw/bsp: nordic_pca10095: Add syscfg selectable download script
This switches to common download script that can be used to
flash device with nrfjprog and jlink
Signed-off-by: Jerzy Kasenberg <je...@codecoup.pl>
---
hw/bsp/nordic_pca10095/bsp.yml | 2 +-
hw/bsp/nordic_pca10095/nordic_pca10095_download.sh | 40 ----------------------
hw/bsp/nordic_pca10095/pkg.yml | 1 +
hw/bsp/nordic_pca10095/syscfg.yml | 5 +++
hw/bsp/nordic_pca10095_net/bsp.yml | 2 +-
hw/bsp/nordic_pca10095_net/pkg.yml | 1 +
hw/bsp/nordic_pca10095_net/syscfg.yml | 3 ++
7 files changed, 12 insertions(+), 42 deletions(-)
diff --git a/hw/bsp/nordic_pca10095/bsp.yml b/hw/bsp/nordic_pca10095/bsp.yml
index be1b9faf3..a38c40a92 100644
--- a/hw/bsp/nordic_pca10095/bsp.yml
+++ b/hw/bsp/nordic_pca10095/bsp.yml
@@ -29,7 +29,7 @@ bsp.linkerscript.BOOT_LOADER.OVERWRITE:
- "hw/bsp/nordic_pca10095/boot-nrf5340.ld"
- "@apache-mynewt-core/hw/mcu/nordic/nrf5340/nrf5340.ld"
bsp.part2linkerscript: "hw/bsp/nordic_pca10095/split-nordic_pca10095.ld"
-bsp.downloadscript: "hw/bsp/nordic_pca10095/nordic_pca10095_download.sh"
+bsp.downloadscript: "hw/scripts/download.sh"
bsp.debugscript: "hw/bsp/nordic_pca10095/nordic_pca10095_debug.sh"
bsp.flash_map:
diff --git a/hw/bsp/nordic_pca10095/nordic_pca10095_download.sh b/hw/bsp/nordic_pca10095/nordic_pca10095_download.sh
deleted file mode 100755
index c300b1f36..000000000
--- a/hw/bsp/nordic_pca10095/nordic_pca10095_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_pca10095/pkg.yml b/hw/bsp/nordic_pca10095/pkg.yml
index 36dcb6741..e33d3adcd 100644
--- a/hw/bsp/nordic_pca10095/pkg.yml
+++ b/hw/bsp/nordic_pca10095/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/baselibc"
- "@apache-mynewt-core/sys/flash_map"
diff --git a/hw/bsp/nordic_pca10095/syscfg.yml b/hw/bsp/nordic_pca10095/syscfg.yml
index 1a8dbc1fe..47d36d8e6 100644
--- a/hw/bsp/nordic_pca10095/syscfg.yml
+++ b/hw/bsp/nordic_pca10095/syscfg.yml
@@ -91,6 +91,11 @@ syscfg.vals:
QSPI_XIP_OFFSET: 0x10000000
FLASH_MAP_SYSINIT_STAGE: 15
+ # Flasher parameters
+ MYNEWT_DOWNLOADER: jlink
+ 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
diff --git a/hw/bsp/nordic_pca10095_net/bsp.yml b/hw/bsp/nordic_pca10095_net/bsp.yml
index e7bc6d320..995c7031c 100644
--- a/hw/bsp/nordic_pca10095_net/bsp.yml
+++ b/hw/bsp/nordic_pca10095_net/bsp.yml
@@ -29,7 +29,7 @@ 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.part2linkerscript: "hw/bsp/nordic_pca10095_net/split-nordic_pca10095_net.ld"
-bsp.downloadscript: "hw/bsp/nordic_pca10095_net/nordic_pca10095_net_download.sh"
+bsp.downloadscript: "hw/scripts/download.sh"
bsp.debugscript: "hw/bsp/nordic_pca10095_net/nordic_pca10095_net_debug.sh"
bsp.flash_map:
diff --git a/hw/bsp/nordic_pca10095_net/pkg.yml b/hw/bsp/nordic_pca10095_net/pkg.yml
index 110e69477..0e3defd89 100644
--- a/hw/bsp/nordic_pca10095_net/pkg.yml
+++ b/hw/bsp/nordic_pca10095_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/baselibc"
- "@apache-mynewt-core/sys/flash_map"
diff --git a/hw/bsp/nordic_pca10095_net/syscfg.yml b/hw/bsp/nordic_pca10095_net/syscfg.yml
index f8916672f..4cce566ee 100644
--- a/hw/bsp/nordic_pca10095_net/syscfg.yml
+++ b/hw/bsp/nordic_pca10095_net/syscfg.yml
@@ -31,6 +31,9 @@ syscfg.defs:
value: 0
syscfg.vals:
+ MYNEWT_DOWNLOADER: jlink
+ JLINK_TARGET: NRF5340_XXAA_NET
+ NRFJPROG_COPROCESSOR: CP_NETWORK
# Set default pins for peripherals
UART_0_PIN_TX: 20
UART_0_PIN_RX: 22