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

TWI Module lock-up still present in nrf51822 v3 [PAN #56]

Hi,

I am currently experiencing TWI module lock-up issues with the hardware TWI library, which is supposedly fixed according to PAN v3.0, issue #56. (The issue was previously identified in PAN v2.3)

My setup is as follows, custom board, SD110v8, NRF51822 QFAAH0 (16kB flash, v3 silicon). My code is modified from the dfu_ble_dual_bank example in the Keil packs. The TWI transaction is triggered every 2s by the app_timer.

If I change the TWI library to software TWI, then the problem disappears.

An interesting note is, before the dfu bootloader starts (prior to the function call of : bootloader_dfu_start ), the module lock up doesnt seem to happen. Once the bootloader fully starts, (after calling bootloader_dfu_start function), the TWI transaction would randomly occur, fairly frequently.

Could someone from Nordic provide some insight to this problem? As my observations seem to contradict the PAN v3.0

Warm regards, Mike

Parents
  • Hi. Which TWI driver are you using. I'm afraid that there are a couple of different versions out there. I have attached the TWI hardware driver included in SDK v8 which is supposed to have corrected for PAN 56.

    twi_hw_master.c

  • hi RK, apologies for the late reply again, been tied up with some other work and havent got the time to investigate this.

    I took out the oscilloscope and started probing the I2C bus. What I have discovered is:

    using the PACK SW library, no issues observed using the PACK HW library, occasional issue observed (no NACK received, the SDA is not held low) using a custom HW library, which I found from one of the other posts, no issues observed

    I will include the screenshots I have took too

    1 - PACK SW working

    2 - PACK HW Working

    3 - PACK HW error

    4 - Custom HW working

    Also, this is the custom HW TWI library that I have used. twi_hw_master.c

    Judging from the screenshots, SW has slightly different timing for the SCL, which is expected.

    When the PACK HW library is working, it looks identical to the custom HW library (compare 2 with 4).

    However, when the PACK HW library is not working, I can also confirm that SDA is not held low during the NACK bit.

    I did a quick comparison between the custom HW .c file and the PACK HW .c file, there are quite a few differences, which lead me to think, there might be an issue with the existing HW library in the PACK?

Reply
  • hi RK, apologies for the late reply again, been tied up with some other work and havent got the time to investigate this.

    I took out the oscilloscope and started probing the I2C bus. What I have discovered is:

    using the PACK SW library, no issues observed using the PACK HW library, occasional issue observed (no NACK received, the SDA is not held low) using a custom HW library, which I found from one of the other posts, no issues observed

    I will include the screenshots I have took too

    1 - PACK SW working

    2 - PACK HW Working

    3 - PACK HW error

    4 - Custom HW working

    Also, this is the custom HW TWI library that I have used. twi_hw_master.c

    Judging from the screenshots, SW has slightly different timing for the SCL, which is expected.

    When the PACK HW library is working, it looks identical to the custom HW library (compare 2 with 4).

    However, when the PACK HW library is not working, I can also confirm that SDA is not held low during the NACK bit.

    I did a quick comparison between the custom HW .c file and the PACK HW .c file, there are quite a few differences, which lead me to think, there might be an issue with the existing HW library in the PACK?

Children
No Data
Related