This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP432P401R: MSP432, Memory Scatter Gather DMA, interrupts INTx not triggered

Part Number: MSP432P401R

Tool/software: Code Composer Studio

Hello

I am working on a program using memory scatter gather DMA. The data seems to be correctly copied from one RAM location to the other but the DMA_INTx is not fired. Could you please help me in solving the issue. My code is based on the  example dma_array_transfer_software trigger. Thanks in advance for your valuable help.

Regards, Jeremy

Please find the parts of the code below:

*Task List

DMA_ControlTable TaskList[] =

{

// 1. Transfer the 8 samples

DMA_TaskStructEntry(8, UDMA_SIZE_8,

UDMA_SRC_INC_8, (void *)&SourceArray[0],

UDMA_DST_INC_8, (void *)&destinationArray[0],

UDMA_ARB_4, UDMA_CHCTL_XFERMODE_MEM_SGA

),

// 2. Transfer last 8 samples

DMA_TaskStructEntry(8, UDMA_SIZE_8,

UDMA_SRC_INC_8, (void *)&SourceArray[16],

UDMA_DST_INC_8, (void *)&destinationArray[16],

UDMA_ARB_4, UDMA_MODE_BASIC

),

};

* DMA setup

MAP_DMA_enableModule();

MAP_DMA_setControlBase(controlTable);

/* Assigning Channel 0 to Reserved 0 and enabling channel 0*/

MAP_DMA_assignChannel(DMA_CH0_RESERVED0);

/* Disabling channel attributes */

MAP_DMA_disableChannelAttribute(DMA_CH0_RESERVED0, UDMA_ATTR_ALTSELECT | UDMA_ATTR_USEBURST | UDMA_ATTR_HIGH_PRIORITY | UDMA_ATTR_REQMASK);

/* Set the DMAs primary channel for memory scatter gather mode */

uint32_t TaskCount = 2;

MAP_DMA_setChannelScatterGather(DMA_CH0_RESERVED0, TaskCount, &TaskList[0], false);

MAP_DMA_assignInterrupt(DMA_INT1, 0);

MAP_Interrupt_enableInterrupt(INT_DMA_INT1);

MAP_DMA_enableChannel(0);

MAP_Interrupt_enableMaster();

MAP_DMA_requestSoftwareTransfer(0);

*Interrupt Routine

/* Completion interrupt for DMA */

void DMA_INT1_IRQHandler(void)

{

MAP_DMA_disableChannel(0);

isFinished = true;

}

  • Hey Jeremy,

    We'll look into this and get back to you shortly.

    BR,

    Seong

  • Dear Seong

    Thanks for your prompt reply. If it helps I can send you the whole project.

    Best regards, Jeremy

  • Dear Seong

    Could you please tell me if you made some progress in solving my issue. Actually, I will teach the DMA on the MSP432 familly in few weeks. I do not know presently  what I will say to my students about memory scatter gather on these devices: "It does not work" or Something like "we are still waiting for a workarround from TI". Thanks for your valuable help in solving my issue or in increasing my knowledge about this peripheral.

    Best regards, Jérémy

  • Sorry for late, Jeremy, 

    Thanks for reaching out to the TI E2E support forum.  We are committed to providing a quality E2E experience to our customers during the global COVID-19 health pandemic and the associated work restrictions.  In this particular case we require access to specific HW and lab instrumentation to further debug the issue posted in this thread.  

    We are checking this issue and determining what can be done in this regard and will give an update by  Apr.15th. 

    Thanks,

    Lixin 

  • Lixin,

    Did you make some progress about my issue?

    Thanks a lot for your valuable help.

    Best regards, Jérémy

  • > UDMA_ARB_4, UDMA_MODE_BASIC

    Try:

    >        UDMA_ARB_4, UDMA_MODE_AUTO

    Basic requires a new trigger , but Auto continues using the previous trigger.[Ref TRM (SLAU356H) Table 11-13]

    TRM Sec 11.2.3.4.5 (1st para) does refer to "basic" (uncapitalized?) but the diagram [Fig 11-6] talks about Auto. The former seems misleading at best. (There's a "Complaint", er "Feedback" link at the bottom of each TRM page. They're probably sick of hearing from me.)

  • Dear Bruce

    Thanks a lot for your input. I waited a lot for an answer from TI. The documentation from TI is almost a copy and paste of ARM's PL230 documentation. Both are talking about Basic not Auto. It is very subtle if we have to take into account the CASE of words in the meaning. When we look at the opcodes in the table of figure 11.6 of  SLAU356I, Basic transfert is used.  Personally, I found the right answer by another approach and a lot of wasted time but with the same conclusion.

    Thanks again Bruce and I hope having an official answer from TI.

    Best regards, Jérémy

  • I was able to see the DMA stall, and that one change caused it to work properly. I wrote my own wrapper for the function you posted, so maybe that's a difference.

    I see what you mean about the table at the top of Fig 11-6 (cycle_ctrl=b001); it doesn't seem to match the rest of the figure, which talks about Auto. The analogous section in the msp432E series chapter (a very different device but the DMA is similar) cites Auto explicitly.

    I agree that one shouldn't have to "read the runes" in order to make this stuff work. Maybe the TI folk will have a suggestion.

  • Hi, Jeremy, 

    Sorry for late reply. 

    Do you have tried other DMA cycle types instead of scatter-gather with the similar software structure to see if the interrupt is triggered? This can help to screen out other configuration issues. 

    I am trying to find a scatter-gather DMA code example for you. 

    Thanks, 

    Lixin 

  • Hi, Jeremy, 

    I have found a scatter-gather DMA code example for your reference. It is in released MSP432 driver library code examples: 

    http://dev.ti.com/tirex/explore/node?node=ANZORZtHqB-z5DGdUK2Ryg__z-lQYNj__LATEST

    Please try it and let me know if you have any further questions. 

    Thanks, 

    Lixin  

  • Dear Lixin

    Thanks for the reply. The peripheral scatter gather is working. To answer to your first question, I tried with success all other kinds of transfer like a simple memory to memory transfer. My problem was with the memory scatter gather. Actually, I found the solution but I do not know why the ARM and TI documentations say to use as a last step a basic transfer. This does not work.

    Thanks for your valuable help.

    Best regards, Jérémy Terrien

  • Hi, Jeremy, 

    Glad to hear you found the solution. 

    TI licensed the CPU+DMA from ARM. So the TI and ARM have the same description for DMA. From the description, it is right the last step is a basic cycle. I think it is to tell DMA module that the scatter-gather transfer completed and the dma_done is set for interrupt triggered if it is enabled. I am not sure why you said it doesn't work. We haven't found there is bug related to the DMA. 

    In addition, what is the solution you found for the interrupt triggered? It is to remove the last step a basic transfer? 

    Thanks, 

    Lixin

  • Dear Lixin

    When you set a basic transfer as the last configuration (as stated in the MSP432 technical manual or the ARM documentation), the corresponding interrupt is not fired. In order to obtain an interrupt at the end I used 'auto' not 'basic'.

    Best regards, Jérémy

  • What I observed was that the last ("Basic") segment didn't execute, i.e. the DMA stalled partway through. As a result of that, the interrupt didn't fire.

  • Hi, Jeremy, 

    Thanks for the information. We will check this. Any way, you can try the code example I sent to you. Its last configuration is 'basic'. You can check if it works for the interrupt trigger and if there is any difference from your code. 

    Regards, 

    Lixin

  • I was mistaken. The final segment partially executed, notably the first 4 items were moved. This is from UDMA_ARB_4. A Basic cycle with 2^R < N will arbitrate (wait for another trigger) in the middle, but an Auto cycle won't. So an alternate  suggestion is:

    > UDMA_ARB_8, UDMA_MODE_BASIC      // UDMA_ARB_8 >= N (which is 8 above)

     though I suddenly like Auto a lot. 

    [Edit: small clarification. and then another.]

  • Dear Bruce

    Thanks a lot for your last answer. If I understand correctly, we must program the last Basic DMA cycle for copying the last chunk of data without any arbitration. This is not very practical. At least, we have two ways to program a memory scatter gather DMA. The mode Auto seems to be more practical even if it does not comply to the technical reference manual.

    Thanks again Bruce. Best regards, Jérémy 

  • It does help explain why the MSP432E-series TRM suggests terminating a Memory S/G with Auto [Ref E-series TRM (SLAU723A) Sec 8.3.5.5]. That seems like a useful addition (fix) to the P-series TRM.

    The UDMA_ARB value does have meaning for Auto -- the DMA unit pauses to let others in, then continues. So you can use it in a memory-memory operation to avoid being a bus hog.

  • I submitted a document change complaint, er, "request" for this. We'll see how it turns out.

    [Edit: "this" == "recommend Auto for this case rather than Basic"]

**Attention** This is a public forum