From bcaec2016b8a728d1286950a7c5ba5dd061f5b21 Mon Sep 17 00:00:00 2001 From: Jakob Krantz Date: Sun, 15 Dec 2024 21:49:44 +0100 Subject: [PATCH] Migarte ZSWatch board to Zephyr HW Model V2. --- .github/workflows/build.yml | 2 +- app/CMakeLists.txt | 10 ++- app/boards/arm/zswatch_nrf5340/CMakeLists.txt | 7 -- app/boards/arm/zswatch_nrf5340/Kconfig.board | 21 ----- app/boards/arm/zswatch_nrf5340/board.c | 77 ------------------- app/boards/arm/zswatch_nrf5340/revision.cmake | 1 - .../zswatch_nrf5340_cpunet_1.conf | 0 .../zswatch_nrf5340_cpunet_2.conf | 0 .../zswatch_nrf5340_cpunet_3.conf | 0 .../zswatch_nrf5340_cpunet_4.conf | 0 .../zswatch_nrf5340_cpunet_5.conf | 0 app/boards/jakkra/zswatch/CMakeLists.txt | 15 ++++ .../zswatch}/Kconfig | 26 ++----- .../zswatch}/Kconfig.defconfig | 61 ++++----------- app/boards/jakkra/zswatch/Kconfig.zswatch | 7 ++ .../zswatch}/board.cmake | 9 +++ app/boards/jakkra/zswatch/board.yml | 14 ++++ .../nrf5340_cpuapp_common-pinctrl.dtsi} | 2 +- .../zswatch/nrf5340_cpuapp_common.dtsi} | 5 +- .../nrf5340_cpuapp_partition_conf.dtsi} | 5 +- .../jakkra/zswatch/nrf5340_cpunet_reset.c | 60 +++++++++++++++ .../nrf5340_shared_sram_planning_conf.dtsi} | 0 .../zswatch}/pre_dt_board.cmake | 0 .../zswatch}/zswatch_nrf5340_cpuapp.dts | 6 +- .../zswatch}/zswatch_nrf5340_cpuapp.yaml | 9 ++- .../zswatch}/zswatch_nrf5340_cpuapp_3.overlay | 0 .../zswatch_nrf5340_cpuapp_3_defconfig} | 2 +- .../zswatch}/zswatch_nrf5340_cpuapp_4.overlay | 2 +- .../zswatch_nrf5340_cpuapp_4_defconfig} | 2 +- .../zswatch}/zswatch_nrf5340_cpuapp_5.overlay | 0 .../zswatch_nrf5340_cpuapp_5_defconfig} | 0 .../zswatch}/zswatch_nrf5340_cpuapp_defconfig | 18 ++--- .../zswatch}/zswatch_nrf5340_cpuapp_ns.dts | 6 +- .../zswatch}/zswatch_nrf5340_cpuapp_ns.yaml | 6 +- .../zswatch_nrf5340_cpuapp_ns_defconfig | 18 ++--- .../zswatch_nrf5340_cpunet-pinctrl.dtsi | 0 .../zswatch}/zswatch_nrf5340_cpunet.dts | 30 +++----- .../zswatch}/zswatch_nrf5340_cpunet.yaml | 6 +- .../zswatch}/zswatch_nrf5340_cpunet_defconfig | 16 ++-- app/src/history/zsw_history.c | 2 +- 40 files changed, 196 insertions(+), 249 deletions(-) delete mode 100644 app/boards/arm/zswatch_nrf5340/CMakeLists.txt delete mode 100644 app/boards/arm/zswatch_nrf5340/Kconfig.board delete mode 100644 app/boards/arm/zswatch_nrf5340/board.c delete mode 100644 app/boards/arm/zswatch_nrf5340/revision.cmake delete mode 100644 app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet_1.conf delete mode 100644 app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet_2.conf delete mode 100644 app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet_3.conf delete mode 100644 app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet_4.conf delete mode 100644 app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet_5.conf create mode 100644 app/boards/jakkra/zswatch/CMakeLists.txt rename app/boards/{arm/zswatch_nrf5340 => jakkra/zswatch}/Kconfig (76%) rename app/boards/{arm/zswatch_nrf5340 => jakkra/zswatch}/Kconfig.defconfig (71%) create mode 100644 app/boards/jakkra/zswatch/Kconfig.zswatch rename app/boards/{arm/zswatch_nrf5340 => jakkra/zswatch}/board.cmake (61%) create mode 100644 app/boards/jakkra/zswatch/board.yml rename app/boards/{arm/zswatch_nrf5340/zswatch_nrf5340_common-pinctrl.dtsi => jakkra/zswatch/nrf5340_cpuapp_common-pinctrl.dtsi} (99%) rename app/boards/{arm/zswatch_nrf5340/zswatch_nrf5340_common.dts => jakkra/zswatch/nrf5340_cpuapp_common.dtsi} (98%) rename app/boards/{arm/zswatch_nrf5340/zswatch_nrf5340_partition_conf.dts => jakkra/zswatch/nrf5340_cpuapp_partition_conf.dtsi} (94%) create mode 100644 app/boards/jakkra/zswatch/nrf5340_cpunet_reset.c rename app/boards/{arm/zswatch_nrf5340/zswatch_nrf5340_shared_sram_planning_conf.dts => jakkra/zswatch/nrf5340_shared_sram_planning_conf.dtsi} (100%) rename app/boards/{arm/zswatch_nrf5340 => jakkra/zswatch}/pre_dt_board.cmake (100%) rename app/boards/{arm/zswatch_nrf5340 => jakkra/zswatch}/zswatch_nrf5340_cpuapp.dts (74%) rename app/boards/{arm/zswatch_nrf5340 => jakkra/zswatch}/zswatch_nrf5340_cpuapp.yaml (59%) rename app/boards/{arm/zswatch_nrf5340 => jakkra/zswatch}/zswatch_nrf5340_cpuapp_3.overlay (100%) rename app/boards/{arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_3.conf => jakkra/zswatch/zswatch_nrf5340_cpuapp_3_defconfig} (96%) rename app/boards/{arm/zswatch_nrf5340 => jakkra/zswatch}/zswatch_nrf5340_cpuapp_4.overlay (99%) rename app/boards/{arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_4.conf => jakkra/zswatch/zswatch_nrf5340_cpuapp_4_defconfig} (96%) rename app/boards/{arm/zswatch_nrf5340 => jakkra/zswatch}/zswatch_nrf5340_cpuapp_5.overlay (100%) rename app/boards/{arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_5.conf => jakkra/zswatch/zswatch_nrf5340_cpuapp_5_defconfig} (100%) rename app/boards/{arm/zswatch_nrf5340 => jakkra/zswatch}/zswatch_nrf5340_cpuapp_defconfig (57%) rename app/boards/{arm/zswatch_nrf5340 => jakkra/zswatch}/zswatch_nrf5340_cpuapp_ns.dts (69%) rename app/boards/{arm/zswatch_nrf5340 => jakkra/zswatch}/zswatch_nrf5340_cpuapp_ns.yaml (73%) rename app/boards/{arm/zswatch_nrf5340 => jakkra/zswatch}/zswatch_nrf5340_cpuapp_ns_defconfig (63%) rename app/boards/{arm/zswatch_nrf5340 => jakkra/zswatch}/zswatch_nrf5340_cpunet-pinctrl.dtsi (100%) rename app/boards/{arm/zswatch_nrf5340 => jakkra/zswatch}/zswatch_nrf5340_cpunet.dts (65%) rename app/boards/{arm/zswatch_nrf5340 => jakkra/zswatch}/zswatch_nrf5340_cpunet.yaml (54%) rename app/boards/{arm/zswatch_nrf5340 => jakkra/zswatch}/zswatch_nrf5340_cpunet_defconfig (54%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d8d1a913..051f7849 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: built_type: [debug, release] - board: [zswatch_nrf5340_cpuapp@3, zswatch_nrf5340_cpuapp@4, zswatch_nrf5340_cpuapp@5, native_posix, nrf5340dk_nrf5340_cpuapp] + board: [zswatch@3/nrf5340/cpuapp, zswatch@4/nrf5340/cpuapp, zswatch@5/nrf5340/cpuapp, native_posix/native, nrf5340dk/nrf5340/cpuapp] steps: - name: Checkout uses: actions/checkout@v4 diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 59d7b5df..58d69861 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -15,10 +15,10 @@ foreach(file ${files}) endforeach() # Get the target hardware -string(REGEX MATCH "zswatch_nrf5340_cpuapp(_ns)?@([0-9]+)$" ZSWATCH_BOARD "${BOARD}") +string(REGEX MATCH "zswatch@([0-9]+)/nrf5340.*" ZSWATCH_BOARD "${BOARD}") if(ZSWATCH_BOARD) - string(CONCAT VERSION_STRING "\"" ${CMAKE_MATCH_2} "\"") - set(CONFIG_ZSWATCH_PCB_REV ${CMAKE_MATCH_2} CACHE INTERNAL "") + string(CONCAT VERSION_STRING "\"" ${CMAKE_MATCH_1} "\"") + set(CONFIG_ZSWATCH_PCB_REV ${CMAKE_MATCH_1} CACHE INTERNAL "") set(CONFIG_BT_DIS_HW_REV_STR ${VERSION_STRING} CACHE INTERNAL "") message("PCB revision: " ${CONFIG_ZSWATCH_PCB_REV}) @@ -28,8 +28,10 @@ if(ZSWATCH_BOARD) else() set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/partition_internal.yml) endif() -elseif("nrf5340dk_nrf5340_cpuapp" STREQUAL "${BOARD}") +elseif("nrf5340dk/nrf5340/cpuapp" STREQUAL "${BOARD}") set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/partition_external.yml) +else() + message(WARNING "Not supported board: ${BOARD}. Build may not work.") endif() if(CONFIG_BOOTLOADER_MCUBOOT) diff --git a/app/boards/arm/zswatch_nrf5340/CMakeLists.txt b/app/boards/arm/zswatch_nrf5340/CMakeLists.txt deleted file mode 100644 index c728eb3a..00000000 --- a/app/boards/arm/zswatch_nrf5340/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) 2023 Jakob Krantz -# SPDX-License-Identifier: Apache-2.0 - -if (CONFIG_BOARD_ZSWATCH_NRF5340_CPUAPP OR CONFIG_BOARD_ZSWATCH_NRF5340_CPUAPP_NS) - zephyr_library() - zephyr_library_sources(board.c) -endif() diff --git a/app/boards/arm/zswatch_nrf5340/Kconfig.board b/app/boards/arm/zswatch_nrf5340/Kconfig.board deleted file mode 100644 index f5d855bc..00000000 --- a/app/boards/arm/zswatch_nrf5340/Kconfig.board +++ /dev/null @@ -1,21 +0,0 @@ -# ZSWatch NRF5340 board configuration - -# Copyright (c) 2023 Jakob Krantz -# SPDX-License-Identifier: Apache-2.0 - -if SOC_NRF5340_CPUAPP_QKAA - -config BOARD_ZSWATCH_NRF5340_CPUAPP - bool "ZSWatch nRF5340 Application MCU" - -config BOARD_ZSWATCH_NRF5340_CPUAPP_NS - bool "ZSWatch nRF5340 Application MCU non-secure" - -endif # SOC_NRF5340_CPUAPP_QKAA - -if SOC_NRF5340_CPUNET_QKAA - -config BOARD_ZSWATCH_NRF5340_CPUNET - bool "ZSWatch nRF5340 Network MCU" - -endif # SOC_NRF5340_CPUNET_QKAA diff --git a/app/boards/arm/zswatch_nrf5340/board.c b/app/boards/arm/zswatch_nrf5340/board.c deleted file mode 100644 index f13b9b1e..00000000 --- a/app/boards/arm/zswatch_nrf5340/board.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2023 Jakob Krantz - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include - -LOG_MODULE_REGISTER(zswatch_board_init); - -/* Initialization chain of ZSWatch board requires some delays before on board sensors - * could be accessed after power up. In particular bme680 and bmm150 sensors require, - * respectively 2ms and 1ms power on delay. In order to avoid delays sum, common delay is - * introduced in the board start up file. Below asserts ensure correct initialization order: - * on board regulators, board init (this), sensors init. - */ -#if defined(CONFIG_REGULATOR_FIXED) -BUILD_ASSERT(CONFIG_ZSWATCH_INIT_PRIORITY > CONFIG_REGULATOR_FIXED_INIT_PRIORITY, - "CONFIG_ZSWATCH_INIT_PRIORITY must be higher than CONFIG_REGULATOR_FIXED_INIT_PRIORITY"); -#endif /* CONFIG_REGULATOR_FIXED */ - -#if defined(CONFIG_SENSOR) -BUILD_ASSERT(CONFIG_ZSWATCH_INIT_PRIORITY < CONFIG_SENSOR_INIT_PRIORITY, - "CONFIG_ZSWATCH_INIT_PRIORITY must be less than CONFIG_SENSOR_INIT_PRIORITY"); -#endif - -static void enable_cpunet(void) -{ -#if !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) - /* Retain nRF5340 Network MCU in Secure domain (bus - * accesses by Network MCU will have Secure attribute set). - */ - NRF_SPU->EXTDOMAIN[0].PERM = 1 << 4; -#endif /* !CONFIG_TRUSTED_EXECUTION_NONSECURE */ - -#if !defined(CONFIG_TRUSTED_EXECUTION_SECURE) - /* - * Building Zephyr with CONFIG_TRUSTED_EXECUTION_SECURE=y implies - * building also a Non-Secure image. The Non-Secure image will, in - * this case do the remainder of actions to properly configure and - * boot the Network MCU. - */ - - /* Release the Network MCU, 'Release force off signal' */ - NRF_RESET->NETWORK.FORCEOFF = RESET_NETWORK_FORCEOFF_FORCEOFF_Release; - - LOG_DBG("Network MCU released."); -#endif /* !CONFIG_TRUSTED_EXECUTION_SECURE */ -} - -static int setup(void) -{ -#if !defined(CONFIG_TRUSTED_EXECUTION_SECURE) - if (IS_ENABLED(CONFIG_SENSOR)) { - /* Initialization chain of ZSWatch board requires some delays before on board - * sensors could be accessed after power up. In particular bme680 and other - * sensors require, 2ms and 1ms power on delay respectively. In order not to sum - * delays, common delay is introduced in the board start up file. This code is - * executed after sensors are powered up and before their initialization. - * It's ensured by build asserts at the beginning of this file. - */ - k_msleep(2); - } - -#endif /* !CONFIG_TRUSTED_EXECUTION_SECURE */ - - if (IS_ENABLED(CONFIG_BOARD_ENABLE_CPUNET)) { - enable_cpunet(); - } - - return 0; -} - -SYS_INIT(setup, POST_KERNEL, CONFIG_ZSWATCH_INIT_PRIORITY); diff --git a/app/boards/arm/zswatch_nrf5340/revision.cmake b/app/boards/arm/zswatch_nrf5340/revision.cmake deleted file mode 100644 index fd195d0e..00000000 --- a/app/boards/arm/zswatch_nrf5340/revision.cmake +++ /dev/null @@ -1 +0,0 @@ -board_check_revision(FORMAT NUMBER) diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet_1.conf b/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet_1.conf deleted file mode 100644 index e69de29b..00000000 diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet_2.conf b/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet_2.conf deleted file mode 100644 index e69de29b..00000000 diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet_3.conf b/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet_3.conf deleted file mode 100644 index e69de29b..00000000 diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet_4.conf b/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet_4.conf deleted file mode 100644 index e69de29b..00000000 diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet_5.conf b/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet_5.conf deleted file mode 100644 index e69de29b..00000000 diff --git a/app/boards/jakkra/zswatch/CMakeLists.txt b/app/boards/jakkra/zswatch/CMakeLists.txt new file mode 100644 index 00000000..a3aa413d --- /dev/null +++ b/app/boards/jakkra/zswatch/CMakeLists.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2019 Nordic Semiconductor ASA. +# SPDX-License-Identifier: Apache-2.0 + +if ((CONFIG_BOARD_ZSWATCH_NRF5340_CPUAPP OR CONFIG_BOARD_ZSWATCH_NRF5340_CPUAPP_NS) + AND CONFIG_BOARD_ENABLE_CPUNET) +zephyr_library() +zephyr_library_sources(nrf5340_cpunet_reset.c) + +if (CONFIG_BUILD_WITH_TFM) + zephyr_library_include_directories( + $/api_ns/interface/include + ) +endif() + +endif() diff --git a/app/boards/arm/zswatch_nrf5340/Kconfig b/app/boards/jakkra/zswatch/Kconfig similarity index 76% rename from app/boards/arm/zswatch_nrf5340/Kconfig rename to app/boards/jakkra/zswatch/Kconfig index 515b3387..b69fe7b9 100644 --- a/app/boards/arm/zswatch_nrf5340/Kconfig +++ b/app/boards/jakkra/zswatch/Kconfig @@ -1,17 +1,8 @@ -# ZSWwatch NRF5340 board configuration +# nRF5340 DK board configuration -# Copyright (c) 2023 Jakob Krantz +# Copyright (c) 2019 - 2021 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -config ZSWATCH_INIT_PRIORITY - int "Init priority" - default 79 - help - Initialization priority of the ZSWatch - -config MBOX_NRFX_IPC - default MBOX - if BOARD_ZSWATCH_NRF5340_CPUAPP || BOARD_ZSWATCH_NRF5340_CPUAPP_NS config BOARD_ENABLE_DCDC_APP @@ -47,24 +38,21 @@ config BOARD_ENABLE_CPUNET config DOMAIN_CPUNET_BOARD string - default "zswatch_nrf5340_cpunet" + default "zswatch/nrf5340/cpunet" depends on BOARD_ENABLE_CPUNET help The board which will be used for CPUNET domain when creating a multi image application where one or more images should be located on - another board. For example hci_rpmsg on the nRF5340_cpunet for + another board. For example hci_ipc on the nRF5340_cpunet for Bluetooth applications. -endif # BOARD_ZSWATCH_NRF5340_CPUAPP || BOARD_ZSWATCH_NRF5340_CPUAPP_NS - -if BOARD_ZSWATCH_NRF5340_CPUNET +endif # BOARD_ZSWATCH_NRF5340_CPUAPP || BOARD_ZSWATCH_NRF5340_CPUAPP_NS config DOMAIN_CPUAPP_BOARD string - default "zswatch_nrf5340_cpuapp" + default "zswatch/nrf5340/cpuapp" + depends on BOARD_ZSWATCH_NRF5340_CPUNET help The board which will be used for CPUAPP domain when creating a multi image application where one or more images should be located on another board. - -endif # BOARD_ZSWATCH_NRF5340_CPUNET diff --git a/app/boards/arm/zswatch_nrf5340/Kconfig.defconfig b/app/boards/jakkra/zswatch/Kconfig.defconfig similarity index 71% rename from app/boards/arm/zswatch_nrf5340/Kconfig.defconfig rename to app/boards/jakkra/zswatch/Kconfig.defconfig index dd6d3d0f..e2c71ddc 100644 --- a/app/boards/arm/zswatch_nrf5340/Kconfig.defconfig +++ b/app/boards/jakkra/zswatch/Kconfig.defconfig @@ -1,27 +1,9 @@ -# ZSWatch NRF5340 board configuration +# nRF5340 DK nRF5340 board configuration -# Copyright (c) 2023 Jakob Krantz +# Copyright (c) 2019-2020 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if BOARD_ZSWATCH_NRF5340_CPUAPP || BOARD_ZSWATCH_NRF5340_CPUAPP_NS - -config BOARD - default "zswatch_nrf5340_cpuapp" - -# By default, if we build for a Non-Secure version of the board, -# enable building with TF-M as the Secure Execution Environment. -config BUILD_WITH_TFM - default y if BOARD_ZSWATCH_NRF5340_CPUAPP_NS - -if BUILD_WITH_TFM - -# By default, if we build with TF-M, instruct build system to -# flash the combined TF-M (Secure) & Zephyr (Non Secure) image -config TFM_FLASH_MERGED_BINARY - bool - default y - -endif # BUILD_WITH_TFM +if BOARD_ZSWATCH_NRF5340_CPUAPP || BOARD_ZSWATCH_NRF5340_CPUAPP_NS # Code Partition: # @@ -71,43 +53,26 @@ config FLASH_LOAD_SIZE endif # BOARD_ZSWATCH_NRF5340_CPUAPP_NS -if !TRUSTED_EXECUTION_SECURE +endif # BOARD_ZSWATCH_NRF5340_CPUAPP || BOARD_ZSWATCH_NRF5340_CPUAPP_NS + +config MBOX_NRFX_IPC + default MBOX + +if BOARD_ZSWATCH_NRF5340_CPUAPP || BOARD_ZSWATCH_NRF5340_CPUAPP_NS choice BT_HCI_BUS_TYPE default BT_HCI_IPC if BT endchoice -config HEAP_MEM_POOL_SIZE +config HEAP_MEM_POOL_ADD_SIZE_BOARD + int default 4096 if BT_HCI_IPC -config BT_HAS_HCI_VS - default BT - -config USB_NRFX_ATTACHED_EVENT_DELAY - default 700 if USB_DEVICE_DRIVER - -config I2C - default y - -config SPI - default y - -config REGULATOR - default y - -endif # !TRUSTED_EXECUTION_SECURE - -endif # BOARD_ZSWATCH_NRF5340_CPUAPP || BOARD_ZSWATCH_NRF5340_CPUAPP_NS +endif # BOARD_ZSWATCH_NRF5340_CPUAPP || BOARD_ZSWATCH_NRF5340_CPUAPP_NS if BOARD_ZSWATCH_NRF5340_CPUNET -config BOARD - default "zswatch_nrf5340_cpunet" - config BT_CTLR - default BT - -config BT_ECC - default BT + default y if BT endif # BOARD_ZSWATCH_NRF5340_CPUNET diff --git a/app/boards/jakkra/zswatch/Kconfig.zswatch b/app/boards/jakkra/zswatch/Kconfig.zswatch new file mode 100644 index 00000000..0fac0cf1 --- /dev/null +++ b/app/boards/jakkra/zswatch/Kconfig.zswatch @@ -0,0 +1,7 @@ +# Copyright (c) 2022 Zephyr Project members and individual contributors +# SPDX-License-Identifier: Apache-2.0 + +config BOARD_ZSWATCH + select SOC_NRF5340_CPUAPP_QKAA if BOARD_ZSWATCH_NRF5340_CPUAPP + select SOC_NRF5340_CPUAPP_QKAA if BOARD_ZSWATCH_NRF5340_CPUAPP_NS + select SOC_NRF5340_CPUNET_QKAA if BOARD_ZSWATCH_NRF5340_CPUNET diff --git a/app/boards/arm/zswatch_nrf5340/board.cmake b/app/boards/jakkra/zswatch/board.cmake similarity index 61% rename from app/boards/arm/zswatch_nrf5340/board.cmake rename to app/boards/jakkra/zswatch/board.cmake index 7511be22..5e07d68a 100644 --- a/app/boards/arm/zswatch_nrf5340/board.cmake +++ b/app/boards/jakkra/zswatch/board.cmake @@ -1,12 +1,21 @@ # SPDX-License-Identifier: Apache-2.0 +if(CONFIG_BOARD_ZSWATCH_NRF5340_CPUAPP_NS) + set(TFM_PUBLIC_KEY_FORMAT "full") +endif() + if(CONFIG_BOARD_ZSWATCH_NRF5340_CPUAPP OR CONFIG_BOARD_ZSWATCH_NRF5340_CPUAPP_NS) board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") endif() +if(CONFIG_TFM_FLASH_MERGED_BINARY) + set_property(TARGET runners_yaml_props_target PROPERTY hex_file tfm_merged.hex) +endif() + if(CONFIG_BOARD_ZSWATCH_NRF5340_CPUNET) board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") endif() include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) +include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/app/boards/jakkra/zswatch/board.yml b/app/boards/jakkra/zswatch/board.yml new file mode 100644 index 00000000..c9449826 --- /dev/null +++ b/app/boards/jakkra/zswatch/board.yml @@ -0,0 +1,14 @@ +board: + name: zswatch + vendor: nordic + socs: + - name: 'nrf5340' + variants: + - name: 'ns' + cpucluster: 'cpuapp' + revision: + format: number + default: "5" + exact: false + revisions: + - name: "5" diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_common-pinctrl.dtsi b/app/boards/jakkra/zswatch/nrf5340_cpuapp_common-pinctrl.dtsi similarity index 99% rename from app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_common-pinctrl.dtsi rename to app/boards/jakkra/zswatch/nrf5340_cpuapp_common-pinctrl.dtsi index 2f2c0446..f1a88243 100644 --- a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_common-pinctrl.dtsi +++ b/app/boards/jakkra/zswatch/nrf5340_cpuapp_common-pinctrl.dtsi @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -&pinctrl { + &pinctrl { pwm0_default: pwm0_default { group1 { psels = ; diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_common.dts b/app/boards/jakkra/zswatch/nrf5340_cpuapp_common.dtsi similarity index 98% rename from app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_common.dts rename to app/boards/jakkra/zswatch/nrf5340_cpuapp_common.dtsi index b27f151e..531d75a2 100644 --- a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_common.dts +++ b/app/boards/jakkra/zswatch/nrf5340_cpuapp_common.dtsi @@ -3,9 +3,10 @@ * * SPDX-License-Identifier: Apache-2.0 */ -#include "zswatch_nrf5340_common-pinctrl.dtsi" +#include "nrf5340_cpuapp_common-pinctrl.dtsi" #include + / { chosen { zephyr,console = &uart0; @@ -261,4 +262,4 @@ zephyr_udc0: &usbd { }; /* Include partition configuration file */ -#include "zswatch_nrf5340_partition_conf.dts" \ No newline at end of file +#include "nrf5340_cpuapp_partition_conf.dtsi" diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_partition_conf.dts b/app/boards/jakkra/zswatch/nrf5340_cpuapp_partition_conf.dtsi similarity index 94% rename from app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_partition_conf.dts rename to app/boards/jakkra/zswatch/nrf5340_cpuapp_partition_conf.dtsi index 80f4a3ec..ba784afc 100644 --- a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_partition_conf.dts +++ b/app/boards/jakkra/zswatch/nrf5340_cpuapp_partition_conf.dtsi @@ -21,7 +21,7 @@ * the beginning of the Non-Secure image (not its size). */ -&slot0_partition { + &slot0_partition { reg = <0x00010000 0x40000>; }; @@ -56,5 +56,6 @@ reg = <0x20040000 0x30000>; }; + /* Include shared RAM configuration file */ -#include "zswatch_nrf5340_shared_sram_planning_conf.dts" +#include "nrf5340_shared_sram_planning_conf.dtsi" diff --git a/app/boards/jakkra/zswatch/nrf5340_cpunet_reset.c b/app/boards/jakkra/zswatch/nrf5340_cpunet_reset.c new file mode 100644 index 00000000..dadba8c0 --- /dev/null +++ b/app/boards/jakkra/zswatch/nrf5340_cpunet_reset.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2019-2021 Nordic Semiconductor ASA. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +#include +#include + +LOG_MODULE_REGISTER(nrf5340dk_nrf5340_cpuapp, CONFIG_LOG_DEFAULT_LEVEL); + +#if defined(CONFIG_BT_CTLR_DEBUG_PINS_CPUAPP) +#include <../subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/debug.h> +#else +#define DEBUG_SETUP() +#endif + +static void remoteproc_mgr_config(void) +{ +#if !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) || defined(CONFIG_BUILD_WITH_TFM) + /* Route Bluetooth Controller Debug Pins */ + DEBUG_SETUP(); +#endif /* !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) || defined(CONFIG_BUILD_WITH_TFM) */ + +#if !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) + /* Retain nRF5340 Network MCU in Secure domain (bus + * accesses by Network MCU will have Secure attribute set). + */ + NRF_SPU->EXTDOMAIN[0].PERM = 1 << 4; +#endif /* !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) */ +} + +static int remoteproc_mgr_boot(void) +{ + + /* Secure domain may configure permissions for the Network MCU. */ + remoteproc_mgr_config(); + +#if !defined(CONFIG_TRUSTED_EXECUTION_SECURE) + /* + * Building Zephyr with CONFIG_TRUSTED_EXECUTION_SECURE=y implies + * building also a Non-Secure image. The Non-Secure image will, in + * this case do the remainder of actions to properly configure and + * boot the Network MCU. + */ + + /* Release the Network MCU, 'Release force off signal' */ + nrf_reset_network_force_off(NRF_RESET, false); + + LOG_DBG("Network MCU released."); +#endif /* !CONFIG_TRUSTED_EXECUTION_SECURE */ + + return 0; +} + +SYS_INIT(remoteproc_mgr_boot, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_shared_sram_planning_conf.dts b/app/boards/jakkra/zswatch/nrf5340_shared_sram_planning_conf.dtsi similarity index 100% rename from app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_shared_sram_planning_conf.dts rename to app/boards/jakkra/zswatch/nrf5340_shared_sram_planning_conf.dtsi diff --git a/app/boards/arm/zswatch_nrf5340/pre_dt_board.cmake b/app/boards/jakkra/zswatch/pre_dt_board.cmake similarity index 100% rename from app/boards/arm/zswatch_nrf5340/pre_dt_board.cmake rename to app/boards/jakkra/zswatch/pre_dt_board.cmake diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp.dts b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp.dts similarity index 74% rename from app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp.dts rename to app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp.dts index 42e9e52d..aa66a6b3 100644 --- a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp.dts +++ b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp.dts @@ -6,11 +6,11 @@ /dts-v1/; #include -#include "zswatch_nrf5340_common.dts" +#include "nrf5340_cpuapp_common.dtsi" / { - model = "Nordic ZSWatch NRF5340 Application"; - compatible = "nordic,zswatch-nrf5340-cpuapp"; + model = "ZSWatch NRF5340 Application"; + compatible = "jakkra,zswatch-nrf5340-cpuapp"; chosen { zephyr,sram = &sram0_image; diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp.yaml b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp.yaml similarity index 59% rename from app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp.yaml rename to app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp.yaml index abc41307..dc20b90b 100644 --- a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp.yaml +++ b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp.yaml @@ -1,5 +1,5 @@ -identifier: zswatch_nrf5340_cpuapp -name: ZSWatch-NRF5340-application-MCU +identifier: zswatch/nrf5340/cpuapp +name: NRF5340-DK-NRF5340-application-MCU type: mcu arch: arm toolchain: @@ -11,8 +11,13 @@ flash: 1024 supported: - gpio - i2c + - i2s - pwm - watchdog - usb_cdc - usb_device + - usbd - netif:openthread + - gpio + - spi +vendor: jakkra diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_3.overlay b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_3.overlay similarity index 100% rename from app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_3.overlay rename to app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_3.overlay diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_3.conf b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_3_defconfig similarity index 96% rename from app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_3.conf rename to app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_3_defconfig index 8056af2c..f49767f1 100644 --- a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_3.conf +++ b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_3_defconfig @@ -42,4 +42,4 @@ CONFIG_WATCHFACE_MINIMAL=n CONFIG_APPLICATIONS_USE_2048=n CONFIG_APPLICATIONS_USE_COMPASS=n -CONFIG_STORE_IMAGES_EXTERNAL_FLASH=y +CONFIG_STORE_IMAGES_EXTERNAL_FLASH=y \ No newline at end of file diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_4.overlay b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_4.overlay similarity index 99% rename from app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_4.overlay rename to app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_4.overlay index 3402482f..d7bb7464 100644 --- a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_4.overlay +++ b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_4.overlay @@ -238,4 +238,4 @@ reg = <0xA00000 0x100000 >; }; }; -}; +}; \ No newline at end of file diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_4.conf b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_4_defconfig similarity index 96% rename from app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_4.conf rename to app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_4_defconfig index 58b3ff41..71ea3276 100644 --- a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_4.conf +++ b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_4_defconfig @@ -37,4 +37,4 @@ CONFIG_PM_PARTITION_SIZE_LITTLEFS=0x200000 CONFIG_DEBUG_COREDUMP_BACKEND_OTHER=y -CONFIG_STORE_IMAGES_EXTERNAL_FLASH=y +CONFIG_STORE_IMAGES_EXTERNAL_FLASH=y \ No newline at end of file diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_5.overlay b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_5.overlay similarity index 100% rename from app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_5.overlay rename to app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_5.overlay diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_5.conf b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_5_defconfig similarity index 100% rename from app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_5.conf rename to app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_5_defconfig diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_defconfig b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_defconfig similarity index 57% rename from app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_defconfig rename to app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_defconfig index 97ced994..92faa253 100644 --- a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_defconfig +++ b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_defconfig @@ -1,9 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_SOC_SERIES_NRF53X=y -CONFIG_SOC_NRF5340_CPUAPP_QKAA=y -CONFIG_BOARD_ZSWATCH_NRF5340_CPUAPP=y - # Enable MPU CONFIG_ARM_MPU=y @@ -13,17 +9,15 @@ CONFIG_HW_STACK_PROTECTION=y # Enable TrustZone-M CONFIG_ARM_TRUSTZONE_M=y -# Enable GPIO +# enable GPIO CONFIG_GPIO=y -# Enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -# Enable uart driver -CONFIG_SERIAL=y +# Disable uart driver +CONFIG_SERIAL=n -CONFIG_PINCTRL=y +# disable console +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y # Ensure GPIO P0.01 and P0.00 can be used diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_ns.dts b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_ns.dts similarity index 69% rename from app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_ns.dts rename to app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_ns.dts index 78d43d0f..e4635f9d 100644 --- a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_ns.dts +++ b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_ns.dts @@ -1,16 +1,16 @@ /* - * Copyright (c) 2023 Jakob Krantz + * Copyright (c) 2020 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ /dts-v1/; #include -#include "zswatch_nrf5340_common.dts" +#include "nrf5340_cpuapp_common.dtsi" / { model = "ZSWatch NRF5340 Application"; - compatible = "nordic,zswatch-nrf5340-cpuapp"; + compatible = "jakkra,zswatch-nrf5340-cpuapp"; chosen { zephyr,sram = &sram0_ns; diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_ns.yaml b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_ns.yaml similarity index 73% rename from app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_ns.yaml rename to app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_ns.yaml index 6aea4d03..52e8af61 100644 --- a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_ns.yaml +++ b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_ns.yaml @@ -1,4 +1,4 @@ -identifier: zswatch_nrf5340_cpuapp_ns +identifier: zswatch/nrf5340/cpuapp/ns name: ZSWatch-NRF5340-application-MCU-Non-Secure type: mcu arch: arm @@ -14,4 +14,8 @@ supported: - watchdog - usb_cdc - usb_device + - usbd - netif:openthread + - gpio + - spi +vendor: nordic diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_ns_defconfig b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_ns_defconfig similarity index 63% rename from app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_ns_defconfig rename to app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_ns_defconfig index 2579efe1..563241ad 100644 --- a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpuapp_ns_defconfig +++ b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpuapp_ns_defconfig @@ -1,9 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_SOC_SERIES_NRF53X=y -CONFIG_SOC_NRF5340_CPUAPP_QKAA=y -CONFIG_BOARD_ZSWATCH_NRF5340_CPUAPP_NS=y - # Enable MPU CONFIG_ARM_MPU=y @@ -16,17 +12,15 @@ CONFIG_ARM_TRUSTZONE_M=y # This Board implies building Non-Secure firmware CONFIG_TRUSTED_EXECUTION_NONSECURE=y -# Enable GPIO +# enable GPIO CONFIG_GPIO=y -# Enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y - -# Enable uart driver -CONFIG_SERIAL=y +# Disable uart driver +CONFIG_SERIAL=n -CONFIG_PINCTRL=y +# disable console +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y # Ensure GPIO P0.01 and P0.00 can be used diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet-pinctrl.dtsi b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpunet-pinctrl.dtsi similarity index 100% rename from app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet-pinctrl.dtsi rename to app/boards/jakkra/zswatch/zswatch_nrf5340_cpunet-pinctrl.dtsi diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet.dts b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpunet.dts similarity index 65% rename from app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet.dts rename to app/boards/jakkra/zswatch/zswatch_nrf5340_cpunet.dts index cf7c181b..414418ad 100644 --- a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet.dts +++ b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpunet.dts @@ -9,8 +9,8 @@ #include "zswatch_nrf5340_cpunet-pinctrl.dtsi" / { - model = "Nordic ZSWatch NRF5340 Network"; - compatible = "nordic,zswatch-nrf5340-cpunet"; + model = "ZSWatch NRF5340 Network"; + compatible = "jakkra,zswatch-nrf5340-cpunet"; chosen { zephyr,console = &uart0; @@ -19,11 +19,14 @@ zephyr,bt-mon-uart = &uart0; zephyr,bt-c2h-uart = &uart0; zephyr,bt-hci-ipc = &ipc0; + nordic,802154-spinel-ipc = &ipc0; zephyr,sram = &sram1; zephyr,flash = &flash1; zephyr,code-partition = &slot0_partition; + zephyr,ieee802154 = &ieee802154; }; + /* These aliases are provided for compatibility with samples */ aliases { watchdog0 = &wdt; }; @@ -42,7 +45,6 @@ }; &uart0 { - compatible = "nordic,nrf-uarte"; status = "disabled"; current-speed = <115200>; pinctrl-0 = <&uart0_default>; @@ -51,6 +53,7 @@ }; &flash1 { + partitions { compatible = "fixed-partitions"; #address-cells = <1>; @@ -62,15 +65,11 @@ }; slot0_partition: partition@c000 { label = "image-0"; - reg = <0x0000C000 0x12000>; + reg = <0x0000C000 0x17000>; }; - slot1_partition: partition@1e000 { + slot1_partition: partition@23000 { label = "image-1"; - reg = <0x0001E000 0x12000>; - }; - scratch_partition: partition@30000 { - label = "image-scratch"; - reg = <0x00030000 0xa000>; + reg = <0x00023000 0x17000>; }; storage_partition: partition@3a000 { label = "storage"; @@ -79,16 +78,9 @@ }; }; -// Zephyr gets mad if this is not set, even thought we don't do any switching -&radio { +&ieee802154 { status = "okay"; - dfe-antenna-num = <10>; - dfe-pdu-antenna = <0x1>; - dfegpio0-gpios = <&gpio1 1 0>; - dfegpio1-gpios = <&gpio1 1 0>; - dfegpio2-gpios = <&gpio1 1 0>; - dfegpio3-gpios = <&gpio1 1 0>; }; /* Include shared RAM configuration file */ -#include "zswatch_nrf5340_shared_sram_planning_conf.dts" +#include "nrf5340_shared_sram_planning_conf.dtsi" diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet.yaml b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpunet.yaml similarity index 54% rename from app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet.yaml rename to app/boards/jakkra/zswatch/zswatch_nrf5340_cpunet.yaml index 4aa1d01d..52ffc47c 100644 --- a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet.yaml +++ b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpunet.yaml @@ -1,5 +1,5 @@ -identifier: zswatch_nrf5340_cpunet -name: ZSWatch-NRF5340-network-MCU +identifier: zswatch/nrf5340/cpunet +name: ZSWATCH-NRF5340-network-MCU type: mcu arch: arm toolchain: @@ -10,3 +10,5 @@ ram: 64 flash: 256 supported: - watchdog + - gpio +vendor: jakkra diff --git a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet_defconfig b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpunet_defconfig similarity index 54% rename from app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet_defconfig rename to app/boards/jakkra/zswatch/zswatch_nrf5340_cpunet_defconfig index 75d1abba..0789c479 100644 --- a/app/boards/arm/zswatch_nrf5340/zswatch_nrf5340_cpunet_defconfig +++ b/app/boards/jakkra/zswatch/zswatch_nrf5340_cpunet_defconfig @@ -1,21 +1,21 @@ # SPDX-License-Identifier: Apache-2.0 -CONFIG_SOC_SERIES_NRF53X=y -CONFIG_SOC_NRF5340_CPUNET_QKAA=y -CONFIG_BOARD_ZSWATCH_NRF5340_CPUNET=y - # Enable MPU CONFIG_ARM_MPU=y # Enable hardware stack protection CONFIG_HW_STACK_PROTECTION=y -# Enable GPIO +# enable GPIO CONFIG_GPIO=y -CONFIG_PINCTRL=y +# Disable uart driver +CONFIG_SERIAL=n + +# disable console +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n -# This board does not have external CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y # Ensure GPIO P0.01 and P0.00 can be used -CONFIG_SOC_ENABLE_LFXO=n +CONFIG_SOC_ENABLE_LFXO=n \ No newline at end of file diff --git a/app/src/history/zsw_history.c b/app/src/history/zsw_history.c index 2a7af8a8..244c46ac 100644 --- a/app/src/history/zsw_history.c +++ b/app/src/history/zsw_history.c @@ -97,7 +97,7 @@ int zsw_history_init(zsw_history_t *p_history, uint32_t max_samples, uint8_t sam #ifdef CONFIG_SETTINGS_NVS struct nvs_fs *nvs_storage; - rc = settings_storage_get((void**)&nvs_storage); + rc = settings_storage_get((void **)&nvs_storage); __ASSERT(rc == 0, "Error during settings storage get! Error: %d", rc); // As long as history is storing all samples as one key, we have a limit of NVS sector size for total size of samples