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.

MSPM0L1306: DMA GPIO Input Source Address Error

Part Number: MSPM0L1306
Other Parts Discussed in Thread: SYSCONFIG,

Tool/software:

I would like to set the DMA source address to GPIOA->DIN31_0 for the purpose of using it as a poor man's logic analyser capture. Whenever I set

DMA->DMACHAN[DMA_CH0_CHAN_ID].DMASA = (uint32_t) (0x400A1280);

I get an Address error.

I looked at the TRM Figure 1-1. MSPM0Lxx Bus Organization diagram, and GPIO is shaded in orange, which the legend says is PD1/PD0, CPU/DMA ACCESS.

on page 15 it says "The GPIO DOUT registers (data out) are also available on the PD1 peripheral bus, primarily so that the
DMA can be used to load values to the GPIO DOUT registers."

So DMA has no problem writing to the GPIO as I understand.

I have checked my code and monitored to verify the DMA is happy when ever I set the Source Address to variables memory, or the SPI RXDATA register.

Would you have any hints for what I might be doing wrong?

  • Hi Antony Luton

    Please check https://www.ti.com/tool/SYSCONFIG for mspm0 basic code generation.

    May I know if this code is generated by sysconfig or it is from the example code of MSPM0-SDK

    Thanks

  • Hi Xiaodong, In case I made an error with my code, I have since tried the resource library dma_block_transfer_LP_MSPM0L1306_nortos_ticlang , and shortened it to just 1 length by setting

    #define DMA_TRANSFER_SIZE_WORDS (1)

    It works fine when

     DL_DMA_setSrcAddr(DMA, DMA_CH0_CHAN_ID, (uint32_t) &gSrcData[0]);

    ie source is variable SRAM memory.

    But if you set

    DL_DMA_setSrcAddr(DMA, DMA_CH0_CHAN_ID, (uint32_t) 0x400A1380);

    it has an address error. I haven't been able to get the DMA to source from any of the GPIO registers.

    Would the designers have protected the GPIO peripheral registers from being read from DMA (source address set to GPIOA peripheral memory access)?

  • Hi Antony Luton

    Please check this exmaple. Thanks

    dma_block_transfer_LP_MSPM0L1306_nortos_ticlang.zip

  • Hi Xiaodong,

    I have used your supplied project exactly as provided with no modifications, compiled and downloaded to my MPM0L1306 launch pad. The address error bit is set:

    Does it work on your launchpad?

    Thanks Antony

  • Hi Antony,

    According to the TRM 13.2.5, which is shown below, two main points for summary:

    1. I believe GPIO just allows the DMA write-access to the DOUT registers. 

    2. You need to set DMAMASK bit before doing the DMA operation. (Refer to the function: DL_GPIO_enableDMAAccess(GPIO_Regs* gpio, uint32_t pins))

    You can turn to the TRM for the details.

    This is a quick modification for easy testing:

    Below is the definition of 'gDstData2':

    uint32_t gDstData2[1] = {0xFFFFFFFF};

    Testing Result:

    Before:

    After:

    It's worth noting that if you want to see the result as above, where at the address 0x400A1280 is 0xFFFFFFFF, you need to remove all GPIO configurations in sysconfig, in order to avoid CPU operating in these ports. And this is just a simple test based on the original project, please change the corresponding DMA configuration in Sysconfig according to your application needs.

    Best Regards,
    Peter

  • Hi Peter,

    Back to the original query, it seems it won't allow setting the DMA source address to be any GPIO registers. A great shame I think, as there are a lot of uses for that, including what I hoped to use it for - feeding back communications bus signals for protocol checking & analysis.

    Thank you for your assistance.