This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to port the Zigbee Network Coordinator sample from the nRF52840DK to the nRF52840 dongle

I'm trying to implement the Zigbee coordinator sample on the nRF52840 dongle.  Although I've received a little bit of guidance on how to adapt the nRF52840DK implementation from my local Nordic rep, neither he nor I are enjoying any success.  Surely there must be others that have done this before, no?  Once I get this sample working, I would like to add the CLI shell to the same sample.  Can anyone provide some desperately-needed assistance?  I am building my code using nRF Connect SDK v1.8.0 in VS Code on a Windows 10 machine and have successfully built and tested the very same sample on the DK board without issue.

  • Hi,

    I am looking into your case and I will come back to you tomorrow.

    Best regards,

    Marte

  • Hi,

    To get the network coordinator to work on the Dongle you need to do the following:

    1. Create a board file overlay nrf52840dongle_nrf52840.overlay under network_coordinator/boards with the following:

    /*
     * Copyright (c) 2021 Nordic Semiconductor ASA
     *
     * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
     */
    
    / {
    	chosen {
    		zephyr,entropy = &rng;
    	};
    
    	buttons {
    		compatible = "gpio-keys";
    		rst_button0: rst_button_0 {
    			gpios = <&gpio0 19 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
    			label = "Reset button";
    		};
    	};
    
    	aliases {
    		rst0 = &rst_button0;
    	};
    };
    

    2. Create a static partition manager file to create partitions for MBR and the bootloader on the Dongle. This should be located directly under network_coordinator/. Call it pm_static_nrf52840dongle_nrf52840.yml and add the following:

    EMPTY_0:
      address: 0x0e0000
      end_address: 0x100000
      region: flash_primary
      size: 0x20000
    # SRAM reserved to be used by the nRF5 Bootloader
    EMPTY_1:
      address: 0x20000000
      end_address: 0x20000400
      region: sram_primary
      size: 0x0400
    

    3. The last thing is to add the dongle to the existing sample.yaml file. Simply add nrf52840dongle_nrf52840 to platform_allow and integration_platforms.

    I have also uploaded the sample with dongle support here.

    I would like to add the CLI shell to the same sample

    By this, do you mean the Zigbee shell library or CLI in general? The issue with using the Zigbee shell with the Dongle is that as of now it is only supports using UART and RTT as serial transports, as can be seen in Zigbee shell » Supported backends, and the Dongle only has USB, so you would need to use USB CDC ACM. It might be possible to implement this, but I have not tested it myself. If you want to look into it, you can take a look at the USB overlay extension in the Thread: CLI sample, and the USB CDC ACM Sample Application.

    Best regards,

    Marte

    network_coordinator_dongle.zip

  • Hi, Marte:

    Thank you for all of the great information!  I will be trying your solutions in the next day and will report my results.

    Regarding Zigbee shell vs CLI: What I require is a simple way manipulate the network coordinator on the dongle via the USB connection.  Does this mean that I need the Zigbee shell or just a general CLI?

    Best regards,

    Jody

  • Hi, again:

    To be more specific, what I would like is the equivalent of the old Zigbee CLI Agent example from the legacy nRF5 SDK for Thread and Zigbee v4.1.0 running on a dongle using the nRF Connect SDK v1.8.0.

    Best regards,

    Jody

  • Hi Jody,

    The Zigbee Shell library is in a way the nRF Connect SDK version of Zigbee CLI from nRF5 SDK. The implementation differs, as it is implemented using the Shell interface from Zephyr, but the way it is used is almost the same, with many of the same commands. You can read more about it and see the supported commands in Zigbee shell. So in your case, you would want to use Zigbee Shell.

    Best regards,

    Marte

Related