This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

TWI and S140 BLE controller conflict on nrf52840 dk using Zephyr

I have TWI sensor comms running fine in Zephyr on nrf52840_dk and separately Bluetooth controller in low latency mode using S140 softdevice also running fine in Zephyr on the nrf52840_dk.

When combined into one project, if the BT stack is enabled (even with no callbacks or API calls) then TWI transfers cause the processor to hard fault after only a few seconds. (From the debugging I have done it appears to fault when attempting to unready a thread.)


If TWI transfers are not called then BT works fine. If BT is not enabled then TWI transfers are fine. 

I understand that the Softdevice requires certain resources to be blocked or restricted but I have not been able to figure out what specific resources the TWI implementation is actually using to check if there is a conflict.

I have tried to switch to TWIM in case this is more robust but I then discovered that the Zephyr TWIM driver does not support bus recovery. 

Are you able to clarify if the Zephyr nrf TWI or TWIM drivers are expected to be compatible with enabling Softdevice Bluetooth controller on Zephyr? Then I would know to keep trying. 

Thanks 

Parents
  • Hi,

    Are you able to clarify if the Zephyr nrf TWI or TWIM drivers are expected to be compatible with enabling Softdevice Bluetooth controller on Zephyr?

     Yes, they are expected to be compatible. 

    What tag/branch/commit are you using ?

    How have you configured the stack/heap ?

    Do you see any changes if you set the stack/heap like this ?

    # Heap and stacks
    CONFIG_HEAP_MEM_POOL_SIZE=16384
    CONFIG_MAIN_STACK_SIZE=8192
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    CONFIG_HW_STACK_PROTECTION=y

    Bluetooth controller in low latency mode

    Do you see any difference in behavior if you are not using low latency mode?

Reply
  • Hi,

    Are you able to clarify if the Zephyr nrf TWI or TWIM drivers are expected to be compatible with enabling Softdevice Bluetooth controller on Zephyr?

     Yes, they are expected to be compatible. 

    What tag/branch/commit are you using ?

    How have you configured the stack/heap ?

    Do you see any changes if you set the stack/heap like this ?

    # Heap and stacks
    CONFIG_HEAP_MEM_POOL_SIZE=16384
    CONFIG_MAIN_STACK_SIZE=8192
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    CONFIG_HW_STACK_PROTECTION=y

    Bluetooth controller in low latency mode

    Do you see any difference in behavior if you are not using low latency mode?

Children
Related