Hi,
I am testing the CSL LCD example (c55xx_csl\ccs_v4.0_examples\lcd\CSL_LCDC_262kColorModeExample) with the EVM5505. It works fine with CCS 4.1 but if I generate the boot5505.bin to boot from SD card, it'll get freezed. If I use a for loop to push data to LCD instead of using DMA, it works again. I guess there is a problem with DMA when booting from SD card.
I am not able to have attachment here so I try to post the code here.Any help would be appreciated.
Following is the line 344-423 in the main file from the CSL example mentioned above:
/////////////////////////////////////////////////////////////
////USING CPU TO PUSH DATA TO LCD - WORK WELL! ///////////////////////////
// for (i = 0; i < 5000; i ++)
// dataWrite(0x9ABC, CSL_LCDC_LIDD_CS0);
//
///////////////////////////////////////////////////////////
//USING DMA TO PUSH DATA TO LCD - FREEZED WHEN BOOT FROM SD///////////////////////////
status = LCD_configDMA (hLcdc, &configDma);
if (status != CSL_SOK)
{
printf("LCD_configDMA Failed\n");
return;
}
else
{
printf("LCD_configDMA Successful\n");
}
/* Trigger the DMA Bit for Data Transfer */
CSL_lcdcEnableLiddDMA(hLcdc);
/* Wait for the DMA data transfer to complete */
while (cnt_lcd != 1);
/* Disable the DMA */
CSL_lcdcDisableLiddDMA(hLcdc);
cnt_lcd = 0;
/*set the panel co-ordinate for display */
retVal = windowSetup(60, 0, 119, 119, CSL_LCDC_LIDD_CS0);
if(retVal != LCDC_SOK)
{
printf("windowSetup Failed\n");
return;
}
else
{
printf("windowSetup Successful\n");
}
/* Clear the DMA buffer */
for (index = 0; index < LCD_MAX_BUFFER_SIZE; index++)
{
gLcdBuf[index] = 0x0000;
}
color = BLUE;
for (index = 0; index < LCD_MAX_BUFFER_SIZE; index += 3)
{
gLcdBuf[index] = (color & 0xFF);
gLcdBuf[index + 1] = ((color >> 8) & 0xFF);
gLcdBuf[index + 2] = ((color >> 16) & 0xFF);
if (configDma.bigEndian == CSL_LCDC_ENDIANESS_BIG)
{
gLcdBuf[index] = CSL_LCD_SWAPBYTES(gLcdBuf[index]);
gLcdBuf[index + 1] = CSL_LCD_SWAPBYTES(gLcdBuf[index + 1]);
gLcdBuf[index + 2] = CSL_LCD_SWAPBYTES(gLcdBuf[index + 2]);
}
}
cmdWrite(WRITE_TO_GRAM, CSL_LCDC_LIDD_CS0);
status = LCD_configDMA (hLcdc, &configDma);
if(status != CSL_SOK)
{
printf("LCD_configDMA Failed\n");
return;
}
else
{
printf("LCD_configDMA Successful\n");
}
/* Trigger the DMA Bit for Data Transfer */
CSL_lcdcEnableLiddDMA(hLcdc);
/* Wait for the DMA data transfer to complete */
while (cnt_lcd != 1);
/* Disable the DMA */
CSL_lcdcDisableLiddDMA(hLcdc);
Joe