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.

TMS320F28388D: Triggering cpu1.DMA from cpu22

Part Number: TMS320F28388D


Hi,

I'm running multiple tight control loops on F28388D and using cpu1, cpu1.cla, cpu2, and cpu2.cla in parallel. I need to move data from CPU2toCPU1MsgRAM to cpu1.cla using cpu1.DMA.  I have configured the cpu1.DMA to move the data from CPU2toCPU1MsgRAM to DMAtoCLAMsgRAM.  I wanted to use software forced PWM16.SOCA event on cpu2 main to trigger cpu1.DMA transfer but have not been able to make it work.  I have done the following steps referring to dma_shared_peripheral example:

1. Setup cpu1.DMA:

//Initialize DMA
//
DMAInitialize();

DMADest = &Iiref_cc;
DMASource = &Ii_ref_21; // Location of CMPA value from CPU2

EALLOW;

//
// Set up SOURCE address:
//
DmaRegs.CH2.SRC_BEG_ADDR_SHADOW = (Uint32)DMASource; // Point to
// beginning of
// source buffer
DmaRegs.CH2.SRC_ADDR_SHADOW = (Uint32)DMASource;

//
// Set up DESTINATION address:
//
DmaRegs.CH2.DST_BEG_ADDR_SHADOW = (Uint32)DMADest; // Point to
// beginning of
// destination buffer
DmaRegs.CH2.DST_ADDR_SHADOW = (Uint32)DMADest;

EDIS;

DMACH2BurstConfig(1,1,1); // Setup burst registers
DMACH2TransferConfig(1,1,1); // Setup Transfer registers
DMACH2WrapConfig(0xFFFF,0,0xFFFF,0);
DMACH2ModeConfig(66, PERINT_ENABLE,ONESHOT_DISABLE,CONT_ENABLE,
SYNC_DISABLE,SYNC_SRC,OVRFLOW_DISABLE,THIRTYTWO_BIT,
CHINT_END,CHINT_DISABLE);
EALLOW;
DmaRegs.CH2.CONTROL.bit.RUN = 1;
EDIS;

2. Transfer ownership of PWM16 to CPU2:

DevCfgRegs.CPUSEL0.bit.EPWM16=1; 

3. Configuring SOCA of PWM16 on CPU2

//Setup EPWM16.SOCA event
EALLOW;
CpuSysRegs.PCLKCR0.bit.TBCLKSYNC = 1;
CpuSysRegs.PCLKCR2.bit.EPWM16 = 1;
EPwm16Regs.ETSEL.bit.SOCAEN=1;
EDIS;

4. Forcing PWM16.SOCA event on CPU2 inside an ISR

EALLOW;
EPwm16Regs.ETFRC.bit.SOCA=1;
EDIS;

When I run the code on cpu2, the cpu1.DMA transfer does not trigger but if I force DMA transfer using DmaRegs.CH2.CONTROL.bit.PERINTFRC on cpu1, the data transfers successfully.  Which means that PWM16.SOCA is either not being generated or cpu1.DMA trigger is not setup correctly.  I have not been able to find the problem. I'd appreciate your advice on this issue. 

Thanks