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

Stream data over TWI with start signal only in the beginning of the frame, and one stop at the end of the frame

Hello,

I am working on a sensor which requires data transfer over with data length over 255 bytes. I am using nRF52832 uC and and from what I see from nordic infocenter by using the following portion of code:

ret_code_t nrf_drv_twi_tx(nrf_drv_twi_t const * p_instance,
                          uint8_t               address,
                          uint8_t const *       p_data,
                          uint8_t               length,
                          bool                  no_stop);

I can send up to 255 bytes and it is possible to set no_stop to true to not send a stop signal. However as you know, the simple write burst operation has a message similar to this message,  , but that case isn't true, when Data Frame xxx is bigger than 255, since after each data frame, no start signal is resent.

Parents
  • Hello Bakry,

    Which SDK version are you using? I see from your initial post that you reference nrf_drv_twi_tx from the legacy TWI driver, and you later in your comment reference a function from nrfx_twi.c
    I would recommend that you do not use these drivers interchangeably, even though the legacy driver is just forwarding macros to the nrfx implementation in later SDK's.

    I am not sure I have understood your issue correctly, but if you are trying to send data over 255 bytes you may do so if you are using the TWIM driver rather than the TWI one. The TWIM driver uses easyDMA by default, which then does not suffer from the 255 byte limitation.
    I would recommend that you use the nrfx_twim driver for this, and that you use the nrfx_twim_xfer function for the purpose you describe.

    Please let me know if anything still should be unclear, or if you should encounter any other issues or questions!

    Best regards,
    Karl

Reply
  • Hello Bakry,

    Which SDK version are you using? I see from your initial post that you reference nrf_drv_twi_tx from the legacy TWI driver, and you later in your comment reference a function from nrfx_twi.c
    I would recommend that you do not use these drivers interchangeably, even though the legacy driver is just forwarding macros to the nrfx implementation in later SDK's.

    I am not sure I have understood your issue correctly, but if you are trying to send data over 255 bytes you may do so if you are using the TWIM driver rather than the TWI one. The TWIM driver uses easyDMA by default, which then does not suffer from the 255 byte limitation.
    I would recommend that you use the nrfx_twim driver for this, and that you use the nrfx_twim_xfer function for the purpose you describe.

    Please let me know if anything still should be unclear, or if you should encounter any other issues or questions!

    Best regards,
    Karl

Children
No Data
Related