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

  • Ah ok - so I don't think that is the lockup then. AFAIR the lockup meant exactly that, nothing happened, the character was never sent, there was no error, it just locked up and you never heard from it again.

    That's what timeout-- did, it polled for a certain amount of cycles beyond which something should have happened and when it didn't, it reset the chip. So if it locked up eventually it would fail and reset.

    In your case however you're not dropping into that code because timeout has hit zero, but because TWI has reported an error, the second piece of that 3-part if() statement. In this case it's 0x02 which is ANACK, a NAK was received after sending out the address. So the address went out and the peripheral you were trying to talk to didn't hold the data line low during the next clock period.

    Good news, seems unlikely to be the lockup, bad news, time to get the logic scope out.

Reply
  • Ah ok - so I don't think that is the lockup then. AFAIR the lockup meant exactly that, nothing happened, the character was never sent, there was no error, it just locked up and you never heard from it again.

    That's what timeout-- did, it polled for a certain amount of cycles beyond which something should have happened and when it didn't, it reset the chip. So if it locked up eventually it would fail and reset.

    In your case however you're not dropping into that code because timeout has hit zero, but because TWI has reported an error, the second piece of that 3-part if() statement. In this case it's 0x02 which is ANACK, a NAK was received after sending out the address. So the address went out and the peripheral you were trying to talk to didn't hold the data line low during the next clock period.

    Good news, seems unlikely to be the lockup, bad news, time to get the logic scope out.

Children
No Data
Related