Hi, Everyone!!!
I have a lot of questions when using EDMA on multicore devices such as TMS320TCI6614.
For Example, I want to use VcpA on different cores at different times. Vcp use Edma.
- How to initialize EDMA on different cores
On Core0:
CSL_Edma3Obj edmaObj;
CSL_Status status = CSL_edma3Init((CSL_Edma3Context*) NULL);
CSL_Edma3Handle handle = CSL_edma3Open(&edmaObj, instEdma, (CSL_Edma3ModuleAttr*) NULL, &status);
On Core1-Core3:
What handle to use?
2. How to initialize regions
CSL_Edma3CmdDrae cmdDrae;
cmdDrae.region = CSL_chipReadReg(CSL_CHIP_DNUM);
if (instEdma == instEdma0) {
// DRAE enable(Bits 0-15) for the shadow region; there are 4 channels on one core
cmdDrae.drae = (0x1111 << CSL_chipReadReg(CSL_CHIP_DNUM)) & 0xFFFF;
cmdDrae.draeh = 0x0;
} else {
// DRAE enable(Bits 0-63) for the shadow region; since there are 64 channels.
cmdDrae.drae = 0xFFFFFFFF;
cmdDrae.draeh = 0xFFFFFFFF;
}
status = CSL_edma3HwControl(handle, CSL_EDMA3_CMD_DMAREGION_ENABLE, &cmdDrae);
assert(status == CSL_SOK);
3. How to enable interrupts
CSL_Edma3CmdIntr cmdIntr;
cmdIntr.region = CSL_chipReadReg(CSL_CHIP_DNUM);
cmdIntr.intr = 0;
cmdIntr.intrh = 0;
if (channel < 32)
cmdIntr.intr = 1 << channel;
else
cmdIntr.intrh = 1 << (channel - 32);
CSL_edma3HwControl(handle, CSL_EDMA3_CMD_INTR_ENABLE, &cmdIntr);
What handle to use on different cores?
4. Why may not interruptions occur?
5. Why in interrupt function intr & intrh sometimes are zeros? (Therefore, the program hangs on waiting for data transfer complete)
void EdmaISR() {
CSL_Edma3CmdIntr region;
region.region = CSL_chipReadReg(CSL_CHIP_DNUM);
CSL_edma3GetHwStatus(handle, CSL_EDMA3_QUERY_INTRPEND, ®ion);
while (region.intr || region.intrh) {
uint32_t intr = region.intr;
uint32_t intrh = region.intrh;
CSL_edma3HwControl(handle, CSL_EDMA3_CMD_INTRPEND_CLEAR, ®ion);
CSL_edma3GetHwStatus(handle, CSL_EDMA3_QUERY_INTRPEND, ®ion);
uint32_t tcc = 0;
uint32_t mask = 1;
while (intr) {
if (intr & mask) {
CompleteChannel(tcc);
intr ^= mask;
}
mask <<= 1;
tcc++;
}
tcc = 32;
mask = 1;
while (intrh) {
if (intrh & mask) {
CompleteChannel(tcc);
intrh ^= mask;
}
mask <<= 1;
tcc++;
}
}
}
Thanks, Dmit.