Bluetooth: Mesh: add tf-m support for ble mesh

This PR adds ability to build mesh with tf-m psa
for platforms those support tf-m.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
This commit is contained in:
Aleksandr Khromykh 2023-05-31 14:09:21 +02:00 committed by Carles Cufí
commit 327eb119b6
22 changed files with 132 additions and 12 deletions

View file

@ -0,0 +1,33 @@
CONFIG_IPC_SERVICE=y
CONFIG_MBOX=y
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_MAIN_STACK_SIZE=512
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512
CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_HCI_RAW_RESERVE=1
CONFIG_BT_MAX_CONN=16
# Workaround: Unable to allocate command buffer when using K_NO_WAIT since
# Host number of completed commands does not follow normal flow control.
CONFIG_BT_BUF_CMD_TX_COUNT=10
# Controller
CONFIG_BT_LL_SW_SPLIT=y
# Disable unused Bluetooth features
CONFIG_BT_CTLR_DUP_FILTER_LEN=0
CONFIG_BT_CTLR_LE_ENC=n
CONFIG_BT_CTLR_LE_PING=n
CONFIG_BT_DATA_LEN_UPDATE=n
CONFIG_BT_PHY_UPDATE=n
CONFIG_BT_CTLR_MIN_USED_CHAN=n
CONFIG_BT_CTLR_PRIVACY=n
CONFIG_BT_OBSERVER=y
CONFIG_BT_BROADCASTER=y
CONFIG_BT_EXT_ADV=y

View file

@ -82,3 +82,10 @@ tests:
platform_allow: nrf5340dk_nrf5340_cpunet
integration_platforms:
- nrf5340dk_nrf5340_cpunet
sample.bluetooth.hci_rpmsg.mesh.bt_ll_sw_split:
harness: bluetooth
tags: bluetooth
extra_args: CONF_FILE="nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf"
platform_allow: nrf5340dk_nrf5340_cpunet
integration_platforms:
- nrf5340dk_nrf5340_cpunet

View file

@ -13,3 +13,9 @@ if (BOARD STREQUAL bbc_microbit)
else()
target_sources(app PRIVATE src/board.c)
endif()
if (CONFIG_BUILD_WITH_TFM)
target_include_directories(app PRIVATE
$<TARGET_PROPERTY:tfm,TFM_BINARY_DIR>/install/interface/include
)
endif()

View file

@ -44,6 +44,12 @@ For other boards, build and flash the application as follows:
Refer to your :ref:`board's documentation <boards>` for alternative
flash instructions if your board doesn't support the ``flash`` target.
To run the application on an :ref:`nrf5340dk_nrf5340`, a Bluetooth controller application
must also run on the network core. The :ref:`bluetooth-hci-rpmsg-sample` sample
application may be used. Build this sample with configuration
:zephyr_file:`samples/bluetooth/hci_rpmg/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf`
to enable mesh support.
Interacting with the sample
***************************

View file

@ -0,0 +1,3 @@
# Known issue: non secure platforms do not work with settings subsystem.
CONFIG_SETTINGS=n
CONFIG_BT_SETTINGS=n

View file

@ -13,7 +13,6 @@ CONFIG_BT_MESH_PB_ADV=n
CONFIG_BT=y
CONFIG_BT_DEVICE_NAME="Zephyr Mesh"
CONFIG_BT_TINYCRYPT_ECC=y
CONFIG_BT_RX_STACK_SIZE=1400
CONFIG_BT_L2CAP_TX_BUF_COUNT=5
CONFIG_BT_EXT_ADV=n

View file

@ -8,7 +8,6 @@ CONFIG_SETTINGS=y
CONFIG_HWINFO=y
CONFIG_BT=y
CONFIG_BT_TINYCRYPT_ECC=y
CONFIG_BT_L2CAP_TX_BUF_COUNT=5
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_OBSERVER=y

View file

@ -7,6 +7,7 @@ tests:
- bbc_microbit
- qemu_x86
- nrf52840dk_nrf52840
- nrf5340dk_nrf5340_cpuapp_ns
integration_platforms:
- qemu_x86
tags: bluetooth

View file

@ -12,3 +12,9 @@ target_sources_ifdef(CONFIG_BOARD_BBC_MICROBIT app PRIVATE src/microbit.c)
if(NODE_ADDR)
zephyr_compile_definitions(NODE_ADDR=${NODE_ADDR})
endif()
if (CONFIG_BUILD_WITH_TFM)
target_include_directories(app PRIVATE
$<TARGET_PROPERTY:tfm,TFM_BINARY_DIR>/install/interface/include
)
endif()

View file

@ -54,3 +54,9 @@ For other boards, build and flash the application as follows:
Refer to your :ref:`board's documentation <boards>` for alternative
flash instructions if your board doesn't support the ``flash`` target.
To run the application on an :ref:`nrf5340dk_nrf5340`, a Bluetooth controller application
must also run on the network core. The :ref:`bluetooth-hci-rpmsg-sample` sample
application may be used. Build this sample with configuration
:zephyr_file:`samples/bluetooth/hci_rpmg/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf`
to enable mesh support.

View file

@ -0,0 +1,3 @@
# Known issue: non secure platforms do not work with settings subsystem.
CONFIG_SETTINGS=n
CONFIG_BT_SETTINGS=n

View file

@ -2,10 +2,18 @@ CONFIG_MAIN_STACK_SIZE=512
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
CONFIG_BT=y
CONFIG_BT_TINYCRYPT_ECC=y
CONFIG_BT_OBSERVER=y
CONFIG_BT_BROADCASTER=y
CONFIG_BT_CTLR_DUP_FILTER_LEN=0
CONFIG_BT_CTLR_LE_ENC=n
CONFIG_BT_CTLR_LE_PING=n
CONFIG_BT_DATA_LEN_UPDATE=n
CONFIG_BT_PHY_UPDATE=n
CONFIG_BT_CTLR_MIN_USED_CHAN=n
CONFIG_BT_CTLR_PRIVACY=n
CONFIG_BT_CTLR_CHAN_SEL_2=n
CONFIG_BT_MESH=y
CONFIG_BT_MESH_RELAY=y
CONFIG_BT_MESH_SUBNET_COUNT=1

View file

@ -7,6 +7,7 @@ tests:
- bbc_microbit
- qemu_x86
- nrf52840dk_nrf52840
- nrf5340dk_nrf5340_cpuapp_ns
integration_platforms:
- qemu_x86
- bbc_microbit

View file

@ -7,3 +7,9 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(mesh_provisioner)
target_sources(app PRIVATE src/main.c)
if (CONFIG_BUILD_WITH_TFM)
target_include_directories(app PRIVATE
$<TARGET_PROPERTY:tfm,TFM_BINARY_DIR>/install/interface/include
)
endif()

View file

@ -52,3 +52,9 @@ For other boards, build and flash the application as follows:
Refer to your :ref:`board's documentation <boards>` for alternative
flash instructions if your board doesn't support the ``flash`` target.
To run the application on an :ref:`nrf5340dk_nrf5340`, a Bluetooth controller application
must also run on the network core. The :ref:`bluetooth-hci-rpmsg-sample` sample
application may be used. Build this sample with configuration
:zephyr_file:`samples/bluetooth/hci_rpmg/nrf5340_cpunet_bt_mesh-bt_ll_sw_split.conf`
to enable mesh support.

View file

@ -0,0 +1,3 @@
# Known issue: non secure platforms do not work with settings subsystem.
CONFIG_SETTINGS=n
CONFIG_BT_SETTINGS=n

View file

@ -5,11 +5,19 @@ CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
CONFIG_MAIN_THREAD_PRIORITY=-2
CONFIG_BT=y
CONFIG_BT_TINYCRYPT_ECC=y
#CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_OBSERVER=y
CONFIG_BT_BROADCASTER=y
CONFIG_BT_CTLR_DUP_FILTER_LEN=0
CONFIG_BT_CTLR_LE_ENC=n
CONFIG_BT_CTLR_LE_PING=n
CONFIG_BT_DATA_LEN_UPDATE=n
CONFIG_BT_PHY_UPDATE=n
CONFIG_BT_CTLR_MIN_USED_CHAN=n
CONFIG_BT_CTLR_PRIVACY=n
CONFIG_BT_CTLR_CHAN_SEL_2=n
CONFIG_BT_MESH=y
CONFIG_BT_MESH_SUBNET_COUNT=1
CONFIG_BT_MESH_APP_KEY_COUNT=1

View file

@ -6,6 +6,7 @@ tests:
platform_allow:
- qemu_x86
- nrf52840dk_nrf52840
- nrf5340dk_nrf5340_cpuapp_ns
integration_platforms:
- qemu_x86
tags: bluetooth