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

TWI with Softdevice S110

Hi

I have a problem using TWI driver with my softdevice enabled.

The TWI is able to communicate successfully to the slave without the softdevice.

But the same code when merged with the softdevice and an character sent for Read/Write returns busy or the BLE chip restarts.

Below is the part of example code used for toggling led ON/OFF by sending an character from phone.

Find full code here = BLE_TWI.txt

Please tell me what changes I should make.

Parents Reply Children
  • well there's nothing wrong with it per-se, it won't break anything, it just won't give an accurate 500ms. The softdevice interrupts will continue to happen and interrupt the nrf_delay, which is just a busy load of NOPs making it a random delay which is something longer than 500ms. It's not clear from a cursory look at that code whether accurate delays even matter.

    oh one point I should have made - if you do long blocking delays during an interrupt handler at APP HIGH priority - that is bad as it will stop the softdevice executing its lower priority tasks, but blocking in interrupt handlers anyway is a bad idea and you can actually block in the APP LOW priority ones if you want to without bothering the softdevice at all. Not that I recommend it.

  • I reduced the delay to 5ms for both Read/Write still its not working.

    Which Driver should I be using for TWI with soft device ?

Related