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

How to use nrf52840 SPIM3 EasyDMA

Hi,

 now,I am using SPIM3 successfully,

Is EASYDMA also opened by default when I use SPIM3? If not, how to open it?

  • Hello,

    Yes, if configured correctly. Especially, you need to ensure that the buffers are located in the easyDMA RAM region.
    You can see how a normal easyDMA configuration is done here.
    You can read more about the SPIM easyDMA functionality here.

    Best regards,
    Karl

  • Hi,Karl,I have read the document you instructed, but I still don't understand how to operate it, Where can I find the demo code from the SDK ?

  • Perhaps it is the SPIM API Reference you are looking for?
    In particular, you need to ensure that the RX and TX registers given in your nrfx_spim_xfer_desc_t is located in the easyDMA memory region of the RAM. Examples of this is shown in the two links I posted in my previous reply.
    Are you familiar with assigning memory locations, and/or configuring registers directly?

    I see, could you elaborate what you are having trouble doing when you are operating it?
    Are you receiving any errors when you attempt to do transfers, or any unexpected behavior?
    It would be helpful if you could share your code, so I might get a better understanding of what you are having trouble achieving.

    I look forward to hearing your reply, so we may resolve your issue.

    Best regards,
    Karl

  • I'm sorry for the late reply,
    Maybe I should describe the my usage scenarios,

    I save the image data in SPI FLASH, and then read the image data to RAM through QSPI, then use SPIM3  to transfer the image data to drive the LCD, I hope to improve the efficiency of image data transmission to the LCD, so I choose to open SPIM3 easyDMA, with using an array list, but I don't know exactly how to use the DMA array list.

    With SPIM3, there were no transmission errors or other unexpected situations.

    Best regards,
    larkinn

  • Larkin said:
    I'm sorry for the late reply

    No problem at all.

    Larkin said:
    Maybe I should describe the my usage scenarios

    Yes, as a rule of thumb it is good to share your intentions, so that we may better understand your situation and how to help you.

    Larkin said:
    I save the image data in SPI FLASH, and then read the image data to RAM through QSPI, then use SPIM3  to transfer the image data to drive the LCD, I hope to improve the efficiency of image data transmission to the LCD, so I choose to open SPIM3 easyDMA, with using an array list, but I don't know exactly how to use the DMA array list.

    Do I understand you correctly that you would like to use easyDMA with both the QSPI transfer from the flash to RAM, and then again with the transfer from RAM to LCD?
    This should be possible, and result in minimal CPU usage for your transactions.
    Sadly, we do not have any examples of this, but you may achieve this using the SPIM and QSPI API References to set them both up using easyDMA, and then point the SPIM to transact what the QSPI has moved to the flash.
    To do this you would need to pass the start of the buffer filled by the QSPI to the SPIM for sending to the LCD.
    If you would like, these transfers could also be set up to trigger using PPI, to make it as seamless as possible for the CPU. Or you may just start the SPIM transfer as soon as one page of the QSPI has finished, it is up to you.

    Larkin said:
    With SPIM3, there were no transmission errors or other unexpected situations.

    This sounds good, but I am not sure what I should help you with then - except for the aforementioned. Is there anything in particular about the SPIM driver or SPIM3 instance that you would like to know?

    Best regards,
    Karl

Related