ZBOSS NCP debugging

Hi,

I am using the ZBOSS NCP production ready firmware from NCS v2.0 and I have some issue with serial communication.

I am able to run my application, and I don't have any issue with my test gateway. Meanwhile, the application is extremely unstable at a customer and requires restart every day almost.
The difference between my test hub and at the customer is that he is using the MicroMatic ZB250 device only (arround 15 devices). And I have 11 devices of different types.

Symptoms are following:
- Runs well for some hours
- NCP stops replying to any request
- NCP continues to send ACK when I send requests from host

Is there a way to see logs from the NCP side in order to debug this issue? I am using the nrf52840 dongle.

BR,
Damien

  • Hello,

    I am trying to play around with prj_usb.conf in NCS NCP sample but I struggle to get the right configuration.
    My Idea is to instantiate a second CDC_ACM instance in the overlay file and connect/get the logs from the CDC_ACM over serial.

    BR,
    Damien

  • Hi,

    Did you not manage to enable logging over a second USB CDC ACM instance in your previous ticket (#289809)?

    Can you post the configuration you are currently using? Are you not seeing any logs?

    Best regards,
    Jørgen

  • Hi,

    I did, but I was using NCS v1.8, and now I moved to v2.0 and I am not able to find the right configuration.
    I tried this config:

    nrf52840dongle_nrf52840.overlay

    / {
    	chosen {
    		zephyr,entropy = &rng;
    		zephyr,console = &cdc_acm_uart1;
    	};
    
    	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;
    	};
    };
    
    &zephyr_udc0 {
        cdc_acm_uart0: cdc_acm_uart0 {
            compatible = "zephyr,cdc-acm-uart";
            label = "CDC_ACM_0";
        };
    
        cdc_acm_uart1: cdc_acm_uart1 {
            compatible = "zephyr,cdc-acm-uart";
            label = "CDC_ACM_1";
        };
    };

    prj_usb.conf

    CONFIG_ZIGBEE_UART_DEVICE_NAME="CDC_ACM_0"
    CONFIG_ZIGBEE_UART_SUPPORTS_FLOW_CONTROL=y
    
    CONFIG_USB_COMPOSITE_DEVICE=y
    
    CONFIG_USB_DEVICE_STACK=y
    CONFIG_USB_DEVICE_REMOTE_WAKEUP=n
    CONFIG_USB_DEVICE_PRODUCT="Zigbee NCP"
    CONFIG_USB_CDC_ACM=y
    CONFIG_UART_LINE_CTRL=y
    
    CONFIG_ZIGBEE=y
    
    CONFIG_ZIGBEE_LIBRARY_NCP_DEV=y
    
    CONFIG_ZIGBEE_HAVE_SERIAL=y
    CONFIG_ZIGBEE_HAVE_ASYNC_SERIAL=y
    CONFIG_ZIGBEE_UART_RX_BUF_LEN=256
    CONFIG_ZIGBEE_UART_TX_TIMEOUT=1000
    CONFIG_ZIGBEE_UART_RX_TIMEOUT=1000
    
    CONFIG_ZIGBEE_USE_LEDS=y
    CONFIG_ZIGBEE_TIME_KTIMER=y
    
    CONFIG_ZIGBEE_ROLE_COORDINATOR=y
    
    CONFIG_HEAP_MEM_POOL_SIZE=2048
    
    CONFIG_MAIN_THREAD_PRIORITY=7
    
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    
    # Networking
    CONFIG_NET_IPV6_MLD=n
    CONFIG_NET_IPV6_NBR_CACHE=n
    CONFIG_NET_IPV6_RA_RDNSS=n
    CONFIG_NET_IP_ADDR_CHECK=n
    CONFIG_NET_UDP=n
    
    CONFIG_LOG=y
    CONFIG_LOG_DEFAULT_LEVEL=3
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    CONFIG_LOG_BACKEND_UART=y
    
    CONFIG_ASSERT=n
    CONFIG_ASSERT_NO_COND_INFO=n
    CONFIG_ASSERT_NO_MSG_INFO=n
    CONFIG_HW_STACK_PROTECTION=y


    This is what I get when I try it out on my system (using dmesg)
    [5359837.126645] usb 1-1.1.3: new full-speed USB device number 47 using dwc_otg
    [5359852.356630] usb 1-1.1.3: device descriptor read/64, error -110
    [5360319.656040] usb 1-1.1.2: new full-speed USB device number 48 using dwc_otg
    [5360334.916008] usb 1-1.1.2: device descriptor read/64, error -110


    BR,
    Damien

  • I can't figure out how to see logs from the NCP side. I would like to see RX and TX data going from NCP to Host, but I don't know how to enable this. I can only enable ZBOSS trace logs, and not even app logs (from app module) nor zboss_osif logs.

  • Did you try the instructions in the Zigbee NCP "Communication through USB" documentation?

    Alternatively, you can configure Zigbee stack logs to be printed in binary format using an independent CDC ACM device of the same nRF USB. Complete the following steps:

    1. Set the following Kconfig options:

    2. Create two instances of USB CDC ACM for the application:

      1. Create two entries in the DTS overlay file for the selected board, one for each USB CDC ACM instance. See USB device stack CDC ACM support for more information.

      2. Extend the zephyr_udc0 node in the DTS overlay file to also configure the second USB CDC ACM instance "CDC_ACM_1":

        &zephyr_udc0 {
           cdc_acm_uart0: cdc_acm_uart0 {
              compatible = "zephyr,cdc-acm-uart";
              label = "CDC_ACM_0";
           };
        
           cdc_acm_uart1: cdc_acm_uart1 {
              compatible = "zephyr,cdc-acm-uart";
              label = "CDC_ACM_1";
           };
        };
        
    3. Enable the composite USB device driver using the CONFIG_USB_COMPOSITE_DEVICE Kconfig option.

    With this configuration, you have two serial ports created by the NCP sample. Use the first one for NCP communication. Use the second serial port for collecting Zigbee stack logs.

Related