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

Confusion with List in EasyDMA

Hi,

The samples for using list are BUFFER = 4, but it does not specify is that is the only size that works, and what value do you place on NRF_SPIM0->TXD.LIST

In my case I need a buffer size of 8, and 46 samples. I implemented the following, among other code, which does not seem to have any effect. Am I missing something?

#define BUFFER 8

typedef struct ArrayList {
	uint8_t buffer[BUFFER];
} ArrayList_type;

ArrayList_type MyArrayList[46];
ArrayList_type MyReceiveList[46];

NRF_SPIM0->TXD.PTR    = (uint32_t)MyArrayList;
NRF_SPIM0->TXD.MAXCNT = 46;

NRF_SPIM0->RXD.PTR    = (uint32_t)MyReceiveList;
NRF_SPIM0->RXD.MAXCNT = 46;

nrf_spim_event_clear(NRF_SPIM0, NRF_SPIM_EVENT_ENDTX);
NRF_SPIM0->TXD.LIST = 8;  //I tried as per documentation to only place a 1 here.
NRF_SPIM0->RXD.LIST = 8;
nrf_spim_task_trigger(NRF_SPIM0, NRF_SPIM_TASK_START);	
Parents
  • Hi, Antonio

    The RXD.LIST only used to enable/diasble the EasyDMA list. It means the RXD.PTR will automatic add a offset of RXD.MAXCNT value.

    And EasyDMA List will not check the PTR boundary, you should do the check in SPI_IRQHandler.

    In your case, the config should like this:

    uint8_t buffer_list[46][8];
    RXD.PTR = buffer_list;
    RXD.MAXCNT = 8;
    RXD.LIST = 1;
    
    SPI_IRQHandler()
    {
        if ( RXD.PTR < bufferlist boundary )
           start next transmission.
    }
    
  • SPIM doesn't know how many times it has to repeat. It only understands where the data (PTR) is and how many bytes (MAXCNT) to transfer. And when EasyDMA list is enabled, it will automatic change the PTR for next transmission. Then you can just start the next transmission without manually change the PTR .

Reply Children
No Data
Related