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

Two-wire interface does not work together with Bluetooth

Hi!

I am using nRF51822 evaluation kit and connecting it as a master to a pair of I2C-devices (using twi_hw_master.c). Everything works well, but when I integrated the TWI (I2C) example code with the Nordic example ble_app_hrs (hear rate monitor) the TWI stops working. The initialization function just blocks (twi_master_init()). However, if I remove ble_stack_init() and other BT-initializations it starts working. Adding back only the ble_stack_init() is enough to make the TWI to block again.

When debugging, the twi_hw_master initialization function twi_master_init() seems to block on this line:

NRF_PPI->CH[0].EEP        = (uint32_t)&NRF_TWI1->EVENTS_BB;

Questions: Q1: Is there some configuration issue in the examples so that TWI and BLE won't work together? Q2: Is there even some hardware related problem for that combination? Q3: In any case, do you have any ideas to solve the problem?

Parents
  • This has been covered at length here before, so I'd recommend you to browse around a little, for instance looking at this question, or one of the multiple others here.

    However, I just finished a quick example of how the TWI can be used with the softdevice on second revision chips, and that example is available here, including a modified version of twi_hw_master.c, taking advantage of the working SHORTS on second revision chips.

    If you use first revision chips, you should instead follow the suggested workaround in the question I linked to above, using the sd_ppi_* interface.

Reply
  • This has been covered at length here before, so I'd recommend you to browse around a little, for instance looking at this question, or one of the multiple others here.

    However, I just finished a quick example of how the TWI can be used with the softdevice on second revision chips, and that example is available here, including a modified version of twi_hw_master.c, taking advantage of the working SHORTS on second revision chips.

    If you use first revision chips, you should instead follow the suggested workaround in the question I linked to above, using the sd_ppi_* interface.

Children
Related