How does a nrf5340 communicate with several nrf5340s in both directions using BLE and Visual Studio?

Hi,

I am trying to create a simple network using nrf5340 boards using BLE and Visual Studio Code as follows:

1. Scenario 1 - Very simple network: one nrf5340 communicates with another nrf5340 to exchange the packet, e.g. {0x01, 0x02, .... The packet length can be changed.

2. Scenario 2: one nrf5340 A communicates with two nrf5340 boards B and C to exchange the same or different packets in both directions. For example, A can send the same packet or different packets to B and C and vice versa.

3. Scenario 3: Multiple nrf5340 boards communicate with two nrf5340 boards to exchange the same or different packets in both directions as in Scenario 2.

4. Scenario 4: Multiple nrf5340 boards A1, A2, ..., Ak communicate with two nrf5340 boards B and C as in Scenario 3. When Ai transmits, A1, A2, ...,  Ai-1, Ai+1, ... Ak, and B, C try to decode the transmitted packet and save the received packet.

Would you please suggest to me how to set up the 4 aforementioned scenarios from samples of Visual Studio Code?

Thank you very much,

Lan

Parents
  • Hi Kazi,

    Many thanks for your answer.

    I tried to change the transmit power when using the Peripheral_UART example. First, I used several functions from the hci_pwr_ctrl example such as 

    static void read_conn_rssi(uint16_t handle, int8_t *rssi), 
    static void set_tx_power(uint8_t handle_type, uint16_t handle, int8_t tx_pwr_lvl), 
    static void get_tx_power(uint8_t handle_type, uint16_t handle, int8_t *tx_pwr_lvl),
    and I called one function as 
    set_tx_power(BT_HCI_VS_LL_HANDLE_TYPE_CONN, 0, -40);
    The project is built well.
    CONFIG_BT_LL_SOFTDEVICE=n
    CONFIG_BT_LL_SW_SPLIT=y
    CONFIG_BT_CTLR_ADVANCED_FEATURES=y
    CONFIG_BT_CTLR=y
    CONFIG_BT_CTLR_CONN_RSSI=y
    CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y
    Then I rebuild the project again. However, the project can not be built with several warnings as follows:
    warning: Experimental symbol BT_LL_SW_SPLIT is enabled.


    warning: ENTROPY_NRF5_RNG (defined at drivers/entropy/Kconfig.nrf5:14) has direct dependencies !ENTROPY_NRF_FORCE_ALT && DT_HAS_NORDIC_NRF_RNG_ENABLED && ENTROPY_GENERATOR with value n, but is currently being y-selected by the following symbols:
    Parsing C:/testnRF/peripheral_uart_new/Kconfig
    Loaded configuration 'C:/ncs/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_ns_defconfig'
    Merged configuration 'C:/testnRF/peripheral_uart_new/prj.conf'
    Merged configuration 'C:/testnRF/peripheral_uart_new/build/zephyr/misc/generated/extra_kconfig_options.conf'
    - BT_LLL_VENDOR_NORDIC (defined at subsys/bluetooth\controller\Kconfig.ll_sw_split:8), with value y, direct dependencies SOC_COMPATIBLE_NRF && BT_LL_SW_SPLIT && BT_CTLR && BT_HCI && BT (value: y), and select condition SOC_COMPATIBLE_NRF && BT_LL_SW_SPLIT && BT_CTLR && BT_HCI && BT (value: y)

    error: Aborting due to Kconfig warnings

    CMake Error at C:/ncs/zephyr/cmake/modules/kconfig.cmake:293 (message):
    command failed with return code: 1
    Call Stack (most recent call first):
    C:/ncs/zephyr/cmake/modules/zephyr_default.cmake:121 (include)
    C:/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
    C:/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
    CMakeLists.txt:13 (find_package)


    -- Configuring incomplete, errors occurred!
    FATAL ERROR: command exited with status 1: 'c:\ncs\toolchains\v2.1.0\opt\bin\cmake.EXE' '-DWEST_PYTHON=c:\ncs\toolchains\v2.1.0\opt\bin\python.exe' '-Bc:\testnRF\peripheral_uart_new\build' -GNinja -DBOARD=nrf5340dk_nrf5340_cpuapp_ns -DNCS_TOOLCHAIN_VERSION:STRING=NONE -DCONFIG_DEBUG_OPTIMIZATIONS=y -DCONFIG_DEBUG_THREAD_INFO=y '-DBOARD_ROOT:STRING=c:/testnRF/802154_phy_test;c:/testnRF/radio_test_lan;c:/testnRF/802154_phy_test_v2;c:/testnRF/peripheral_uart;c:/testnRF/peripheral_uart_new' '-Sc:\testnRF\peripheral_uart_new'
    I have tried to change various configurations but it did not work. Would you please suggest me a way to fix this?
    Thank you very much.
    BR,
    Lan
  • Hello Lan,

    Can you try to delete these following two configurations?

    CONFIG_BT_LL_SOFTDEVICE=n

    CONFIG_BT_LL_SW_SPLIT=y

    BR,

    Kazi

  • Hi Kazi,

    I tried with your suggestion, but it does not work. 

    The attachment is my project. If it is possible, would you look at the prj. conf file and project?

    BR,

    Lan

    peripheral_uart_new.zip

Reply Children
Related