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.

MSPM0G3507: Where is the destination address of DMA

Part Number: MSPM0G3507

Hi all,

I am using the MSPM0G3507 LaunchPad to try DMA example dma_block_trasfer.c.

I ran the code and can see the data were transferred to RAM address started from 0x20000000h

But I don't understand how the address 0x20000000h was  configured.

In the line below there is no any parameter referring to 0x20000000h 

 

DL_DMA_setDestAddr(DMA, DMA_CH0_CHAN_ID, (uint32_t) &gDstData[0]);

Thanks.

Leo

  • Hi Leo,

    When you run that line of code, the third argument "(uint32_t) &gDstData[0]" is specififying that the destination address for the chosen DMA module on channel 0 is the location of the gDstData buffer. In other words, &gDstData[0] is the starting location of the gDstData[] buffer. 

    If you are debugging in CCS, you could open the expressions window and add gDstData to the window, and then it will show the memory location for this buffer. It is also possible to do this by opening the memory browser by opening the "View" menu and selecting "Memory Browser". Then you can search for gDstData and see the buffer in the window. I will show this in an image below:

  • Thank you so much.

  • Thank you Dylan,

    I followed your comments and tried it.
    I do see that the values at address starting from &gDstData[0] (0x20200000) has changed, which makes sense since gDstData is the destination address.

    But I still don't understand why the values at the address starting from (0x20000000) has also changed while the content is the same as (0x20200000)?

    Thank you.

      

  • Hi Leyong,

    When you say that the values at the source address (0x20000000) have changed, are you saying that you are observing them turn red at the start of the program? This would occur because the program you load into your device starts by writing to gSrcData, so this is "changed" in the perspective of CCS, even though this remains the same for the duration of the program, and if you re-program your device.

  • Hi Dylan,

    I was following the training document, DMA Introduction Lab  DMA Introduction Lab

    In the "Debug in CCS" section, after DMA processing, the data array was transferred to 0x20000000

  • In the DMA introduction lab, it shows that the array is written to gSrcData before the start of main(). It is there before any DMA activity takes place. Inside of main(), the DMA channel is set up to transfer data from gSrcData to gDstData. You can see if you set a breakpoint at line 54, before the DMA is set up, that gSrcData is filled with the correct data, and gDstData is filled with 0. If you run the code for a moment, then stop it after the DMA has been set up and allowed to run, you will see that the data remains in gSrcData (because you have not erased it), and the data has now been copied over to gDstData as well. 

  • Thank you so much. I understand now.