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

TWI locks on nRF51822 v3

hello,

i am experiencing issues with the TWI library on the smart beacon kit rev. 1.3.0 which features the v3 of the nRF51822. i had the same experience on the new nRF52840(preview devkit) but it is not happening as often there.

doing some research i stumbled upon several issues with the TWI driver/peripheral and also found out that there was indeed a lockup problem which, however, should be fixed with the current silicon revision.

TWI module lockup still present in nrf51822 v3-pan-56

TWI stuck and blocked [closed]

TWI issue ? [closed]

Possible bug: I2C stuck

we're using:

  • nRF5_SDK_12.3.0
  • nRF51822 (Smart Beacon Kit v 1.3.0), latest revision v3
  • nRF52840 (Bluetooth 5 preview kit)

the problem appears in nrf_drv_twi.c, line 561

while (twi_transfer(p_twi, &p_cb->error, &p_cb->bytes_transferred, (uint8_t *)p_data, length, no_stop))
{}

one workaround mentioned in the other issues was to use the DMA mode - which is not available for the nRF51 (at least not in the SDK v12.3). are there any updates on that?

the device we're creating will be under heavy stress (vibrations, movement, etc.) so the I2C should be quite stable -- or at least we should be able to recover from issues w/o a restart (we'd lose the bluetooth connection).

any ideas on how to proceed? i really want to avoid using bit-banging.

Parents
  • Just a basic sanity check:

    • Is your nRF51 I2C master or slave?
    • Do you have proper pull-up resistors on the wires?
    • You say "TWI goes down" in the first screenshot but there it seems that two characters (Write + Address + one byte) are transferred properly. What exactly is the failure?

    In general I2C slave had troubles on all nRF51 revisions to run stable while there is BLE connection ongoing, only TWI (I2C) Master has dedicated HW to survive in such conditions...

Reply
  • Just a basic sanity check:

    • Is your nRF51 I2C master or slave?
    • Do you have proper pull-up resistors on the wires?
    • You say "TWI goes down" in the first screenshot but there it seems that two characters (Write + Address + one byte) are transferred properly. What exactly is the failure?

    In general I2C slave had troubles on all nRF51 revisions to run stable while there is BLE connection ongoing, only TWI (I2C) Master has dedicated HW to survive in such conditions...

Children
No Data
Related