LPC55S69 DMA Channel Chain Example

cancel
Showing results for 
Search instead for 
Did you mean: 

LPC55S69 DMA Channel Chain Example

Jump to solution
330 Views
andrew_lonsdale
Contributor II

I have been trying to understand how to configure the InputMux to chain DMA's using the DMA Channel Chain Example, and I have come to the conclusion that the example doesn't quite do what it says in the readme.txt.

The original configuration for the input mux is:

#define DEMO_DMA_CHANNEL_TRIGGER_INPUT0 kINPUTMUX_Otrig0ToDma0
#define DEMO_DMA_CHANNEL_TRIGGER_OUTPUT0 kINPUTMUX_Dma0Hash0TxTrigoutToTriginChannels

    INPUTMUX_Init(INPUTMUX);
    INPUTMUX_AttachSignal(INPUTMUX, DEMO_DMA_CHANNEL2, DEMO_DMA_CHANNEL_TRIGGER_INPUT0);
    INPUTMUX_AttachSignal(INPUTMUX, DEMO_DMA_CHANNEL1, DEMO_DMA_CHANNEL_TRIGGER_INPUT0);
    INPUTMUX_AttachSignal(INPUTMUX, 0, DEMO_DMA_CHANNEL_TRIGGER_OUTPUT0);
    INPUTMUX_AttachSignal(INPUTMUX, DEMO_DMA_CHANNEL0, DEMO_DMA_CHANNEL_TRIGGER_INPUT0);

I think that the completion of DMA channel 0 triggers DMA channels 1, 2 and the second transfer of DMA channel 0, rather than the completion of DMA channel1 causing the second descriptor of DMA channel 0 to execute (as suggested in the readme).

I have changed the inputmux configuration as follows:


#define DEMO_DMA_CHANNEL1 1
#define DEMO_DMA_CHANNEL0 0
#define DEMO_DMA_CHANNEL2 2
#define DEMO_DMA_CHANNEL_TRIGGER_INPUT0 kINPUTMUX_Otrig0ToDma0
#define DEMO_DMA_CHANNEL_TRIGGER_INPUT1 kINPUTMUX_Otrig1ToDma0
#define OTRIG0 0
#define OTRIG0 1
#define DEMO_DMA_CHANNEL_TRIGGER_OUTPUT0 ((DMA0_OTRIG_INMUX0 << PMUX_SHIFT) + DEMO_DMA_CHANNEL0)
#define DEMO_DMA_CHANNEL_TRIGGER_OUTPUT1 ((DMA0_OTRIG_INMUX0 << PMUX_SHIFT) + DEMO_DMA_CHANNEL1)

INPUTMUX_Init(INPUTMUX);
INPUTMUX_AttachSignal(INPUTMUX, DEMO_DMA_CHANNEL2, DEMO_DMA_CHANNEL_TRIGGER_INPUT0);
INPUTMUX_AttachSignal(INPUTMUX, DEMO_DMA_CHANNEL1, DEMO_DMA_CHANNEL_TRIGGER_INPUT0);
INPUTMUX_AttachSignal(INPUTMUX, OTRIG0, DEMO_DMA_CHANNEL_TRIGGER_OUTPUT0);
INPUTMUX_AttachSignal(INPUTMUX, OTRIG1, DEMO_DMA_CHANNEL_TRIGGER_OUTPUT1);
INPUTMUX_AttachSignal(INPUTMUX, DEMO_DMA_CHANNEL0, DEMO_DMA_CHANNEL_TRIGGER_INPUT1);

I think this more clearly shows how to configure the example as per the readme. If I have it wrong, please comment.

Hope this helps someone.

Charles

Labels (1)
0 Kudos
1 Solution
141 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Charles Lonsdale,

Thanks for your sharing, I agree with you.

BR

Alice

View solution in original post

0 Kudos
2 Replies
142 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Charles Lonsdale,

Thanks for your sharing, I agree with you.

BR

Alice

View solution in original post

0 Kudos
141 Views
andrew_lonsdale
Contributor II

Hi Alice,

Thanks for checking it over and confirming.

Kind regards

Charles

0 Kudos