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

How to use EasyDMA when calling nrfx_twim_tx

Hi there,

I've got a situation when using TWI where an `NRF_ERROR_INVALID_ADDR` is returned having performed a call to `nrfx_twim_tx`. I understand that this relates to the data to be sent not being in an EasyDMA area of memory. My question is, how do I put data into the correct place? I've gone through the documentation and examples and cannot find any further guidance.

Here's my code thus far:

ret_code_t err_code = nrfx_twim_tx(&m_twim, &i2c_address, &data, sizeof(data), false);

It appears that where the size of the data is greater than 3, I get a NRF_ERROR_INVALID_ADDR in return. Specifically, I'm transferring 28 bytes when I get that error.

Thanks for any help.

Kind regards,
Christopher

Parents Reply
  • Christopher Hunt said:
    ’m confused as to how many bytes I can actually send in one transmission. Some forum posts are stating 255 bytes, others are stating up to 65535. I’m endeavouring you use the nrfx APIs.  

     Hi Christopher,

    I am sorry your questions haven't been answered earlier, but it looks like you found out about the original problem in your ticket. Regarding how many bytes you can send in one transmission, it will depend on the "EasyDMA MAXCNT bit lenght", see an overview here. For nRF52840 TWI 16 bit lenght field will give you 65535. If you need any more help on this topic please open a new ticket, as I will mark your ticket here as "answered".

    Best regards,

    Marjeris

Children
No Data
Related