From 2abe8e02e04b827b0295161d9c8ee2b04583f2ff Mon Sep 17 00:00:00 2001 From: Jerzy Kasenberg Date: Wed, 6 Mar 2024 16:08:25 +0100 Subject: [PATCH] hw/bsp/nordic_pca10090: Use selectable downloader Download was not working due to missing device specifier for jlink. Now it is corrected and nrfjprog can also be used for flashing. Signed-off-by: Jerzy Kasenberg --- hw/bsp/nordic_pca10090/bsp.yml | 4 +- .../nordic_pca10090/nordic_pca10090_debug.cmd | 22 ---------- .../nordic_pca10090_download.cmd | 22 ---------- .../nordic_pca10090_download.sh | 40 ------------------- hw/bsp/nordic_pca10090/pkg.yml | 1 + hw/bsp/nordic_pca10090/syscfg.yml | 4 ++ 6 files changed, 6 insertions(+), 87 deletions(-) delete mode 100755 hw/bsp/nordic_pca10090/nordic_pca10090_debug.cmd delete mode 100755 hw/bsp/nordic_pca10090/nordic_pca10090_download.cmd delete mode 100755 hw/bsp/nordic_pca10090/nordic_pca10090_download.sh diff --git a/hw/bsp/nordic_pca10090/bsp.yml b/hw/bsp/nordic_pca10090/bsp.yml index df6ce3da24..ff778f04d9 100644 --- a/hw/bsp/nordic_pca10090/bsp.yml +++ b/hw/bsp/nordic_pca10090/bsp.yml @@ -32,10 +32,8 @@ bsp.linkerscript.RAM_RESIDENT.OVERWRITE: - "hw/bsp/nordic_pca10090/boot-nrf9160.ld" - "@apache-mynewt-core/hw/mcu/nordic/nrf9160/nrf9160_ram_resident.ld" bsp.part2linkerscript: "hw/bsp/nordic_pca10090/split-nordic_pca10090.ld" -bsp.downloadscript: "hw/bsp/nordic_pca10090/nordic_pca10090_download.sh" +bsp.downloadscript: "hw/scripts/download.sh" bsp.debugscript: "hw/bsp/nordic_pca10090/nordic_pca10090_debug.sh" -bsp.downloadscript.WINDOWS.OVERWRITE: "hw/bsp/nordic_pca10090/nordic_pca10090_download.cmd" -bsp.debugscript.WINDOWS.OVERWRITE: "hw/bsp/nordic_pca10090/nordic_pca10090_debug.cmd" bsp.flash_map: areas: diff --git a/hw/bsp/nordic_pca10090/nordic_pca10090_debug.cmd b/hw/bsp/nordic_pca10090/nordic_pca10090_debug.cmd deleted file mode 100755 index 3444fd3279..0000000000 --- a/hw/bsp/nordic_pca10090/nordic_pca10090_debug.cmd +++ /dev/null @@ -1,22 +0,0 @@ -@rem -@rem Licensed to the Apache Software Foundation (ASF) under one -@rem or more contributor license agreements. See the NOTICE file -@rem distributed with this work for additional information -@rem regarding copyright ownership. The ASF licenses this file -@rem to you under the Apache License, Version 2.0 (the -@rem "License"); you may not use this file except in compliance -@rem with the License. You may obtain a copy of the License at -@rem -@rem http://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, -@rem software distributed under the License is distributed on an -@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@rem KIND, either express or implied. See the License for the -@rem specific language governing permissions and limitations -@rem under the License. -@rem - -@rem Execute a shell with a script of the same name and .sh extension - -@bash "%~dp0%~n0.sh" diff --git a/hw/bsp/nordic_pca10090/nordic_pca10090_download.cmd b/hw/bsp/nordic_pca10090/nordic_pca10090_download.cmd deleted file mode 100755 index 3444fd3279..0000000000 --- a/hw/bsp/nordic_pca10090/nordic_pca10090_download.cmd +++ /dev/null @@ -1,22 +0,0 @@ -@rem -@rem Licensed to the Apache Software Foundation (ASF) under one -@rem or more contributor license agreements. See the NOTICE file -@rem distributed with this work for additional information -@rem regarding copyright ownership. The ASF licenses this file -@rem to you under the Apache License, Version 2.0 (the -@rem "License"); you may not use this file except in compliance -@rem with the License. You may obtain a copy of the License at -@rem -@rem http://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, -@rem software distributed under the License is distributed on an -@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@rem KIND, either express or implied. See the License for the -@rem specific language governing permissions and limitations -@rem under the License. -@rem - -@rem Execute a shell with a script of the same name and .sh extension - -@bash "%~dp0%~n0.sh" diff --git a/hw/bsp/nordic_pca10090/nordic_pca10090_download.sh b/hw/bsp/nordic_pca10090/nordic_pca10090_download.sh deleted file mode 100755 index 7b7aa303ab..0000000000 --- a/hw/bsp/nordic_pca10090/nordic_pca10090_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="CORTEX-M33" - -common_file_to_load -jlink_load diff --git a/hw/bsp/nordic_pca10090/pkg.yml b/hw/bsp/nordic_pca10090/pkg.yml index e4533059a3..7a65bbd55a 100644 --- a/hw/bsp/nordic_pca10090/pkg.yml +++ b/hw/bsp/nordic_pca10090/pkg.yml @@ -39,6 +39,7 @@ pkg.cflags.HARDFLOAT: pkg.deps: - "@apache-mynewt-core/hw/mcu/nordic/nrf91xx" - "@apache-mynewt-core/libc" + - "@apache-mynewt-core/hw/scripts" pkg.deps.UARTBB_0: - "@apache-mynewt-core/hw/drivers/uart/uart_bitbang" diff --git a/hw/bsp/nordic_pca10090/syscfg.yml b/hw/bsp/nordic_pca10090/syscfg.yml index cea2c68274..b3f99721a7 100644 --- a/hw/bsp/nordic_pca10090/syscfg.yml +++ b/hw/bsp/nordic_pca10090/syscfg.yml @@ -28,6 +28,10 @@ syscfg.defs: value: 0 syscfg.vals: + MYNEWT_DOWNLOADER: nrfjprog + JLINK_TARGET: NRF9160_XXAA + MYNEWT_DOWNLOADER_MFG_IMAGE_FLASH_OFFSET: 0x0 + # Enable nRF9160 MCU and common startup code MCU_TARGET: nRF9160 MCU_COMMON_STARTUP: 1