the question is about DAT function on c6455
We want to transfer "src" to "dst" by DAT function in CSL.
the following code is the demo of c6455,but this code didn't transfer "src" to "dst",
I find that when code run to "DAT_wait(id)" the problem happen,and I think the problem is that“IPR”always“0”.
so I don't konw how to remedy the code?
//-------------------------------------code------------------------------------------------------
#include <stdio.h>
#include <csl_dat.h>
/* Global Setup, Data */
#define DAT_CSL_EXA_OK 1
#define NUMBER_OF_ROW 8
#define NUM_OF_BYTES 256
#define ARRAY_INDEX 16
#define FILL_VALUE 0x55555555
#define LINE_PITCH 20
/* Function forwards */
Int dat_1dXfer(void);
/* global buffers used during transfer */
Uint8 src[NUM_OF_BYTES];
Uint8 dst[NUM_OF_BYTES];
/* Variable to verify example status */
Int pass = 1;
void main(void)
{
if (dat_1dXfer() && pass)
{printf("<< EXAMPLE PASSED >>: Dat 1D DAT Example Passed \n");}
else
{printf("<< EXAMPLE FAILED >>: Dat 1D DAT Example Failed \n");}
}
Int dat_1dXfer(void)
{
Int loopIdx;
Int id;
Uint32 fillVal;
DAT_Setup datSetup;
/* dat setup */
datSetup.qchNum = CSL_DAT_QCHA_0;
datSetup.regionNum = CSL_DAT_REGION_GLOBAL ;
datSetup.tccNum = 1;
datSetup.paramNum = 0 ;
datSetup.priority = CSL_DAT_PRI_1;
/* Initialize the memory */
for (loopIdx = 0; loopIdx < NUM_OF_BYTES; loopIdx++){
src[loopIdx] = loopIdx;
dst[loopIdx] = 0xff;
}
/* opening the dat module */
DAT_open (&datSetup);
/* Copies a linear block of data from Src to Dst */
id = DAT_copy (&src, &dst, NUM_OF_BYTES);
/* Waits for a previous transfer to complete */
DAT_wait(id); //!!!when the code run here,the problem happen.<-------Problem!!!
/* Verify received data */
for (loopIdx = 0; loopIdx < NUM_OF_BYTES; loopIdx++) {
if (dst[loopIdx] != loopIdx) {
printf("Linear block of data transfer from src to dst is failed\n");
pass = 0;}
}
fillVal = FILL_VALUE;
/* Fills a linear block of memory with the specified fillVal
using EDMA */
DAT_fill (&dst, NUM_OF_BYTES, &fillVal);
DAT_wait (id);
/* Verify fill data */
for (loopIdx = 0; loopIdx < NUM_OF_BYTES; loopIdx++) {
if (dst[loopIdx] != ((Uint8)fillVal)) {
printf("Filling linear block of memory with the specified ");
printf("fillVal is failed\n");
pass = 0;
}
}
return DAT_CSL_EXA_OK;
}