Zigbee Stack interference with TWIM

During development, I am seeing a strange behavior when enabling zigbee. 

When the application's PRJ file does not enable zigbee, I2C functions as expected. The peripherals can be read and responses are received (as shown in the attached picture) 

Without the zigbee/networking processor active, this is what things look like in yellow below:
1. Raising edge I2C transaction started
2. Falling edge I2C transaction completed
The purple  line indicates edges (falling and raising) are a trigger to start an I2C transaction
PRJ.conf (zigbee not enabled)
CONFIG_FPU=y
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_EVENTS=y
CONFIG_I2C=y
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_AUDIO=y
CONFIG_CMSIS_DSP=y
CONFIG_CMSIS_DSP_TRANSFORM=y
CONFIG_AUDIO_DMIC=y
CONFIG_NRFX_TIMER1=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_JESD216_API=y
CONFIG_SPI=n
CONFIG_SPI_NOR=n
CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_LITTLEFS=y
#CONFIG_APP_WIPE_STORAGE=y
CONFIG_APP_LITTLEFS_STORAGE_FLASH=y
# CONFIG_LOG=y
# CONFIG_LOG_BACKEND_UART=n
# CONFIG_LOG_MODE_MINIMAL=y
# CONFIG_LOG_DEFAULT_LEVEL=0
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_REBOOT=y

When Zigbee configurations are enabled (w/o even initializing Zboss) All comms on i2c3 time out.

CONFIG_FPU=y
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_EVENTS=y
CONFIG_I2C=y
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_AUDIO=y
CONFIG_AUDIO_DMIC=y

CONFIG_HEAP_MEM_POOL_SIZE=32768

CONFIG_ZIGBEE=y
CONFIG_ZIGBEE_APP_UTILS=y
CONFIG_ZIGBEE_ROLE_END_DEVICE=y
# Enable DK LED and Buttons library
CONFIG_DK_LIBRARY=y

# This example requires more workqueue stack
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
# Enable API for powering down unused RAM parts
CONFIG_RAM_POWER_DOWN_LIBRARY=y

# 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=1
CONFIG_IEEE802154_DRIVER_LOG_LEVEL_INF=y

CONFIG_NRF53_SYNC_RTC=n

CONFIG_ASSERT=y
CONFIG_SPIN_VALIDATE=y
CONFIG_LOG_MODE_MINIMAL=n

CONFIG_MAIN_STACK_SIZE=2048

# Use software cryptography on nRF5340
CONFIG_ZIGBEE_USE_SOFTWARE_AES=y

# Networking
CONFIG_MPSL=n


CONFIG_NUM_COOP_PRIORITIES=20
CONFIG_NUM_PREEMPT_PRIORITIES=30
CONFIG_CMSIS_DSP=y
CONFIG_CMSIS_DSP_TRANSFORM=y
CONFIG_AUDIO_DMIC=y
CONFIG_NRFX_TIMER1=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_JESD216_API=y
CONFIG_SPI=n
CONFIG_SPI_NOR=n
CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_LITTLEFS=y
#CONFIG_APP_WIPE_STORAGE=y
CONFIG_APP_LITTLEFS_STORAGE_FLASH=y
# CONFIG_LOG=y
# CONFIG_LOG_BACKEND_UART=n
# CONFIG_LOG_MODE_MINIMAL=y
# CONFIG_LOG_DEFAULT_LEVEL=0
CONFIG_REBOOT=y

Is there a known interaction between zigbee and I2C that prevents all I2C peripherals from bein used?

Parents
  • Hello again,

    What pins and I2C instance are you using?

    Regards,

    Elfving

  • &i2c3 {
        compatible = "nordic,nrf-twim";
        status = "okay";
        pinctrl-0 = <&custom_i2c3_default>;
        pinctrl-1 = <&custom_i2c3_sleep>;
        pinctrl-names = "default", "sleep";
    };
    
    .......
    
        custom_i2c3_default: custom_i2c3_default {
            group1 {
                psels = <NRF_PSEL(TWIM_SDA, 0, 10)>,
                    <NRF_PSEL(TWIM_SCL, 0, 9)>;
            };
        };
        
            custom_i2c3_sleep: custom_i2c3_sleep {
            group1 {
                psels = <NRF_PSEL(TWIM_SDA, 0, 10)>,
                    <NRF_PSEL(TWIM_SCL, 0, 9)>;
                low-power-enable;
            };
        };

       On the 5340 the mapped pins are P0.10 and P0.09

    on my app.overlay

  • This issue is now becoming blocking for us. Has Nordic been able to replicate this issue locally?

  • No, not yet unfortunately.

    Could you send me a minimal example that reproduces it on your side?

    Could you try changing pins or i2c instance and see if that changes anything?

    I also see that the set of configurations you add when enabling Zigbee is rather large, and doesn't seem to just include the Zigbee related configs. Do you also run into the same issue with these configurations not added?

    CONFIG_AUDIO_DMIC=y
    CONFIG_HEAP_MEM_POOL_SIZE=32768
    # Enable DK LED and Buttons library
    CONFIG_DK_LIBRARY=y
    # This example requires more workqueue stack
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    # Enable API for powering down unused RAM parts
    CONFIG_RAM_POWER_DOWN_LIBRARY=y
    # 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=1
    CONFIG_IEEE802154_DRIVER_LOG_LEVEL_INF=y
    CONFIG_NRF53_SYNC_RTC=n
    CONFIG_ASSERT=y
    CONFIG_SPIN_VALIDATE=y
    CONFIG_LOG_MODE_MINIMAL=n
    CONFIG_MAIN_STACK_SIZE=2048
    # Networking
    CONFIG_MPSL=n
    CONFIG_NUM_COOP_PRIORITIES=20
    CONFIG_NUM_PREEMPT_PRIORITIES=30

    Regards,

    Elfving

  •   

    >I also see that the set of configurations you add when enabling Zigbee is rather large, and doesn't just include the Zigbee related configs. Do you also run into the same issue with these configurations not added?

    I am using the light switch example settings . Does Nordic have a zigbee configuration for the light switch example that doesn't need to enable all those settings?

    Is there a better example to use for a light-switch functionality? I am new to the NRF zigbee implementation and as such I am not sure what settings are necessary. What settings are needed for a minimum light switch example?

    Thanks in advance

  • No if you got them from the sample they should probably be fine. Its just nice to rule out the other configurations to make sure that its Zigbee that is the culprit, and not eg. CONFIG_AUDIO_DMIC.

    Regards,

    Elfving

  •   I can confirm that the differences in PRJ.conf files can be reduced to the attached picture

    I can also confirm that two binaries, one built prior to the inclusion of the pictured menuconfig options shows I2C3 working correctly. The other one with the options pictured below behaves in the way described initially with this support request (I2C3 timeout? errors)

Reply Children
  • I see.

    What NCS version are you using btw?

    And could you again try changing the i2c instance and see if you still face the same issue? And could you provide a minimal example that would reproduce this on a DK?

    Regards,

    Elfving

  • > could you again try changing the i2c instance and see if you still face the same issue? 

    I don't follow this request. All of the I2C instances are being used by other I2C peripherals and therefore I'd effectively be moving the problem from one peripheral to the other. Am I misunderstanding your request?

    >And could you provide a minimal example that would reproduce this on a DK?

    I don't currently have a a project/example that can run on the dev-kit. I can try to slim down the project and create a configuration that runs on a dev-kit.

    However I'd like to repeat that I can see this issue disappear by simply removing the kconfig settings related to the zigbee stack which leads me to believe it's a network core configuration/inclusion issue

  • i3pdmaguirre said:

    I don't follow this request. All of the I2C instances are being used by other I2C peripherals and therefore I'd effectively be moving the problem from one peripheral to the other. Am I misunderstanding your request?

    Right, though moving the issue around is not the goal - I just want to see if that is indeed what happens. 

    i3pdmaguirre said:

    I don't currently have a a project/example that can run on the dev-kit. I can try to slim down the project and create a configuration that runs on a dev-kit.

    Thank you, that would be great.

    Regards,

    Elfving

  • Here is a very crude and quick example showing how I have i2c 3 working with a Zigbee light bulb sample. This project is from NCS 2.1.2.

    zigbee_light_bulb_i2c3_scaner_nrf5340dk_cpuapp.zip

    Is it showing you the same issues on your side?

    Note the configs that are enabled in this sample, can you get your project working with only these enabled? 

    Which NCS version where you using again?

    Regards,

    Elfving

Related