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: DMA configuration by other DMA channels

Part Number: MSPM0G3507

Hello!

I need to configure DMA by another channels and have some questions to be sure if it is robust approach and approved implementation so we can use it and be sure it is 100% nice.

My bench:

  • MSPM0G3507;
  • DMA ch0/1/2 are servicing channels for configuration writing;
  • DMA ch3 is the channel we configure.

I implemented next pipeline:

  1. DMA ch0 writes DMAEN=0;
  2. DMA ch1 writes configuration (I change only DMADA, not sure about other registers);
  3. DMA ch2 writes DMAEN=1;
  4. DMA ch3 starts from SW trigger;

Result: new configuration applied and works well.
Main idea here is that configurable DMA channel must be disabled (DMAEN=0) when new configuration is written.

But I don't see such implementation in CCS Examples and documentation, so I have question about a valid and optimal pipeline for it.

Questions:

  1. Can I find valid pipeline for such implementation?
  2. Can we write DMAEN=0 in the one transfer with other DMA registers if they are placed in memory after DMAEN, so actually written after?
    i.e. DMACTL (with DMAEN bit) is before DMASA, DMADA, DMASZ, so here we actually set DMAEN=0 and only after it write DMASA, DMADA, DMASZ.
  3. Do we need some delay before DMAEN switching for Latching or something?

I checked it already, seems fine, but I need to be sure if it is really correct because documentation is poor for such details.

  • Hi Serhii,

    According to your questions:

    Main idea here is that configurable DMA channel must be disabled (DMAEN=0) when new configuration is written.

    Yes, Ensure that DMAEN=0 when configuring DMA then there won't be any problems.

    Can I find valid pipeline for such implementation?

    We do not have a pipeline for configuring another DMA via DMA. For normal DMA configurations, you can find relevant example demos in our SDK.

    • Can we write DMAEN=0 in the one transfer with other DMA registers if they are placed in memory after DMAEN, so actually written after?
      i.e. DMACTL (with DMAEN bit) is before DMASA, DMADA, DMASZ, so here we actually set DMAEN=0 and only after it write DMASA, DMADA, DMASZ.
    • Do we need some delay before DMAEN switching for Latching or something?

    A delay need be set for robustness, It's possible that the registers haven't been latched yet due to the DMA transfer being too fast.

     

    Best Regards,
    Peter

  • A delay need be set for robustness, It's possible that the registers haven't been latched yet due to the DMA transfer being too fast.

    Is it specified somewhere?
    Robustness means we need to specify known delay value which must be documented, checked and validated before :)

    For normal DMA configurations, you can find relevant example demos in our SDK.

    I don't see such examples in mspm0_sdk_2_08_00_03.

    Yes, Ensure that DMAEN=0 when configuring DMA then there won't be any problems.

    What about configuration of DMA channel when DMAEN=1 but registers are written backwards?

    So if DMA memory map is:
    - DMACTL
    - DMASA
    - DMADA
    - DMASZ

    And we start writing from DMASZ with DestAddr=DECREMENT, so actual writing sequence is DMASZ-->DMADA-->DMASA-->DMACTL.

    I see that when any DMACHAN register is written DMAEN bit is cleared automatically and channel is de-armed. But since DMACTL is written last - it is armed right at the end of the transfer.

    This allows to use only one channel to rewrite other channels in one transfer.
    Currently it is working on my bench, and as far as I know - same behavior was in MSP43x, so I expect DMA module should have same idea in MSPM0.