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.

DLPLCR4500EVM: Flash adress and encoding

Part Number: DLPLCR4500EVM
Other Parts Discussed in Thread: DLPC900, DLPC350

Hello,

As explain in an other that I asked in this forum, I am currently trying to upload an image on my DMD from matlab using the Programer's Guide.

To do so, it is necessary to use a flash adress, and the Guide told us to be carefull because the firsts kB of data are used to store some valuable information pour the chip. 

Is there a way to access which adress is safe, and what flash image number it will refer to ?

Also, according to the Programer's Guide of the DLPC900, the data send should be compressed using Run-Length Encoding, but the DLPC350 Guide do not mention anything about the possible encoding that is necessary on this device. Are we supposed to send data compressed by RLE ? By an other method ? Or juste 1Bytes per pixel ?

Thank you very much,

Best Regards,

Thomas

  • Hi Thomas,

    DLPC350 too have different compression options RLE, Uncompressed and 4-line encoding. I would suggest you to get hold of the LightCrafter 4500 GUI source code DLPC350_Frmw_SPLASH_AddSplash() function in the dlpc350_firmware.cpp file.

    I highly recommend following the GUI source code implementation for creating the firmware image -

    int DLPC350_Frmw_CopyAndVerifyImage(const unsigned char *pByteArray, int size);
    int DLPC350_Frmw_GetSplashCount();
    unsigned int  DLPC350_Frmw_GetVersionNumber();
    unsigned int DLPC350_Frmw_GetSPlashFlashStartAddress();
    int DLPC350_Frmw_GetSpashImage(unsigned char *pImageBuffer, int index);
    int DLPC350_Frmw_SPLASH_InitBuffer(int numSplash);
    int DLPC350_Frmw_SPLASH_AddSplash(unsigned char *pImageBuffer, uint8 *compression, uint32 *compSize);
    void DLPC350_Frmw_Get_NewFlashImage(unsigned char **newFrmwbuffer, uint32 *newFrmwsize);
    void DLPC350_Frmw_Get_NewSplashBuffer(unsigned char **newSplashBuffer, uint32 *newSplashSize);
    void DLPC350_Frmw_UpdateFlashTableSplashAddress(unsigned char *flashTableSectorBuffer, uint32 address_offset);
    int DLPC350_Frmw_ParseIniLines(char *iniLine);
    void DLPC350_Frmw_GetCurrentIniLineParam(char *token, uint32 *params, int *numParams);
    int DLPC350_Frmw_WriteApplConfigData(char *token, uint32 *params, int numParams);

    Regards,

    Sanjeev

  • Hello Sanjeev,

    Thank you for your answer. 
    I downloaded the GUI and tried to go through the source code, but I still got some questions

    For what I understood from your answer, the DLPC can use multiple compression options. But according to the programmer's guide, there is no fonction to specify which compression option is used when it access the flash memory to pick an image to display.
    Does that mean that when we a personnal program, we can only use the original compression ? If so, which one is it ?

    I might miss a lot of information using matlab instead of c++, and I am limited to the command described in the Programer's Guide, but here is the following commands I use :

    - Set programming mode (write 1, cmd2 = 0x30, cmd3 = 0x01)

    - Define start adress (write 0, cmd2 = 0x00, cmd3 = 0x29) => it seems that using 0x0000 as the start adress might have been a mistake, because my device is no longer initializing. I am currently trying to reprogram the flash memory 

    - Download data size (write nbofBytes, cmd2 = 0x00, cmd3 = 0x2C) => the number of Bytes depend of the method of compression used. I currently set this size to 1039680Bytes, considering that 1 pixel took 1Byte.

    - Erase data sector (write nbofBytes, cmd2 = 0x00, cmd3 = 0x28) => write a dummy byte, '00000000'

    After validation and if everything is ok, i download the data using cmd2 = 0x00, cmd3 = 0x25.
    The USB connection only allowed data transfert of 64Bytes per packages, including headers, so i used multiple sending.

    From what I learned with the source code, i should set the start adress to 0x00020000 to overwrite the image on position '0'. But I am not sure if the following images are on a specific location on the flash adress? 
    Also, using RLE might significantly reduce the size of the data to send. But do I have specify it using a particular fonction ? 

    Thank you very much for your help,

    Best regards,
    Thomas

  • Hi Thomas,

    I think you are talking two things here

    1. Directly adding images to the flash

    2. Flash programming it self.

    What you described above and your reference to the Programmer's Guide holds good for the (2) only.

    Regarding directly adding images to the flash - the answer no, you cannot write the images directly to the Flash. There is procedure of adding or embedding the images into the f/w image, only after that you will be able to download it on the flash. Please refer to the User's guide document http://www.ti.com/lit/ug/dlpu011f/dlpu011f.pdf Section 3.4 Firmware Upgrade Section 3.5 Storing Images in the Flash.

    From the GUI source code you can understand how the default configuration [ Chapter 5 Saving Solutions] and images embedded in the f/w file. Regarding the compression, the controller decodes the 24bit image header and apply respective decompression while loading on the frame buffer.

    The GUI source code by default go with the RLE compression. Just following the APIs i listed in my previous email, and send the BMP file it will take care of embedding it into the firmware image file.

    Regards,
    Sanjeev

  • Hello Sanjeev,

    I have to admit, this was not very clear to me. 
    From what I understood, if I want to display a matlab matrix on the DMD, I have to "create" a completely new firmware with the image on it, and download it into my device ?
    I am afraid it might take a long time.

    If the ultimate goal is to display a binary image, I could use some statics parameters (maximum exposure time, only one LED, uncompressed ...) : this way, the only thing that would change on the firmware would be the image stored.
    If I can access the starting address of this image, and upload a new one, could this change the image on the flash memory ?

    I am currently looking at the APIs listed on your previous email, but I am not familiar with C++ it might take some time to fully understand how to use it


    Thanks for your help

    Best regards,
    Thomas

  • Hi Thomas,

    You are correct about the procedure.

    Regarding immediate update on the DMD, the recommended step would be to use the Video Streaming mode, refer to EVM user's guide http://www.ti.com/lit/ug/dlpu011f/dlpu011f.pdf Section 3.3 Pattern Sequence Mode.

    In the streaming mode - you can basically send video data via HDMI interface on the EVM, on the PC side you can use LightCrafter 4500 EVM as secondary monitor and set resolution to 912x1140 @ 60Hz, you can then build a monochrome RGB 24bit image set it as desk top background or display full image on the secondary monitor. This option would enable to display data immediately.

    Regards,
    Sanjeev

  • Hello Sanjeev,

    Unfortunatelly, I need to be able to change this pattern from Python or Matlab, because I am using an iterative loop that require to update the matrix at each iteration. 

    Without the headers files, I think it will be very hard to use the libraries that came with the source code... So that only leave me Python.
    And to sum up, I have to open my firmware (a .bin file), Change the old image with the new one, and sent it back ?

    Best regards,
    Thomas

  • Thomas,
    You don't need to take the firmware binary path.
    You have to configure the LightCrafter 4500 EVM in pattern streaming mode from Video port.
    Then your matlab and python don't even need to worry about the LightCrafter4500 kit, you need to write to code open and display the bmp file in full screen mode on the secondary monitor which the EVM kit.
    Regards,
    Sanjeev
  • Hi Thomas,
    I am tentatively closing the query. Feel free to get back to us if you still have any issues.
    Regards,
    Sanjeev