Unable to get Matter sample running on the Adafruit Feather nRF52840 Express

Hello.

I've recently been trying to get my Matter application to run on an Adafruit Feather nRF52840 Express. I'm having trouble getting the application to fully run as it seems to get part way through the initialization stage and then completely stops. These are the logs I'ms seeing:

I: Init CHIP stack
I: 217 [DL]BLE address: D6:54:7C:C3:98:7E
I: 224 [DL]OpenThread started: OK
I: 224 [DL]Setting OpenThread device type to MINIMAL END DEVICE
I: 224 [SVR]Subscription persistence not supported
I: 224 [SVR]Server initializing...
I: 225 [TS]Last Known Good Time: 2023-08-16T11:10:45
I: 226 [DMG]AccessControl: initializing
I: 226 [DMG]Examples::AccessControlDelegate::Init
I: 226 [DMG]AccessControl: setting
I: 226 [DMG]DefaultAclStorage: initializing
I: 227 [DMG]DefaultAclStorage: 0 entries loaded
D: 227 [IN]UDP::Init bind&listen port=5540
E: 227 [IN]SO_REUSEPORT failed: 109
D: 228 [IN]UDP::Init bound to port=5540
D: 228 [IN]BLEBase::Init - setting/overriding transport
D: 228 [IN]TransportMgr initialized
D: 231 [DL]Using Thread extended MAC for hostname.
I: 233 [ZCL]Using ZAP configuration...
I: 235 [DMG]AccessControlCluster: initializing
D: 235 [DL]Boot reason: 1
I: 236 [ZCL]Initiating Admin Commissioning cluster.
D: 237 [IN]SecureSession[0x20002b50I: 30255 [DL]CHIPoBLE advertising mode changed to slow
I: 30257 [DL]CHIPoBLE advertising started

My same code running on the nRF52840DK outputs this:

uart*** Booting Zephyr OS build v3.3.99-ncs1-1 ***
:~$ I: Init CHIP stack
I: 216 [DL]BLE address: E9:F0:21:1F:69:D9
I: 226 [DL]OpenThread started: OK
I: 229 [DL]Setting OpenThread device type to MINIMAL END DEVICE
I: 235 [SVR]Subscription persistence not supported
I: 240 [SVR]Server initializing...
I: 243 [TS]Last Known Good Time: 2023-08-16T11:06:30
I: 248 [DMG]AccessControl: initializing
I: 252 [DMG]Examples::AccessControlDelegate::Init
I: 256 [DMG]AccessControl: setting
I: 260 [DMG]DefaultAclStorage: initializing
I: 264 [DMG]DefaultAclStorage: 0 entries loaded
D: 268 [IN]UDP::Init bind&listen port=5540
E: 272 [IN]SO_REUSEPORT failed: 109
D: 275 [IN]UDP::Init bound to port=5540
D: 279 [IN]BLEBase::Init - setting/overriding transport
D: 284 [IN]TransportMgr initialized
D: 290 [DL]Using Thread extended MAC for hostname.
I: 296 [ZCL]Using ZAP configuration...
I: 301 [DMG]AccessControlCluster: initializing
D: 306 [DL]Boot reason: 1
I: 308 [ZCL]Initiating Admin Commissioning cluster.
D: 314 [IN]SecureSession[0x20003388]: Allocated Type:1 LSID:8331
D: 320 [DL]CHIPoBLE advertising set to on
I: 324 [DIS]Updating services using commissioning mode 1
E: 329 [DIS]Failed to remove advertised services: 3
D: 334 [DL]Using Thread extended MAC for hostname.
I: 339 [DIS]Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1
E: 347 [DIS]Failed to advertise commissionable node: 3
E: 352 [DIS]Failed to finalize service update: 3
I: 357 [DIS]Updating services using commissioning mode 1
E: 362 [DIS]Failed to remove advertised services: 3
D: 367 [DL]Using Thread extended MAC for hostname.
I: 371 [DIS]Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1
E: 380 [DIS]Failed to advertise commissionable node: 3
E: 385 [DIS]Failed to finalize service update: 3
I: 390 [DIS]Delaying proxy of operational discovery: missing delegate
I: 396 [IN]CASE Server enabling CASE session setups
D: 401 [IN]SecureSession[0x20003440]: Allocated Type:2 LSID:8332
I: 407 [SVR]Joining Multicast groups
I: 410 [SVR]Server Listening...
I: 413 [DL]Device Configuration:
I: 416 [DL]  Serial Number: 11223344556677889900
I: 421 [DL]  Vendor Id: 65521 (0xFFF1)
I: 424 [DL]  Product Id: 32768 (0x8000)
I: 428 [DL]  Product Name: not-specified
I: 432 [DL]  Hardware Version: 0
I: 435 [DL]  Setup Pin Code (0 for UNKNOWN/ERROR): 20202021
I: 441 [DL]  Setup Discriminator (0xFFFF for UNKNOWN/ERROR): 3840 (0xF00)
I: 447 [DL]  Manufacturing Date: (not set)
I: 451 [DL]  Device Type: 65535 (0xFFFF)
I: 455 [SVR]SetupQRCode: [MT:Y.K9042C00KA0648G00]
I: 460 [SVR]Copy/paste the below URL in a browser to see the QR Code:
I: 466 [SVR]https://project-chip.github.io/connectedhomeip/qrcode.html?data=MT%3AY.K9042C00KA0648G00
I: 475 [SVR]Manual pairing code: [34970112332]
I: End init CHIP stack
I: [gpio_pin_configure_dt] completed with error code: 0
I: [gpio_pin_interrupt_configure_dt] completed with error code: 0
I: [gpio_init_callback] completed with error code: 0
I: Initialize temp sensor
I: 501 [DL]CHIP task running
I: 505 [DL]CHIPoBLE advertising started

Everything under "End init CHIP stack" is my application specific code making use of an i2c temperature sensor.

I experience similar results when using an unmodified sample. When using the Matter Lock sample I get the expected logs on my nRF52840DK, and I see this when flashing to the Adafruit Feather:

I: Init CHIP stack
I: 220 [DL]BLE address: C6:07:EF:5A:FD:7F
I: 224 [DL]OpenThread SED interval is 1000ms
I: 227 [DL]OpenThread started: OK
I: 227 [DL]Setting OpenThread device type to SLEEPY END DEVICE
I: 227 [SVR]Subscription persistence not supported
I: 228 [SVR]Server initializing...
I: 228 [TS]Last Known Good Time: 2023-08-21T13:25:16
I: 229 [DMG]AccessControl: initializing
I: 229 [DMG]Examples::AccessControlDelegate::Init
I: 230 [DMG]AccessControl: setting
I: 230 [DMG]DefaultAclStorage: initializing
I: 230 [DMG]DefaultAclStorage: 0 entries loaded
D: 230 [IN]UDP::Init bind&listen port=5540
E: 231 [IN]SO_REUSEPORT failed: 109
D: 231 [IN]UDP::Init bound to port=5540
D: 231 [IN]BLEBase::Init - setting/overriding transport
D: 232 [IN]TransportMgr initialized
D: 235 [DL]Using Thread extended MAC for hostname.
I: 237 [ZCL]Using ZAP configuration...
I: 239 [DMG]AccessControlCluster: initializing
D: 239 [DL]Boot reason: 1
I: 239 [ZCL]Initiating Admin Commissioning 

I'm using my DK as the programmer for the Feather, and I have RTT for logging on the feather instead of UART. I also disabled OTA capabilities on the Feather since it doesn't have an onboard flash. If I had to guess, I'd imagine it's a configuration issue, but I'm not sure where to go with my debugging.

Thanks for any suggestions.

Parents
  • Hi,

    I also disabled OTA capabilities on the Feather since it doesn't have an onboard flash.

    Did you do this by selecting prj_no_dfu.conf as configuration file, or did you do it in some other way?

    Does the Adafruit Feather nRF52840 Express have an external 32 KHz xtal? If not, please try adding the following to the project configuration:

    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y

    Can you test if you are able to run OpenThread and Bluetooth LE samples on the Feather?

    Best regards,
    Marte

  • For my custom application I created a modified build configuration:

    CONFIG_CHIP=y
    CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y
    CONFIG_CHIP_PROJECT_CONFIG="src/chip_project_config.h"
    # 32768 == 0x8000 (example Product ID added temporaly,
    # but it must be changed with proper PID from the list:
    # https://github.com/project-chip/connectedhomeip/blob/482e6fd03196a6de45465a90003947ef4b86e0b1/docs/examples/discussion/PID_allocation_for_example_apps.md)
    CONFIG_CHIP_DEVICE_PRODUCT_ID=32768
    CONFIG_STD_CPP14=y
    
    # Add support for LEDs and buttons on Nordic development kits
    CONFIG_DK_LIBRARY=y
    
    # Bluetooth Low Energy configuration
    CONFIG_BT_DEVICE_NAME="MatterTemplate"
    
    # Other settings
    CONFIG_THREAD_NAME=y
    CONFIG_MPU_STACK_GUARD=y
    CONFIG_RESET_ON_FATAL_ERROR=n
    CONFIG_CHIP_LIB_SHELL=y
    
    # Disable NFC commissioning
    CONFIG_CHIP_NFC_COMMISSIONING=n
    
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_RTT_CONSOLE=y
    CONFIG_UART_CONSOLE=n
    # Disable Matter OTA DFU
    CONFIG_CHIP_OTA_REQUESTOR=n
    
    CONFIG_I2C=y
    
    # Disable Matter OTA DFU
    CONFIG_CHIP_OTA_REQUESTOR=n
    

    However, when I was running the matter lock sample, I was using the pro_no_dfu.conf as my configuration file.

    I believe it has an external 32 KHz crystal.

    Is there a specific open thread or bluetooth sample you'd like me to try running? I wasn't able to get zephyr/samples/net/openthread/coprocessor, nrf/samples/openthread/coprocessor failed because they couldn't find the device definition:

          |                                 ^~~~~~~
    /Users/christopherboyer/workspace/babel/ble/zephyr/include/zephyr/device.h:210:37: note: in expansion of macro 'DEVICE_NAME_GET'
      210 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
          |                                     ^~~~~~~~~~~~~~~
    /Users/christopherboyer/workspace/babel/ble/zephyr/include/zephyr/device.h:227:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
      227 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
          |                                  ^~~~~~~~~~~~~~~~~~
    /Users/christopherboyer/workspace/babel/ble/zephyr/modules/openthread/platform/uart.c:160:23: note: in expansion of macro 'DEVICE_DT_GET'
      160 |         ot_uart.dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_ot_uart));

    I tried adding a adafruit_feather_nrf52840.overlay to the boards folder without luck. nrf/samples/openthread/cli did build and I was able to flash it to the device. I had to modify the the prj.conf to use RTT instead of UART, which leaves this as the final file:

    #
    # Copyright (c) 2020 Nordic Semiconductor
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    
    # Network shell
    CONFIG_SHELL=y
    CONFIG_OPENTHREAD_SHELL=y
    CONFIG_SHELL_ARGC_MAX=26
    CONFIG_SHELL_CMD_BUFF_SIZE=416
    
    # Enable OpenThread features set
    CONFIG_OPENTHREAD_NORDIC_LIBRARY_MASTER=y
    
    CONFIG_NET_L2_OPENTHREAD=y
    
    # Generic networking options
    CONFIG_NETWORKING=y
    
    CONFIG_MBEDTLS_SHA1_C=n
    CONFIG_FPU=y
    
    CONFIG_GPIO_SHELL=y
    
    
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_RTT_CONSOLE=y
    CONFIG_UART_CONSOLE=n

    In the RTT logs though, all I see is this, so I'm skeptical as to whether it's doing anything:

    SEGGER J-Link V7.92 - Real time terminal output
    SEGGER J-Link (unknown) V1.0, SN=1050270323
    Process: JLinkExe
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***

Reply
  • For my custom application I created a modified build configuration:

    CONFIG_CHIP=y
    CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y
    CONFIG_CHIP_PROJECT_CONFIG="src/chip_project_config.h"
    # 32768 == 0x8000 (example Product ID added temporaly,
    # but it must be changed with proper PID from the list:
    # https://github.com/project-chip/connectedhomeip/blob/482e6fd03196a6de45465a90003947ef4b86e0b1/docs/examples/discussion/PID_allocation_for_example_apps.md)
    CONFIG_CHIP_DEVICE_PRODUCT_ID=32768
    CONFIG_STD_CPP14=y
    
    # Add support for LEDs and buttons on Nordic development kits
    CONFIG_DK_LIBRARY=y
    
    # Bluetooth Low Energy configuration
    CONFIG_BT_DEVICE_NAME="MatterTemplate"
    
    # Other settings
    CONFIG_THREAD_NAME=y
    CONFIG_MPU_STACK_GUARD=y
    CONFIG_RESET_ON_FATAL_ERROR=n
    CONFIG_CHIP_LIB_SHELL=y
    
    # Disable NFC commissioning
    CONFIG_CHIP_NFC_COMMISSIONING=n
    
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_RTT_CONSOLE=y
    CONFIG_UART_CONSOLE=n
    # Disable Matter OTA DFU
    CONFIG_CHIP_OTA_REQUESTOR=n
    
    CONFIG_I2C=y
    
    # Disable Matter OTA DFU
    CONFIG_CHIP_OTA_REQUESTOR=n
    

    However, when I was running the matter lock sample, I was using the pro_no_dfu.conf as my configuration file.

    I believe it has an external 32 KHz crystal.

    Is there a specific open thread or bluetooth sample you'd like me to try running? I wasn't able to get zephyr/samples/net/openthread/coprocessor, nrf/samples/openthread/coprocessor failed because they couldn't find the device definition:

          |                                 ^~~~~~~
    /Users/christopherboyer/workspace/babel/ble/zephyr/include/zephyr/device.h:210:37: note: in expansion of macro 'DEVICE_NAME_GET'
      210 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
          |                                     ^~~~~~~~~~~~~~~
    /Users/christopherboyer/workspace/babel/ble/zephyr/include/zephyr/device.h:227:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
      227 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
          |                                  ^~~~~~~~~~~~~~~~~~
    /Users/christopherboyer/workspace/babel/ble/zephyr/modules/openthread/platform/uart.c:160:23: note: in expansion of macro 'DEVICE_DT_GET'
      160 |         ot_uart.dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_ot_uart));

    I tried adding a adafruit_feather_nrf52840.overlay to the boards folder without luck. nrf/samples/openthread/cli did build and I was able to flash it to the device. I had to modify the the prj.conf to use RTT instead of UART, which leaves this as the final file:

    #
    # Copyright (c) 2020 Nordic Semiconductor
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    
    # Network shell
    CONFIG_SHELL=y
    CONFIG_OPENTHREAD_SHELL=y
    CONFIG_SHELL_ARGC_MAX=26
    CONFIG_SHELL_CMD_BUFF_SIZE=416
    
    # Enable OpenThread features set
    CONFIG_OPENTHREAD_NORDIC_LIBRARY_MASTER=y
    
    CONFIG_NET_L2_OPENTHREAD=y
    
    # Generic networking options
    CONFIG_NETWORKING=y
    
    CONFIG_MBEDTLS_SHA1_C=n
    CONFIG_FPU=y
    
    CONFIG_GPIO_SHELL=y
    
    
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_RTT_CONSOLE=y
    CONFIG_UART_CONSOLE=n

    In the RTT logs though, all I see is this, so I'm skeptical as to whether it's doing anything:

    SEGGER J-Link V7.92 - Real time terminal output
    SEGGER J-Link (unknown) V1.0, SN=1050270323
    Process: JLinkExe
    *** Booting Zephyr OS build v3.3.99-ncs1-1 ***

Children
No Data
Related