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,

    This worked well, and I am able to see ZBOSS traces.
    But I would like to see zephyr logs as well since I don't know if my issue comes from ZBOSS or from the system. So, I tried to enable a third CDC ACM in the dts overlay and referenced it to the zephyr console like this

    chosen {
    		zephyr,entropy = &rng;
    		zephyr,console = &cdc_acm_uart2;
    	};

    Then I configure prj_usb.conf like this:

    # Configure NCP sample to use USB CDC ACM 0 serial for communication with Host
    # and inform application that CDC ACM requires the line control signals to be configured.
    CONFIG_ZIGBEE_UART_DEVICE_NAME="CDC_ACM_0"
    CONFIG_ZIGBEE_UART_SUPPORTS_FLOW_CONTROL=n
    
    # Configure NCP sample to print ZBOSS stack logs in binary format using "UART_1" device
    # CONFIG_ZBOSS_TRACE_BINARY_LOGGING=y
    # CONFIG_ZBOSS_TRACE_LOGGER_DEVICE_NAME="UART_1"
    
    #### Use this configuration to print ZBOSS stack logs in binary format using USB "CDC_ACM_1" device
    CONFIG_ZBOSS_TRACE_BINARY_LOGGING=y
    CONFIG_ZBOSS_TRACE_USB_CDC_LOGGING=y
    CONFIG_ZBOSS_TRACE_LOGGER_DEVICE_NAME="CDC_ACM_1"
    CONFIG_ZIGBEE_ENABLE_TRACES=y
    CONFIG_ZBOSS_TRACE_LOG_LEVEL_DBG=y
    CONFIG_ZBOSS_TRACE_MASK=0x00100001
    
    # Two USB CDC ACM instances configured for this sample: CDC_ACM_0 and CDC_ACM_1
    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
    
    # Those settings below are common with prj.conf
    
    # CONFIG_NCS_SAMPLES_DEFAULTS=y
    CONFIG_LOG=y
    CONFIG_LOG_MODE_DEFERRED=y
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    CONFIG_LOG_DEFAULT_LEVEL=4
    CONFIG_USB_MAX_NUM_TRANSFERS=8
    
    CONFIG_ZIGBEE=y
    
    # Add libncp-dev library
    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
    

    And unfortunately this doesn't work. When enabling CONFIG_UART_CONSOLE, the dongle is not showing correctly in dmesg.

    Output of dmesg when CONFIG_UART_CONSOLE is disabled (application works but no zephyr logs are showing):
    
    [5966393.200551] usb 1-1.1.3: new full-speed USB device number 101 using dwc_otg
    [5966393.345622] usb 1-1.1.3: New USB device found, idVendor=2fe3, idProduct=0100, bcdDevice= 3.00
    [5966393.345644] usb 1-1.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [5966393.345660] usb 1-1.1.3: Product: Zigbee NCP
    [5966393.345675] usb 1-1.1.3: Manufacturer: ZEPHYR
    [5966393.345690] usb 1-1.1.3: SerialNumber: 1E2D14F7A543460F
    [5966393.348321] cdc_acm 1-1.1.3:1.0: ttyACM0: USB ACM device
    [5966393.352672] cdc_acm 1-1.1.3:1.2: ttyACM1: USB ACM device
    [5966393.356679] cdc_acm 1-1.1.3:1.4: ttyACM2: USB ACM device
    [5966393.679857] usb 1-1.1.3: USB disconnect, device number 101
    
    
    Output of dmesg when CONFIG_UART_CONSOLE is enabled:
    
    [5966460.280544] usb 1-1.1.2: new full-speed USB device number 102 using dwc_otg
    [5966475.540510] usb 1-1.1.2: device descriptor read/64, error -110
    [5966490.900496] usb 1-1.1.2: device descriptor read/64, error -110
    [5966491.120488] usb 1-1.1.2: new full-speed USB device number 103 using dwc_otg

    BR,
    Daka

Related