Part Number: TMS320F28388D
Hi all!
I think i have a problem with DMA setup.
I use CLB counter0(C0) as shift register and when the C0 receives a 32-bit data, HLC pushes this data to fifo. Then when fifo has 4words(32-bit) HLC triggers an int. This part is working, I debugged and cpu goes interrupt.
I wanted to trigger DMA with this interrupt to write 4 words(32-bit) data in the fifo to a memory at each burst. However, I caouldn't make the code works. I got DMA interrupt at the end of transfer but the data is not transfered to a memory. I am not sure if it is memory access problem or initialization. My init code is below. Can anybody help me about it? That would be appreciated.
cheers,
//
// Defines
//
#define FIFO_LVL 8 // FIFO interrupt level
#define BURST FIFO_LVL // Each burst will empty the FIFO
#define TRANSFER 16 // It will take 16 bursts of 8 to transfer
#define SIZE (TRANSFER * BURST)
uint32_t r2Data[SIZE]; // Receive data buffer
#pragma DATA_SECTION(r2Data, "ramgs1");
void initDMA()
{
//
// Initialize DMA
//
DMA_initController();
DMA_configAddresses(DMA_CH4_BASE, r2Data,
(uint32_t *)(CLB1_BASE + CLB_DATAEXCH));
DMA_configBurst(DMA_CH4_BASE, BURST, 1, 1);
DMA_configTransfer(DMA_CH4_BASE, TRANSFER, 0, 1);
DMA_configMode(DMA_CH4_BASE, DMA_TRIGGER_CLB1INT, DMA_CFG_ONESHOT_DISABLE |
DMA_CFG_CONTINUOUS_DISABLE | DMA_CFG_SIZE_32BIT);
DMA_enableTrigger(DMA_CH4_BASE);
DMA_setInterruptMode(DMA_CH4_BASE, DMA_INT_AT_END);
DMA_enableInterrupt(DMA_CH4_BASE);
}