I'm trying to communicate with FPGA through 16bits, synchronous mode EMIFA.
First, I want to read data from FPGA, but I only can read 4 continue data.
For example,
what I read:
0x0001, 0x0002, 0x0003,0x0004,0x0006,0x0007......
but actually the data which FPGA sent to DSP is continues (0x0001, 0x0002, 0x0003,0x0004,0x0005,0x0006...)
I use logic analyser to see the SOE pin, find that, when I read data, it only can be active low in 6 cycles(R_LTNCY = 2), so I only can get 4 continues data.
Why SOE pin can't stay active low until the DSP finish read ?
Can I control SOE pin stay in low, or it only control by EDMA (I'm not sure)?
I use the code which is in C6457 csl file's EMIFA example. I change the code to 16bits, synchronous mode.
Following is a part of the code:
Uint32 result,index, tempData,datacount,index_count=0,length;
CSL_EmifaObj emifaObj;
CSL_Status status;
CSL_EmifaHwSetup hwSetup ;
CSL_EmifaMemType asyncVal;
CSL_EmifaMemType syncVal;
CSL_EmifaAsyncWait asyncWait = CSL_EMIFA_ASYNCWAIT_DEFAULTS;
CSL_EmifaSync syncMem = CSL_EMIFA_SYNCCFG_DEFAULTS;
/* Pointer that points to Sync(CE2) start area */
Uint32 *pSyncData;
Uint16 data_in;
/* Clear local data structures */
memset(&emifaObj, 0, sizeof(CSL_EmifaObj));
memset(&hwSetup, 0, sizeof(CSL_EmifaHwSetup));
/* setting for synchronous type */
syncVal.ssel = EMIFA_MEMTYPE_SYNC;
syncVal.async = NULL;
syncVal.sync = &syncMem;
/* setup the hardware parameters */
hwSetup.asyncWait = &asyncWait;
hwSetup.ceCfg[0] = &syncVal;
hwSetup.ceCfg[1] = NULL;
hwSetup.ceCfg[2] = &asyncVal;
hwSetup.ceCfg[3] = NULL;
printf("\tInfo: Read-Write operations of EMIFA \n");
/* Initialize EMIFA CSL module */
status = CSL_emifaInit(NULL);
if (status != CSL_SOK) {
printf("EMIFA: Initialization error.\n");
printf("\tReason: CSL_emifaInit [status = 0x%x].\n", status);
return;
}
else {
printf("EMIFA: Module Initialized.\n");
}
/* Opening the EMIFA instance */
hEmifa = CSL_emifaOpen(&emifaObj, CSL_EMIFA, NULL, &status);
if ((status != CSL_SOK) || (hEmifa == NULL)) {
printf("EMIFA: Error opening the instance. [status = 0x%x, hEmifa \
= 0x%x]\n", status, hEmifa);
return;
}
else {
printf("EMIFA: Module instance opened.\n");
}
/* Setting up configuration parameter using HwSetup */
status = CSL_emifaHwSetup(hEmifa, &hwSetup);
if (status != CSL_SOK) {
printf("EMIFA: Error in HW Setup.\n");
printf("Read write operation fails\n");
return;
}
else {
printf("EMIFA: Module Hardware setup is successful.\n");
}
printf("\tInfo: Sync read write \n");
/* read **valid** values into CS2 area. */
pSyncData=(Uint32 *)EMIFA_CE2_BASE_ADDR;
memcpy(data_in,pSyncData,512);
for (index = 0; index < 256; index=index+1)
{
printf("data_in[%d] = %d\n",index,data_in[index]);
}
return ;
}
CSL_EMIFA_SYNCCFG_DEFAULTS:
#define CSL_EMIFA_SYNCCFG_READBYTEEN_DEFAULT 0x00
#define CSL_EMIFA_SYNCCFG_CHIPENEXT_DEFAULT 0x00
#define CSL_EMIFA_SYNCCFG_READEN_DEFAULT 0x00
#define CSL_EMIFA_SYNCCFG_WLTNCY_DEFAULT 0x00
#define CSL_EMIFA_SYNCCFG_RLTNCY_DEFAULT 0x01
#define CSL_EMIFA_SYNCCFG_SBSIZE_DEFAULT 0x01
Did I miss anything to set in synchronous mode?