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.

I2C Data Download Command

Other Parts Discussed in Thread: DLPC350

Hello,

When using the I2C Data Download Command (0x25) to download a firmware image, do I need to poll the DLPC350 status after sending the 0x25 command each time?

As an example, I want to send 1024 bytes of download data to Address 0x20000:

S 1A(W) 0x29 0x00 0x00 0x02 0x00 P   --(Start Address at 0x20000)

S 1A(W) 0x2C 0x00 0x02 0x00 0x00 P  --(Download Data Size 0x200)

S 1A(W) 0x28 P  --(Erase Sector)

S 1A(W) 0x25 0x00 0x02 <512 bytes of data> <1-Byte checksum> P -- Data Download of the first 512-bytes.

If I read status (0x23) at this point, I get a 0x8B returned, the Flash Busy bit is set and stays set..  Is this the expected behavior?    If I write an additional 512 bytes of data the busy bit remains set.   The programmer's guide just says "The number of bytes downloaded by consecutive download data commands must match the predefined Flash Data Size for the operation to be successful."

Any suggestions on proper programming procedure?

Thanks!

Mark

  • Mark,

    Please do the following :

    Do I need to poll the DLPC350 status after sending the 0x25 command each time?'

    >>  You don't need to poll for every time.

    1. Enter Programming mode

    2. Set Address [Addr]

    3. Set Data Size [dSize]

    4. Erase sectors until all the required [dSize] number of bytes are erased; for this DLPC350 provides you the Flash Manufacturer's ID and Flash Device ID. From this you can decode the flash layout

    5. Download 48 bytes at a time // You can experiment upto 64, 128, 256,.. bytes

    6. After downloading ALL the bytes

    7. Issue Validate checksum command

    8. Read the checksum to ascertain the downloaded checksum matches to the returned checksum

    S 1A(W) 0x25 0x00 0x02 <512 bytes of data> <1-Byte checksum> P -- Data Download of the first 512-bytes.

    >> for the intermediate packets actually the firmware doesn't look at the checksum so change this to

    S 1A(W) 0x25 <48-bytes> P -- Data Download of first 48 bytes

    S 1A(W) 0x25 <48-bytes> P -- Data Download of 2nd 48 bytes

    ---

    ---

    S 1A(W) 0x25 <48-bytes> P -- Data Download of 9th 48 bytes

    S 1A(W) 0x25 <48-bytes> P -- Data Download of last 48 bytes

    Let us know if you are still facing any issues.

    Regards,

    Sanjeev

  • By the way I would recommend adding delays between each download as DLPC350 needs to write that data into the flash. Same thing after issuing CheckSum compute command.

    I think for b/w downloads 100ms should be okay.

    For Compute checksum it depends on the size of the content you have downloaded, example: 1KB vs 1MB. The time will be different.

    Regards,
    Sanjeev