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

TWIM XFER Hangs Unless NRFX_TWIM_FLAG_NO_XFER_EVT_HANDLER used as a flag

Hello! 

I have this interesting bug with the twim driver.

It works perfectly with the NRFX_TWIM_XFER_TXRX transfer type: I see the transaction go out on the bus lines and the interrupt calls my handler when the transfer is complete. 

When I switch the xfer type to NRFX_TWIM_XFER_TX, however, I get the following: 

1) The transaction occurs successfully: I see the start and stop bits and all the bits in between are as expected. 

2) My handler is never called. 

3) If I poll wait using 'nrfx_twim_is_busy', it never leaves the while loop. 

4) If I use the NRFX_TWIM_FLAG_NO_XFER_EVT_HANDLER flag, the data goes out on the pins, the handler is never called (as expected) BUT 'nrfx_twim_is_busy' eventually 

    returns 'false'. 

What am I missing? I see that I have to enable EasyDMA on the active Twim instance for the project to compile but I don't have any easy DMA code setup. 

Parents
  • Hello,

    It works perfectly with the NRFX_TWIM_XFER_TXRX transfer type: I see the transaction go out on the bus lines and the interrupt calls my handler when the transfer is complete. 

    When I switch the xfer type to NRFX_TWIM_XFER_TX, however, I get the following: 

    Could you possibly share a code snippet of your NRFX_TWIM_XFER_TX declaration and use?
    Could you also elaborate on how you initiate your transfers - whether you are using the nrfx_twim_xfer for, or are you doing this through PPI, or any other way?
    It would also be helpful to see your TWIM init function, if possible.

    Please use the 'Insert code' option when sharing code on the forum.

    I see that I have to enable EasyDMA on the active Twim instance for the project to compile but I don't have any easy DMA code setup. 

    Yes, the TWIM driver uses EasyDMA be default.

    Looking forward to resolving this issue together!

    Best regards,
    Karl

Reply
  • Hello,

    It works perfectly with the NRFX_TWIM_XFER_TXRX transfer type: I see the transaction go out on the bus lines and the interrupt calls my handler when the transfer is complete. 

    When I switch the xfer type to NRFX_TWIM_XFER_TX, however, I get the following: 

    Could you possibly share a code snippet of your NRFX_TWIM_XFER_TX declaration and use?
    Could you also elaborate on how you initiate your transfers - whether you are using the nrfx_twim_xfer for, or are you doing this through PPI, or any other way?
    It would also be helpful to see your TWIM init function, if possible.

    Please use the 'Insert code' option when sharing code on the forum.

    I see that I have to enable EasyDMA on the active Twim instance for the project to compile but I don't have any easy DMA code setup. 

    Yes, the TWIM driver uses EasyDMA be default.

    Looking forward to resolving this issue together!

    Best regards,
    Karl

Children
No Data
Related