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

SPIM DMA LIST MAXCNT change

Hi all, I am using SPIM with dma list triggered by gpiote. A gpio low-to-high event starts spim reading, and it works fine. However, I need to read different length at different spi register address.

The dma list examples I found always use constant reading length, as below:

typedef struct ArrayList
{
   volatile uint8_t buffer[3];
} ArrayList_type;
static volatile ArrayList_type WriterList0[10];

nrfx_spim_xfer_desc_t xfer_desc = NRFX_SPIM_XFER_TX(WriterList0, 3);

I wonder how to change the maxcnt dynamicly without CPU intervention? For example, once the gpio event published, I want the spim read

i. 3 bytes from spi address a;

ii. 6 bytes from spi address b;

iii. 4 bytes from spi address c;

Thank you all.

Best regards.

Parents
  • Hi, squwal

    At present, I also have a project that needs to use SPI DMA to ensure the continuity of SPI receiving data. Gpiote interrupt is also used to trigger SPI read / write. Can you briefly provide the partial code of PPI connecting SPI and gpiote, and the partial code of setting SPI DMA read-write cache.

    Now I have finished the part of using PPI to connect SPI and gpiote. When gpiote is interrupted, an SPI callback can be generated.

    But I don't know if my method is correct or not, and how to make MCU not participate in SPI reading and writing automatically by hardware DMA. I don't know how to set it.

    I hope you can give me some advice to help me understand and solve this problem.

    Best regards!

    June6

Reply
  • Hi, squwal

    At present, I also have a project that needs to use SPI DMA to ensure the continuity of SPI receiving data. Gpiote interrupt is also used to trigger SPI read / write. Can you briefly provide the partial code of PPI connecting SPI and gpiote, and the partial code of setting SPI DMA read-write cache.

    Now I have finished the part of using PPI to connect SPI and gpiote. When gpiote is interrupted, an SPI callback can be generated.

    But I don't know if my method is correct or not, and how to make MCU not participate in SPI reading and writing automatically by hardware DMA. I don't know how to set it.

    I hope you can give me some advice to help me understand and solve this problem.

    Best regards!

    June6

Children
No Data
Related