This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF5340 BLE mesh samples don't work properly

I tried to launch your example "Bluetooth: Mesh Light" using nRF5340 PDK and I failed. I followed this guide developer.nordicsemi.com/.../README.html. Also I tried to launch an example "Bluetooth: Mesh" (docs.zephyrproject.org/.../README.html) using nRF5340 PDK and I failed. I wrote out all combinations of samples in a table below which I tried to build and run, but all of them didn't work properly. But when I built the sample "Bluetooth: Mesh Light" for nRF52840 DK, then everything worked properly. The problems occurred only in the case of nRF5340 PDK.

Firmwares for application core in rows and firmwares for network core in columns. Network core had firmware from sample /ncs/zephyr/samples/bluetooth/hci_rpmsg without any modification. Network core had firmware from sample /ncs/zephyr/samples/bluetooth/hci_rpmsg with modification according to note from developer.nordicsemi.com/.../README.html, adding two lines to prj.conf:
CONFIG_BT_CTLR_TX_BUFFER_SIZE=74
CONFIG_BT_CTLR_DATA_LENGTH_MAX=74
Application core had firmware from sample /ncs/nrf/samples/bluetooth/mesh/light without any modification. I followed this instruction developer.nordicsemi.com/.../README.html and after the second step I had such messages for some time:
Connecting...
Discovering services...
And a while it came back to a Scanner page. So I couldn't connect to nRF5340 PDK. It's output into UART:
*** Booting Zephyr OS build v2.3.0-rc1-ncs1  ***
Initializing...
I: No ID address. App must call settings_load()
Bluetooth initialized
Mesh initialized
I saw the following problem in output into UART:
*** Booting Zephyr OS build v2.3.0-rc1-ncs1  ***
Initializing...
W: opcode 0x0c33 status 0x12
Bluetooth init failed (err -5)

Certainly, I couldn't even see a node in nRF Mesh Scanner.
Application core had firmware from sample /ncs/nrf/samples/bluetooth/mesh/light with modification according to note from developer.nordicsemi.com/.../README.html, adding two lines to prj.conf:
CONFIG_BT_CTLR_TX_BUFFER_SIZE=74
CONFIG_BT_CTLR_DATA_LENGTH_MAX=74
I followed this instruction developer.nordicsemi.com/.../README.html and after the second step I had such messages for some time:
Connecting...
Discovering services...
And a while it came back to a Scanner page. So I couldn't connect to nRF5340 PDK. It's output into UART:
*** Booting Zephyr OS build v2.3.0-rc1-ncs1  ***
Initializing...
I: No ID address. App must call settings_load()
Bluetooth initialized
Mesh initialized
I saw the following problem in output into UART:
*** Booting Zephyr OS build v2.3.0-rc1-ncs1  ***
Initializing...
W: opcode 0x0c33 status 0x12
Bluetooth init failed (err -5)

Certainly, I couldn't even see a node in nRF Mesh Scanner.
Application core had firmware from sample /ncs/zephyr/samples/bluetooth/mesh without any modification. I followed this instruction developer.nordicsemi.com/.../README.html and after the second step I had such messages for some time:
Connecting...
Discovering services...
And a while it came back to a Scanner page. So I couldn't connect to nRF5340 PDK. It's output into UART:
[00:00:00.021,728] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)
Bluetooth initialized
Mesh initialized
[00:00:00.021,728] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 2.3 Build 0
[00:00:00.022,460] <inf> bt_hci_core: No ID address. App must call settings_load()
[00:00:00.049,346] <inf> bt_hci_core: Identity: eb:f6:da:7f:da:51 (random)
[00:00:00.049,377] <inf> bt_hci_core: HCI: version 5.2 (0x0b) revision 0x0000, manufacturer 0x05f1
[00:00:00.049,377] <inf> bt_hci_core: LMP: version 5.2 (0x0b) subver 0xffff
[00:00:00.050,872] <dbg> bt_mesh_settings.mesh_commit: sub[0].net_idx 0xffff
[00:00:00.050,994] <inf> bt_mesh_prov: Device UUID: 00000000-0000-0000-0000-0000000~
I saw the following problem in output into UART:
*** Booting Zephyr OS build v2.3.0-rc1-ncs1  ***
Initializing...
[00:00:00.008,270] <inf> fs_nvs: 2 Sectors of 4096 bytes
[00:00:00.008,270] <inf> fs_nvs: alloc wra: 0, ff0
[00:00:00.008,270] <inf> fs_nvs: data wra: 0, 8
[00:00:00.019,317] <wrn> bt_hci_core: opcode 0x0c33 status 0x12
Bluetooth init failed (err -5)

Certainly, I couldn't even see a node in nRF Mesh Scanner.
Application core had firmware from sample /ncs/zephyr/samples/bluetooth/mesh with modification according to an answer from devzone.nordicsemi.com/.../254172, adding two lines to prj.conf:
CONFIG_BT_TINYCRYPT_ECC=y
CONFIG_BT_L2CAP_RX_MTU=69
I followed this instruction developer.nordicsemi.com/.../README.html and after the second step I had such messages for some time:
Connecting...
Discovering services...
And a while it came back to a Scanner page. So I couldn't connect to nRF5340 PDK. It's output into UART:
*** Booting Zephyr OS build v2.3.0-rc1-ncs1  ***
Initializing...
[00:00:00.008,270] <inf> fs_nvs: 2 Sectors of 4096 bytes
[00:00:00.008,270] <inf> fs_nvs: alloc wra: 0, fd0
[00:00:00.008,270] <inf> fs_nvs: data wra: 0, 2c
[00:00:00.021,484] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
Bluetooth initialized
Mesh initialized
[00:00:00.021,484] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)
[00:00:00.021,514] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 2.3 Build 0
[00:00:00.022,216] <inf> bt_hci_core: No ID address. App must call settings_load()
[00:00:00.042,907] <inf> bt_hci_core: Identity: eb:f6:da:7f:da:51 (random)
[00:00:00.042,907] <inf> bt_hci_core: HCI: version 5.2 (0x0b) revision 0x0000, manufacturer 0x05f1
[00:00:00.042,907] <inf> bt_hci_core: LMP: version 5.2 (0x0b) subver 0xffff
[00:00:00.044,403] <dbg> bt_mesh_settings.mesh_commit: sub[0].net_idx 0xffff
[00:00:00.044,494] <inf> bt_mesh_prov: Device UUID: 00000000-0000-0000-0000-0000000~
I saw the following problem in output into UART:
*** Booting Zephyr OS build v2.3.0-rc1-ncs1  ***
Initializing...
[00:00:00.008,270] <inf> fs_nvs: 2 Sectors of 4096 bytes
[00:00:00.008,270] <inf> fs_nvs: alloc wra: 0, ff0
[00:00:00.008,270] <inf> fs_nvs: data wra: 0, 8
[00:00:00.019,317] <wrn> bt_hci_core: opcode 0x0c33 status 0x12
Bluetooth init failed (err -5)

Certainly, I couldn't even see a node in nRF Mesh Scanner.
Application core had firmware from sample /ncs/zephyr/samples/bluetooth/mesh with modification according to note from developer.nordicsemi.com/.../README.html, adding two lines to prj.conf:
CONFIG_BT_CTLR_TX_BUFFER_SIZE=74
CONFIG_BT_CTLR_DATA_LENGTH_MAX=74
I followed this instruction developer.nordicsemi.com/.../README.html and after the second step I had such messages for some time:
Connecting...
Discovering services...
And a while it came back to a Scanner page. So I couldn't connect to nRF5340 PDK. It's output into UART:
*** Booting Zephyr OS build v2.3.0-rc1-ncs1  ***
Initializing...
[00:00:00.008,239] <inf> fs_nvs: 2 Sectors of 4096 bytes
[00:00:00.008,270] <inf> fs_nvs: alloc wra: 0, f90
[00:00:00.008,270] <inf> fs_nvs: data wra: 0, f4
[00:00:00.021,820] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
Bluetooth initialized
Mesh initialized
[00:00:00.021,820] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)
[00:00:00.021,820] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 2.3 Build 0
[00:00:00.022,552] <inf> bt_hci_core: No ID address. App must call settings_load()
[00:00:00.038,055] <inf> bt_hci_core: Identity: eb:f6:da:7f:da:51 (random)
[00:00:00.038,085] <inf> bt_hci_core: HCI: version 5.2 (0x0b) revision 0x0000, manufacturer 0x05f1
[00:00:00.038,085] <inf> bt_hci_core: LMP: version 5.2 (0x0b) subver 0xffff
[00:00:00.039,581] <dbg> bt_mesh_settings.mesh_commit: sub[0].net_idx 0xffff
[00:00:00.039,703] <inf> bt_mesh_prov: Device UUID: 00000000-0000-0000-0000-0000000~

I saw the following problem in output into UART:

*** Booting Zephyr OS build v2.3.0-rc1-ncs1  ***
Initializing...
[00:00:00.008,270] <inf> fs_nvs: 2 Sectors of 4096 bytes
[00:00:00.008,270] <inf> fs_nvs: alloc wra: 0, ff0
[00:00:00.008,270] <inf> fs_nvs: data wra: 0, 0
[00:00:00.019,470] <wrn> bt_hci_core: opcode 0x0c33 status 0x12
Bluetooth init failed (err -5)

Certainly, I couldn't even see a node in nRF Mesh Scanner.

I used nRF Connect v3.4.1 Programmer to firmware a network core.

Explain to me, please, how to launch any sample of BLE mesh for nRF5340 PDK? Does the working sample exist at least?

  • Hi Roman, 

    We are working on your case and will reply later. 

    Please note that we are moving into the summer vacation period here in Norway, so it might take a bit longer to get to the bottom of this than expected, as staff during the month of July will be reduced. I'm sorry about the inconvenience, but please be patient. And I'll get back to you as soon as I hear something from the devs.

    -Amanda H.

  • Hi Roman, 

    Please add the following code

        NRF_P0->PIN_CNF[0] = GPIO_PIN_CNF_MCUSEL_Peripheral << GPIO_PIN_CNF_MCUSEL_Pos;
        NRF_P0->PIN_CNF[1] = GPIO_PIN_CNF_MCUSEL_Peripheral << GPIO_PIN_CNF_MCUSEL_Pos;

    in to ncs\v1.3.0\zephyr\boards\arm\nrf5340pdk_nrf5340\nrf5340_cpunet_reset.c as 

    /*
     * Copyright (c) 2019 Nordic Semiconductor ASA.
     *
     * SPDX-License-Identifier: Apache-2.0
     */
    
    #include <zephyr.h>
    #include <init.h>
    #include <logging/log.h>
    
    #include <soc.h>
    
    LOG_MODULE_REGISTER(nrf5340pdk_nrf5340_cpuapp, CONFIG_LOG_DEFAULT_LEVEL);
    
    /* Shared memory definitions */
    #if DT_HAS_CHOSEN(zephyr_ipc_shm)
    #define SHM_NODE            DT_CHOSEN(zephyr_ipc_shm)
    #define SHM_BASE_ADDRESS    DT_REG_ADDR(SHM_NODE)
    #define SHM_SIZE            DT_REG_SIZE(SHM_NODE)
    #endif
    
    #if !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE)
    
    /* This should come from DTS, possibly an overlay. */
    #define CPUNET_UARTE_PIN_TX  25
    #define CPUNET_UARTE_PIN_RX  26
    #define CPUNET_UARTE_PIN_RTS 10
    #define CPUNET_UARTE_PIN_CTS 12
    
    static void remoteproc_mgr_config(void)
    {
    	/* UARTE */
    	/* Assign specific GPIOs that will be used to get UARTE from
    	 * nRF5340 Network MCU.
    	 */
    	NRF_P0->PIN_CNF[CPUNET_UARTE_PIN_TX] =
    	GPIO_PIN_CNF_MCUSEL_NetworkMCU << GPIO_PIN_CNF_MCUSEL_Pos;
    	NRF_P0->PIN_CNF[CPUNET_UARTE_PIN_RX] =
    	GPIO_PIN_CNF_MCUSEL_NetworkMCU << GPIO_PIN_CNF_MCUSEL_Pos;
    	NRF_P0->PIN_CNF[CPUNET_UARTE_PIN_RTS] =
    	GPIO_PIN_CNF_MCUSEL_NetworkMCU << GPIO_PIN_CNF_MCUSEL_Pos;
    	NRF_P0->PIN_CNF[CPUNET_UARTE_PIN_CTS] =
    	GPIO_PIN_CNF_MCUSEL_NetworkMCU << GPIO_PIN_CNF_MCUSEL_Pos;
    	
        NRF_P0->PIN_CNF[0] =
        GPIO_PIN_CNF_MCUSEL_Peripheral << GPIO_PIN_CNF_MCUSEL_Pos;
        NRF_P0->PIN_CNF[1] =
        GPIO_PIN_CNF_MCUSEL_Peripheral << GPIO_PIN_CNF_MCUSEL_Pos;
    
    	/* 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 */
    
    static int remoteproc_mgr_boot(struct device *dev)
    {
    	ARG_UNUSED(dev);
    
    #if !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE)
    	/* Secure domain may configure permissions for the Network MCU. */
    	remoteproc_mgr_config();
    #endif /* !CONFIG_TRUSTED_EXECUTION_NONSECURE */
    
    #if defined(SHM_BASE_ADDRESS) && (SHM_BASE_ADDRESS != 0)
    
    	/* Initialize inter-processor shared memory block to zero. It is
    	 * assumed that the application image has access to the shared
    	 * memory at this point (see #24147).
    	 */
    	memset((void *) SHM_BASE_ADDRESS, 0, SHM_SIZE);
    #endif
    
    	/* Release the Network MCU, 'Release force off signal' */
    	NRF_RESET->NETWORK.FORCEOFF = RESET_NETWORK_FORCEOFF_FORCEOFF_Release;
    
    	LOG_DBG("Network MCU released.");
    
    	return 0;
    }
    
    SYS_INIT(remoteproc_mgr_boot, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
    

    The following is my process:

    nrfjprog -f NRF53 --coprocessor CP_NETWORK -–eraseall
    nrfjprog -f NRF53 --coprocessor CP_APPLICATION -–eraseall
    cd C:\ncs\v1.3.0\zephyr\samples\bluetooth\hci_rpmsg
    rm -r build
    west build -b nrf5340pdk_nrf5340_cpunet --cmake-only
    cd build
    ninja menuconfig
    
    **Press "/" to search "CLOCK_CONTROL_NRF_K32SRC_RC", and select and enable the second CLOCK_CONTROL_NRF_K32SRC_RC
    **Press "/" again to check all "CLOCK_CONTROL_NRF_K32SRC_RC" are enabled, save and exit    
    west flash --erase
    
    
    cd C:\ncs\v1.3.0\nrf\samples\bluetooth\mesh\light
    rm -r build
    
    west build -b nrf5340pdk_nrf5340_cpuapp
    ninja -C build/hci_rpmsg menuconfig
    **Set CONFIG_BT_CTLR_TX_BUFFER_SIZE=74 (Press "/" to search "BT_CTLR_TX_BUFFER_SIZE") and CONFIG_BT_CTLR_DATA_LENGTH_MAX=74 (Press "/" to search "BT_CTLR_DATA_LENGTH_MAX"), save and exit
    west flash --erase

    -Amanda H.

  • Many thanks for your answer!

    I followed your instruction and I managed to run a BLE mesh example on nRF5340 PDK. It was launched and I was able to connect to the node. Also, I provisioned and united nRF5340 PDK and nRF52840 DK in a single network using your nRF Mesh mobile app. I created groups there and added models of Generic On Off Servers from both boards. And when I connected to one board and changed states of groups then I faced a problem. There's a difference when I was connected to nRF52840 DK and nRF5340 PDK. In the case of connection to nRF52840 DK, I changed the state of a group and they changed for both boards. LEDs from both boards belonging to the single group turned on and turned off. But when I connected to nRF5340 PDK and did the same actions in groups, turning on and off LEDs, then only LEDs on nRF5340 PDK really changed, but LEDs on nRF52840 DK didn't change their states. It seems that nRF5340 PDK didn't retransmit packets or did it wrongly, or nRF52840 DK didn't recognize these retransmitted packets from nRF5340 PDK. Tell me, please, do you have the same problem, when you connect both nRF5340 PDK and nRF52840 DK in the single mesh network and you connect to nRF5340 PDK from nRF mesh mobile app and manage states of models from both boards in a group? In my case, LEDs on nRF52840 DK don't change their states, if I connect to nRF5340 PDK. But everything works if I connect and manage vice versa.

    In addition, I also want to realize potential problems of connecting various devices to a single BLE mesh network, especially from various vendors. As I noticed, there's probably compatibility issue even between nRF5340 PDK and nRF52840 DK. Now I don't know for sure whether it's a compatibility problem or I did something wrongly, but I want to understand whether such a problem exists potentially or not.

  • I forgot to mention that I had warnings and errors in UART logs, but after it worked anyway.

    *** Booting Zephyr OS build v2.3.0-rc1-ncs1  ***
    Initializing...
    I: No ID address. App must call settings_load()
    Bluetooth initialized
    Mesh initialized
    W: Data for unexpected connection
    E: Not connected
    E: ***** MPU FAULT *****
    E:   Instruction Access Violation
    E: r0/a1:  0x0001e8b4  r1/a2:  0x00000000  r2/a3:  0x20001454
    E: r3/a4:  0x20004ee0 r12/ip:  0x00000001 r14/lr:  0x00012179
    E:  xpsr:  0x60000000
    E: Faulting instruction address (r15/pc): 0x20004ee0
    E: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
    E: Current thread: 0x20001454 (unknown)
    E: Resetting system
    *** Booting Zephyr OS build v2.3.0-rc1-ncs1  ***
    Initializing...
    I: No ID address. App must call settings_load()
    Bluetooth initialized
    Mesh initialized
    W: Data for unexpected connection
    W: Data for unexpected connection

    *** Booting Zephyr OS build v2.3.0-rc1-ncs1  ***
    Initializing...
    I: No ID address. App must call settings_load()
    Bluetooth initialized
    Mesh initialized
    E: ***** MPU FAULT *****
    E:   Instruction Access Violation
    E: r0/a1:  0x0001e8b4  r1/a2:  0x00000000  r2/a3:  0x20001454
    E: r3/a4:  0x20004ee0 r12/ip:  0x00000001 r14/lr:  0x00012179
    E:  xpsr:  0x60000000
    E: Faulting instruction address (r15/pc): 0x20004ee0
    E: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
    E: Current thread: 0x20001454 (unknown)
    E: Resetting system
    *** Booting Zephyr OS build v2.3.0-rc1-ncs1  ***
    Initializing...
    I: No ID address. App must call settings_load()
    Bluetooth initialized
    Mesh initialized
    I: Primary Element: 0x0006
    W: No matching TX context for ack
    W: No matching TX context for ack

  • Hi Romand, 

    I'm testing the example and can reproduce the issue. I have reported to the developer, and he needs time to investigate this. 

    -Amanda H.

Related