diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1b788224..d31ab6c9 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,6 @@ { - "name": "nrf-connect:v2.4", - "image": "nordicplayground/nrfconnect-sdk:v2.5-branch", + "name": "nrf-connect:v2.7", + "image": "nordicplayground/nrfconnect-sdk:v2.7-branch", "features": { }, "customizations": { diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 583bd4a0..c6190a5a 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -4,9 +4,9 @@ inputs: sample-dir: description: "Sample directory to build" required: true - board: - description: "Board definition to use" - default: bparasite_nrf52840 + soc: + description: "SoC to use" + default: nrf52840 revision: description: "Board revision use" default: "2.0.0" @@ -18,10 +18,10 @@ runs: steps: - run: | docker run --rm -v ${GITHUB_WORKSPACE}:/repo \ - nordicplayground/nrfconnect-sdk:v2.5-branch \ + nordicplayground/nrfconnect-sdk:v2.7-branch \ west build \ - --build-dir /repo/${{ inputs.sample-dir }}/build \ + --build-dir /repo/${{ inputs.sample-dir }}/build_${{ inputs.soc }}_${{ inputs.revision }} \ --pristine \ - --board ${{ inputs.board }}@${{ inputs.revision }} \ + --board bparasite@${{ inputs.revision }}/${{ inputs.soc }} \ /repo/${{ inputs.sample-dir }} -- ${{ inputs.cmake-extra }} shell: bash diff --git a/.github/workflows/b-parasite.yml b/.github/workflows/b-parasite.yml index 9720cea5..8ec7d64e 100644 --- a/.github/workflows/b-parasite.yml +++ b/.github/workflows/b-parasite.yml @@ -32,7 +32,7 @@ jobs: uses: ./.github/actions/build with: sample-dir: code/nrf-connect/samples/blinky - board: bparasite_nrf52840 + soc: nrf52840 revision: 2.0.0 output-bin: blinky_nrf52840.hex @@ -48,7 +48,7 @@ jobs: uses: ./.github/actions/build with: sample-dir: code/nrf-connect/samples/input - board: bparasite_nrf52840 + soc: nrf52840 revision: 2.0.0 output-bin: input_nrf52840.hex @@ -64,7 +64,7 @@ jobs: uses: ./.github/actions/build with: sample-dir: code/nrf-connect/samples/soil_read_loop - board: bparasite_nrf52840 + soc: nrf52840 revision: 2.0.0 output-bin: soil_read_loop_nrf52840.hex @@ -84,7 +84,7 @@ jobs: uses: ./.github/actions/build with: sample-dir: code/nrf-connect/samples/ble - board: bparasite_${{ matrix.soc }} + soc: ${{ matrix.soc }} revision: ${{ matrix.revision }} cmake-extra: -DCONFIG_PRST_BLE_ENCODING_BTHOME_V2=y -DCONFIG_PRST_SLEEP_DURATION_MSEC=1000 -DCONFIG_PRSTLIB_LOG_LEVEL_DBG=y output-bin: ble_${{ matrix.soc }}_${{ matrix.revision }}_debug.hex @@ -105,7 +105,7 @@ jobs: uses: ./.github/actions/build with: sample-dir: code/nrf-connect/samples/zigbee - board: bparasite_${{ matrix.soc }} + soc: ${{ matrix.soc }} revision: ${{ matrix.revision }} cmake-extra: -DCONFIG_PRSTLIB_LOG_LEVEL_DBG=y output-bin: zigbee_${{ matrix.soc }}_${{ matrix.revision }}_debug.hex diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/Kconfig.board b/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/Kconfig.board deleted file mode 100644 index b0dca24b..00000000 --- a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/Kconfig.board +++ /dev/null @@ -1,4 +0,0 @@ - -config BOARD_BPARASITE_NRF52833 - bool "b-parasite nRF52833 board" - depends on SOC_NRF52833_QIAA \ No newline at end of file diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/board.cmake b/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/board.cmake deleted file mode 100644 index 34752027..00000000 --- a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/board.cmake +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -board_runner_args(jlink "--device=nRF52833_xxAA" "--speed=4000") -board_runner_args(pyocd "--target=nrf52833" "--frequency=4000000") -# set(OPENOCD_NRF5_SUBFAMILY "nrf52") -include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) -include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) -include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) -include(${ZEPHYR_BASE}/boards/common/openocd-nrf5.board.cmake) -include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake) \ No newline at end of file diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/revision.cmake b/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/revision.cmake deleted file mode 100644 index 9b7df2db..00000000 --- a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/revision.cmake +++ /dev/null @@ -1 +0,0 @@ -board_check_revision(FORMAT MAJOR.MINOR.PATCH) \ No newline at end of file diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/Kconfig b/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/Kconfig deleted file mode 100644 index 4ce925fe..00000000 --- a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/Kconfig +++ /dev/null @@ -1,14 +0,0 @@ - -if BOARD_BPARASITE_NRF52840 - -config BOARD_ENABLE_DCDC - bool "DCDC mode" - select SOC_DCDC_NRF52X - default y - -config BOARD_ENABLE_DCDC_HV - bool "High Voltage DCDC converter" - select SOC_DCDC_NRF52X_HV - default y - -endif # BOARD_BPARASITE_NRF52840 diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/Kconfig.board b/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/Kconfig.board deleted file mode 100644 index a72a7a24..00000000 --- a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/Kconfig.board +++ /dev/null @@ -1,4 +0,0 @@ - -config BOARD_BPARASITE_NRF52840 - bool "b-parasite nRF52840 board" - depends on SOC_NRF52840_QIAA \ No newline at end of file diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/Kconfig.defconfig b/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/Kconfig.defconfig deleted file mode 100644 index 969d54dc..00000000 --- a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/Kconfig.defconfig +++ /dev/null @@ -1,18 +0,0 @@ - -if BOARD_BPARASITE_NRF52840 - -config BOARD - default "bparasite_nrf52840" - -config BOARD_REVISION - string "Board revision." - default "1.0.0" - -config BOARD_REVISION_CODE - int "Board revision code. An integer representation of the board revision." - default 1 - -config BT_CTLR - default BT - -endif # BOARD_BPARASITE_NRF52840 \ No newline at end of file diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840_1_0_0.conf b/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840_1_0_0.conf deleted file mode 100644 index e69de29b..00000000 diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/pre_dt_board.cmake b/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/pre_dt_board.cmake deleted file mode 100644 index 3369c21d..00000000 --- a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/pre_dt_board.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) 2022 Nordic Semiconductor -# SPDX-License-Identifier: Apache-2.0 - -# Suppress "unique_unit_address_if_enabled" to handle the following overlaps: -# - power@40000000 & clock@40000000 & bprot@40000000 -# - acl@4001e000 & flash-controller@4001e000 -list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled") diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/revision.cmake b/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/revision.cmake deleted file mode 100644 index 9b7df2db..00000000 --- a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/revision.cmake +++ /dev/null @@ -1 +0,0 @@ -board_check_revision(FORMAT MAJOR.MINOR.PATCH) \ No newline at end of file diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/Kconfig b/code/nrf-connect/prstlib/boards/bparasite/Kconfig similarity index 56% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/Kconfig rename to code/nrf-connect/prstlib/boards/bparasite/Kconfig index a0c83d33..68a42a61 100644 --- a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/Kconfig +++ b/code/nrf-connect/prstlib/boards/bparasite/Kconfig @@ -1,9 +1,9 @@ -if BOARD_BPARASITE_NRF52833 +if BOARD_BPARASITE config BOARD_ENABLE_DCDC bool "DCDC mode" select SOC_DCDC_NRF52X default y -endif # BOARD_BPARASITE_NRF52833 +endif # BOARD_BPARASITE diff --git a/code/nrf-connect/prstlib/boards/bparasite/Kconfig.bparasite b/code/nrf-connect/prstlib/boards/bparasite/Kconfig.bparasite new file mode 100644 index 00000000..10715c37 --- /dev/null +++ b/code/nrf-connect/prstlib/boards/bparasite/Kconfig.bparasite @@ -0,0 +1,5 @@ + +config BOARD_BPARASITE + bool "b-parasite board" + select SOC_NRF52833_QIAA if BOARD_BPARASITE_NRF52833 + select SOC_NRF52840_QIAA if BOARD_BPARASITE_NRF52840 \ No newline at end of file diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/Kconfig.defconfig b/code/nrf-connect/prstlib/boards/bparasite/Kconfig.defconfig similarity index 71% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/Kconfig.defconfig rename to code/nrf-connect/prstlib/boards/bparasite/Kconfig.defconfig index 637d11c1..703c8650 100644 --- a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/Kconfig.defconfig +++ b/code/nrf-connect/prstlib/boards/bparasite/Kconfig.defconfig @@ -1,8 +1,8 @@ -if BOARD_BPARASITE_NRF52833 +if BOARD_BPARASITE config BOARD - default "bparasite_nrf52833" + default "bparasite" config BOARD_REVISION string "Board revision." @@ -15,4 +15,4 @@ config BOARD_REVISION_CODE config BT_CTLR default BT -endif # BOARD_BPARASITE_NRF52833 \ No newline at end of file +endif # BOARD_BPARASITE \ No newline at end of file diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/board.cmake b/code/nrf-connect/prstlib/boards/bparasite/board.cmake similarity index 71% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/board.cmake rename to code/nrf-connect/prstlib/boards/bparasite/board.cmake index c3746997..7ff801a8 100644 --- a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/board.cmake +++ b/code/nrf-connect/prstlib/boards/bparasite/board.cmake @@ -1,7 +1,13 @@ # SPDX-License-Identifier: Apache-2.0 +if (CONFIG_BPARASITE_NRF52833) +board_runner_args(jlink "--device=nRF52833_xxAA" "--speed=4000") +board_runner_args(pyocd "--target=nrf52833" "--frequency=4000000") +elseif (CONFIG_BPARASITE_NRF52840) board_runner_args(jlink "--device=nRF52840_xxAA" "--speed=4000") board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000") +endif() + # set(OPENOCD_NRF5_SUBFAMILY "nrf52") include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/code/nrf-connect/prstlib/boards/bparasite/board.yml b/code/nrf-connect/prstlib/boards/bparasite/board.yml new file mode 100644 index 00000000..fcde1613 --- /dev/null +++ b/code/nrf-connect/prstlib/boards/bparasite/board.yml @@ -0,0 +1,13 @@ +board: + name: bparasite + socs: + - name: nrf52833 + - name: nrf52840 + revision: + format: major.minor.patch + default: "2.0.0" + revisions: + - name: "1.0.0" + - name: "1.1.0" + - name: "1.2.0" + - name: "2.0.0" diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833-pinctrl.dtsi b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833-pinctrl.dtsi similarity index 100% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833-pinctrl.dtsi rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833-pinctrl.dtsi diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833.dts b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833.dts similarity index 100% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833.dts rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833.dts diff --git a/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833.yaml b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833.yaml new file mode 100644 index 00000000..4356893c --- /dev/null +++ b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833.yaml @@ -0,0 +1,2 @@ +identifier: bparasite/nrf52833 +name: "b-parasite nRF52833" diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833_1_0_0.overlay b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833_1_0_0.overlay similarity index 100% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833_1_0_0.overlay rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833_1_0_0.overlay diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833_1_0_0.conf b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833_1_0_0_defconfig similarity index 100% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833_1_0_0.conf rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833_1_0_0_defconfig diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833_1_1_0.overlay b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833_1_1_0.overlay similarity index 100% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833_1_1_0.overlay rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833_1_1_0.overlay diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833_1_1_0.conf b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833_1_1_0_defconfig similarity index 100% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833_1_1_0.conf rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833_1_1_0_defconfig diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833_1_2_0.overlay b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833_1_2_0.overlay similarity index 100% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833_1_2_0.overlay rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833_1_2_0.overlay diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833_1_2_0.conf b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833_1_2_0_defconfig similarity index 100% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833_1_2_0.conf rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833_1_2_0_defconfig diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833_2_0_0.overlay b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833_2_0_0.overlay similarity index 100% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833_2_0_0.overlay rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833_2_0_0.overlay diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833_2_0_0.conf b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833_2_0_0_defconfig similarity index 100% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833_2_0_0.conf rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833_2_0_0_defconfig diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833_defconfig b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833_defconfig similarity index 65% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833_defconfig rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833_defconfig index f18797f5..9e4e9e3a 100644 --- a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/bparasite_nrf52833_defconfig +++ b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52833_defconfig @@ -1,8 +1,3 @@ - -CONFIG_SOC_SERIES_NRF52X=y -CONFIG_SOC_NRF52833_QIAA=y -CONFIG_BOARD_BPARASITE_NRF52833=y - # Enable MPU CONFIG_ARM_MPU=y diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840-pinctrl.dtsi b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840-pinctrl.dtsi similarity index 100% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840-pinctrl.dtsi rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840-pinctrl.dtsi diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840.dts b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840.dts similarity index 100% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840.dts rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840.dts diff --git a/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840.yaml b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840.yaml new file mode 100644 index 00000000..7f16be2c --- /dev/null +++ b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840.yaml @@ -0,0 +1,2 @@ +identifier: bparasite/nrf52840 +name: "b-parasite nRF52840" diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840_1_0_0.overlay b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840_1_0_0.overlay similarity index 100% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840_1_0_0.overlay rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840_1_0_0.overlay diff --git a/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840_1_0_0_defconfig b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840_1_0_0_defconfig new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840_1_0_0_defconfig @@ -0,0 +1 @@ + diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840_1_1_0.overlay b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840_1_1_0.overlay similarity index 100% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840_1_1_0.overlay rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840_1_1_0.overlay diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840_1_1_0.conf b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840_1_1_0_defconfig similarity index 100% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840_1_1_0.conf rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840_1_1_0_defconfig diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840_1_2_0.overlay b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840_1_2_0.overlay similarity index 100% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840_1_2_0.overlay rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840_1_2_0.overlay diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840_1_2_0.conf b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840_1_2_0_defconfig similarity index 100% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840_1_2_0.conf rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840_1_2_0_defconfig diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840_2_0_0.overlay b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840_2_0_0.overlay similarity index 100% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840_2_0_0.overlay rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840_2_0_0.overlay diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840_2_0_0.conf b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840_2_0_0_defconfig similarity index 100% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840_2_0_0.conf rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840_2_0_0_defconfig diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840_defconfig b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840_defconfig similarity index 65% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840_defconfig rename to code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840_defconfig index 386002b2..9e4e9e3a 100644 --- a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52840/bparasite_nrf52840_defconfig +++ b/code/nrf-connect/prstlib/boards/bparasite/bparasite_nrf52840_defconfig @@ -1,8 +1,3 @@ - -CONFIG_SOC_SERIES_NRF52X=y -CONFIG_SOC_NRF52840_QIAA=y -CONFIG_BOARD_BPARASITE_NRF52840=y - # Enable MPU CONFIG_ARM_MPU=y diff --git a/code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/pre_dt_board.cmake b/code/nrf-connect/prstlib/boards/bparasite/pre_dt_board.cmake similarity index 100% rename from code/nrf-connect/prstlib/boards/arm/bparasite_nrf52833/pre_dt_board.cmake rename to code/nrf-connect/prstlib/boards/bparasite/pre_dt_board.cmake diff --git a/code/nrf-connect/prstlib/include/prstlib/macros.h b/code/nrf-connect/prstlib/include/prstlib/macros.h index 2049d9ea..0e93aacd 100644 --- a/code/nrf-connect/prstlib/include/prstlib/macros.h +++ b/code/nrf-connect/prstlib/include/prstlib/macros.h @@ -21,4 +21,6 @@ #define UNUSED_OK(expr) (void)expr; +#define DOUBLE_PROMO_OK(expr) (double)(expr) + #endif // _PRST_MACROS_H_ \ No newline at end of file diff --git a/code/nrf-connect/prstlib/src/adc.c b/code/nrf-connect/prstlib/src/adc.c index 33c1df6e..e2a26dc2 100644 --- a/code/nrf-connect/prstlib/src/adc.c +++ b/code/nrf-connect/prstlib/src/adc.c @@ -97,7 +97,8 @@ static inline float get_soil_moisture_percent(float battery_voltage, const float wet = eval_poly(wet_coeffs, x); const float percent = (raw_adc_output - dry) / (wet - dry); LOG_DBG("Read soil moisture 2: %.2f | Raw %u | Batt: %.2f | Dry: %.2f | Wet: %.2f", - 100.0f * percent, raw_adc_output, x, dry, wet); + DOUBLE_PROMO_OK(100 * percent), + raw_adc_output, DOUBLE_PROMO_OK(x), DOUBLE_PROMO_OK(dry), DOUBLE_PROMO_OK(wet)); return percent; } @@ -177,7 +178,7 @@ int prst_adc_photo_read(float battery_voltage, prst_adc_photo_sensor_t* out) { const float current_sun = 3.59e-3f; const float current = out->adc_read.voltage / phototransistor_resistor; out->brightness = MAX(0, MIN(lux_sun * current / current_sun, UINT16_MAX)); - LOG_DBG("Read phototransistor: %u lx | %.2f V", out->brightness, out->adc_read.voltage); + LOG_DBG("Read phototransistor: %u lx | %.2f V", out->brightness, DOUBLE_PROMO_OK(out->adc_read.voltage)); #elif DT_NODE_EXISTS(DT_NODELABEL(ldr)) RET_IF_ERR(gpio_pin_set_dt(&ldr_enable_dt, 1)); @@ -201,7 +202,7 @@ int prst_adc_photo_read(float battery_voltage, prst_adc_photo_sensor_t* out) { const float pow_value = 1.5832f; out->brightness = MAX(0, MIN(mult_value / powf(photo_resistance, pow_value), UINT16_MAX)); - LOG_DBG("Read LDR: %u lx | %.2f V", out->brightness, out->adc_read.voltage); + LOG_DBG("Read LDR: %u lx | %.2f V", out->brightness, DOUBLE_PROMO_OK(out->adc_read.voltage)); #endif diff --git a/code/nrf-connect/prstlib/src/sensors.c b/code/nrf-connect/prstlib/src/sensors.c index ce9bfd55..1cc66945 100644 --- a/code/nrf-connect/prstlib/src/sensors.c +++ b/code/nrf-connect/prstlib/src/sensors.c @@ -15,12 +15,12 @@ int prst_sensors_read_all(prst_sensors_t *sensors) { RET_IF_ERR(prst_shtc3_read(&sensors->shtc3)) LOG_DBG("Batt: %d mV (%.2f%%)", sensors->batt.adc_read.millivolts, - 100 * sensors->batt.percentage); - LOG_DBG("Soil: %.0f %%", 100 * sensors->soil.percentage); + DOUBLE_PROMO_OK(100 * sensors->batt.percentage)); + LOG_DBG("Soil: %.0f %%", DOUBLE_PROMO_OK(100 * sensors->soil.percentage)); LOG_DBG("Photo: %u lx (%d mV)", sensors->photo.brightness, sensors->photo.adc_read.millivolts); - LOG_DBG("Temp: %f oC", sensors->shtc3.temp_c); - LOG_DBG("Humi: %.0f %%", 100 * sensors->shtc3.rel_humi); + LOG_DBG("Temp: %f oC", DOUBLE_PROMO_OK(sensors->shtc3.temp_c)); + LOG_DBG("Humi: %.0f %%", DOUBLE_PROMO_OK(100 * sensors->shtc3.rel_humi)); LOG_DBG("--------------------------------------------------"); return 0; diff --git a/code/nrf-connect/prstlib/src/shtc3.c b/code/nrf-connect/prstlib/src/shtc3.c index f42e68d5..d56629b9 100644 --- a/code/nrf-connect/prstlib/src/shtc3.c +++ b/code/nrf-connect/prstlib/src/shtc3.c @@ -46,7 +46,7 @@ int prst_shtc3_read(prst_shtc3_read_t *out) { out->temp_c = -45 + 175 * ((float)((buff[0] << 8) | buff[1])) / (1 << 16); out->rel_humi = ((float)((buff[3] << 8) | buff[4])) / UINT16_MAX; - LOG_DBG("Read temp: %f oC (%d)", out->temp_c, (int)out->temp_c); - LOG_DBG("Read humi: %.0f %%", 100.0 * out->rel_humi); + LOG_DBG("Read temp: %f oC (%d)", DOUBLE_PROMO_OK(out->temp_c), (int)out->temp_c); + LOG_DBG("Read humi: %.0f %%", DOUBLE_PROMO_OK(100.0f * out->rel_humi)); return 0; } \ No newline at end of file diff --git a/code/nrf-connect/samples/ble/nrf52840dk_nrf52840.overlay b/code/nrf-connect/samples/ble/nrf52840dk_nrf52840.overlay deleted file mode 100644 index 6e86aaf1..00000000 --- a/code/nrf-connect/samples/ble/nrf52840dk_nrf52840.overlay +++ /dev/null @@ -1,86 +0,0 @@ -&pinctrl { - /* Configure pwm0 instance to use pin 5. */ - pwm0_default: pwm0_default { - group1 { - psels = ; - nordic,invert; - }; - }; - - pwm0_sleep: pwm0_sleep { - group1 { - psels = ; - low-power-enable; - }; - }; - - /* Configure i2c0 instance to use pins 24 (SDA) & 13 (SCL). */ - i2c0_default: i2c0_default { - group1 { - psels = , - ; - }; - }; - - i2c0_sleep: i2c0_sleep { - group1 { - psels = , - ; - low-power-enable; - }; - }; -}; - -&i2c0 { - shtc3: shtc3@70 { - compatible = "i2c-device"; - reg = <0x70>; - label = "SHTC3"; - }; -}; - -&adc { - #address-cells = <1>; - #size-cells = <0>; - channel@0 { - reg = <0>; - zephyr,gain = "ADC_GAIN_1_6"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - // P0.03. - zephyr,input-positive = ; - zephyr,resolution = <10>; - - }; - - channel@1 { - reg = <1>; - zephyr,gain = "ADC_GAIN_1_6"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - // P0.02. - zephyr,input-positive = ; - zephyr,resolution = <10>; - }; - - channel@2 { - reg = <2>; - zephyr,gain = "ADC_GAIN_1_6"; - zephyr,reference = "ADC_REF_INTERNAL"; - zephyr,acquisition-time = ; - zephyr,input-positive = ; - zephyr,resolution = <10>; - }; -}; - -/ { - zephyr,user { - io-channels = <&adc 0>, <&adc 1>, <&adc 2>; - }; - - soil_pwm: soil_pwm { - compatible = "pwm-fixed"; - pwms = <&pwm0 0 PWM_MSEC(100) PWM_POLARITY_INVERTED>; - pulse = ; - }; -}; \ No newline at end of file diff --git a/code/nrf-connect/samples/soil_read_loop/src/main.c b/code/nrf-connect/samples/soil_read_loop/src/main.c index 7fc1c08b..86ca7831 100644 --- a/code/nrf-connect/samples/soil_read_loop/src/main.c +++ b/code/nrf-connect/samples/soil_read_loop/src/main.c @@ -64,6 +64,6 @@ int main(void) { int32_t soil_val_mv = soil_buf; RET_IF_ERR(adc_raw_to_millivolts_dt(&adc_soil_spec, &soil_val_mv)); - LOG_INF("%.2f;%u", batt_val_mv / 1000.0f, soil_buf); + LOG_INF("%.2f;%u", DOUBLE_PROMO_OK(batt_val_mv / 1000.0f), soil_buf); } } diff --git a/code/nrf-connect/samples/zigbee/src/prst_zb_soil_moisture_defs.h b/code/nrf-connect/samples/zigbee/src/prst_zb_soil_moisture_defs.h index 8c01ae22..e0cb070a 100644 --- a/code/nrf-connect/samples/zigbee/src/prst_zb_soil_moisture_defs.h +++ b/code/nrf-connect/samples/zigbee/src/prst_zb_soil_moisture_defs.h @@ -29,6 +29,7 @@ void prst_zcl_soil_moisture_init_client(void); PRST_ZB_ZCL_ATTR_SOIL_MOISTURE_VALUE_ID, \ ZB_ZCL_ATTR_TYPE_U16, \ ZB_ZCL_ATTR_ACCESS_READ_ONLY | ZB_ZCL_ATTR_ACCESS_REPORTING, \ + (ZB_ZCL_NON_MANUFACTURER_SPECIFIC), \ (void*)data_ptr \ }