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

  • I don't know - I haven't used the sw master, actually I haven't used the hw master either :) but I just looked at it, wow, it's an old bit banger. I would say that's going to have somewhat different timing than the real hardware interface, it seems from looking at the code quite .. generous about timings. I'd check the speed you're running the I2C at, perhaps try something slower, check all the parameters too, I assume those two things are supposed to be API compatible but check everything.

    One last thought, make sure that EVENTS_ERROR isn't already set from something previous before you start the transfer. I have no idea whether starting a new transfer clears it if set, if not, you may be instantly failing because it was set previously. I don't see in the code anywhere it's cleared.

    Failing that - it's logic analyser time to see what's actually being written in each case.

Reply
  • I don't know - I haven't used the sw master, actually I haven't used the hw master either :) but I just looked at it, wow, it's an old bit banger. I would say that's going to have somewhat different timing than the real hardware interface, it seems from looking at the code quite .. generous about timings. I'd check the speed you're running the I2C at, perhaps try something slower, check all the parameters too, I assume those two things are supposed to be API compatible but check everything.

    One last thought, make sure that EVENTS_ERROR isn't already set from something previous before you start the transfer. I have no idea whether starting a new transfer clears it if set, if not, you may be instantly failing because it was set previously. I don't see in the code anywhere it's cleared.

    Failing that - it's logic analyser time to see what's actually being written in each case.

Children
No Data
Related