This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

5505 CSL example - boot from SD - freezed if using LCDC DMA

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

  • Joe,

    Please confirm you are using secure mode.

     

    Thanks,

    Steve

  • Hi Steve,

    Thanks for your reply. Yes, I did use the tool"C55BootImage.exe" with a evaluation key to generate the bin file in secure mode. And the not-using-DMA bin file can boot from SD & work well.

    Thanks,

    Joe

  • Joe,

    Please tell me which CSL version and example, and CCS4 version that you are running so I can duplicate it.

    I just want to confirm one last time that:

    1)  your secure boot image is generated using TI's encryption tool;

    2) your have excluded SARAM31 memory location;

    3) this code is not loaded on any other boot peripherals having higher loading order than SD (any flash memories).

    Thanks,

    Steve

  • Hi Steve,

    The CSL I am using is v2.01.00.00 released on March. I'll send you the project to your email if you like.

    1) Yes, I used TI's encryption tool to generate the bin file.

    2) (excluded SARAM31 memory location) could  you please tell me how to check this? I generated the boot file from CSL example & I didn't change anything.

    3) No, & it works if I comment out the code snipet using DMA.

    Thanks,

    Joe

  • Joe,

    My email is stsang@ti.com.

    Thanks,

    steve

  • Hi Steve,

    Could you tell me if there is anything new on this issue? Did you get the code I sent to your email several months ago?

    Thanks,

  • Joe,

    I am sorry but I don't have your code. I have restudied your posting and would like to further clarify your issue. Are you doing the LCD data transfer in the middle of a boot from SD? If yes, please try the DMA after the boot complete.

    Regards.

  • Hi Joe,

    I suppose it's not relevant for you now but anyway..

    I saw the same problem with DMA after booting from SD or SPI-flash on C5535 DSP.

    In my case CDMA and DMA used for SD didn't work.

    I found a solution for this problem and I think it can be helpful for other developers from e2e who are also looking for the fix for this issue.

    In Errata for C553x (the same for C550x) there is a point "Bootloader Disables Peripheral Clocks". It is said that bootloader disables clock for all peripheries including MPORT, Memory port which is used by DMA and CDMA.

    Work-around from Errata:

    *(ioport volatile unsigned *)0x0001 = 0x000E;
    asm(" idle");

    It enables all modules from ICR configuration. It worked for me and I suppose it will fix your problem.

    Thanks,

    Denis