1. My hardware platform is TI TMS320C6678evm board
2. The software environment is CCS 5.4.0 and mcsdk_2_01_02_06
3. Now, due to the project, I need to use three EDMA3 channels to transfer data at the same time, two channels is used to transfer data from DDR3 to L2SRAM and one channel from L2SRAM to DDR3. I use the following codes to request the channels.
unsigned int chId0= 0; unsigned int chId1= 0; unsigned int chId2= 0; unsigned int tcc0= 0; unsigned int tcc1= 0; unsigned int tcc2= 0; unsigned int edmaInstance = 1; hEdma = edma3init(edmaInstance, &edmaResult); /* Setup for Channel 1*/ tcc0 = EDMA3_DRV_TCC_ANY; chId0= EDMA3_DRV_DMA_CHANNEL_ANY; /* Request any DMA channel and any TCC */ result = EDMA3_DRV_requestChannel (hEdma, &chId0, &tcc0, (EDMA3_RM_EventQueue)0, NULL, NULL); if (result == EDMA3_DRV_SOK) printf("DMA channel 0: %d\n", chId0); else printf("DMA channel 0 request failed!\n"); tcc1= EDMA3_DRV_TCC_ANY; chId1= EDMA3_DRV_DMA_CHANNEL_ANY; result1= EDMA3_DRV_requestChannel (hEdma, &chId1, &tcc1, (EDMA3_RM_EventQueue)0, NULL, NULL); if (result1== EDMA3_DRV_SOK) printf("DMA channel 1: %d\n", chId0); else printf("DMA channel 1 request failed!\n"); tcc2= EDMA3_DRV_TCC_ANY; chId2= EDMA3_DRV_DMA_CHANNEL_ANY; result2= EDMA3_DRV_requestChannel (hEdma, &chId2, &tcc2, (EDMA3_RM_EventQueue)0, NULL, NULL); if (result2 == EDMA3_DRV_SOK) printf("DMA channel 2: %d\n", chId2); else printf("DMA channel 2 request failed! error code : %d\n", result2);
But only two channels(chId0 and chId1) work, the third channel have the error -132(EDMA3_DRV_E_DMA_CHANNEL_UNAVAIL), I know this means there are not enough DMA channels to support, but actually the hardware support 64 channel, I use 8 cores and every core corresponding to a region, each region should have 3 channels to work. The sum is 24 channels. So we should choose Instance1 to support these channels. I see some discussions in the forum, they said the reason why we can't open more than 2 channels having relationship with the sample_c6678_cfg.c file. If you want to use more channels, you should change the parameters in the sampleInstInitConfig. Due to the bit rules and no clash between different regions, I change the sampleInstInitConfig's ownPaRAMSets、ownDmaChannels and ownTccs. For example:
/* Resources owned/reserved by region 5 */
{
/* ownPaRAMSets */
/* 31 0 63 32 95 64 127 96 */
{0x00F00000u, 0x00000000u, 0x00000000u, 0x00000000u,
/* 159 128 191 160 223 192 255 224 */
0x00000000u, 0x00000000u, 0xFFFFFFFFu, 0x00000000u,
/* 287 256 319 288 351 320 383 352 */
0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
/* 415 384 447 416 479 448 511 480 */
0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
/* ownDmaChannels */
/* 31 0 63 32 */
{0x00F00000u, 0x00000000u},
/* ownQdmaChannels */
/* 31 0 */
{0x00000020u},
/* ownTccs */
/* 31 0 63 32 */
{0x00F00000u, 0x00000000u},
/* ownQdmaChannels */
/* 31 0 */
{0x00000020u},
/* ownTccs */
/* 31 0 63 32 */
{0x00F00000u, 0x00000000u},
/* resvdPaRAMSets */
/* 31 0 63 32 95 64 127 96 */
{0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
/* 159 128 191 160 223 192 255 224 */
0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
/* 287 256 319 288 351 320 383 352 */
0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u,
/* 415 384 447 416 479 448 511 480 */
0x00000000u, 0x00000000u, 0x00000000u, 0x00000000u},
/* resvdDmaChannels */
/* 31 0 63 32 */
{0x00000000u, 0x00000000u},
/* resvdQdmaChannels */
/* 31 0 */
{0x00000000u},
/* resvdTccs */
/* 31 0 63 32 */
{0x00000000u, 0x00000000u},
},
However, it still don't work. Someone said he made such changes and rebuilt the edma3_lld_rm_sample.ae6 making the program work, I don't how to do this, so I didn't do this. Does this really work?
4. At last, “C:\ti\edma3_lld_02_11_05_02\packages\ti\sdo\edma3\rm\sample\src\platforms\” and "C:\ti\edma3_lld_02_11_05_02\packages\ti\sdo\edma3\drv \sample\src\platforms\" have the same sample_c6678_cfg.c file, do the two files work same? If I want to change the sampleInstInitConfig, should I change one of them or both?