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.

  • Resolved

DLPDLCR2000EVM: Difficulty reading spi flash data using the described procedure in DLP2607 software developer guide

Prodigy 105 points

Replies: 9

Views: 894

Part Number: DLPDLCR2000EVM

Hi Team,

I am trying to read the SPI flash data using the DLPC2607 flash controller and following the steps as discribed in DLP2607 software developer guide.

2.3.2.3.3

Flash Read Command Sequence • I 2C write to configuration registers: “flash start address (address 0x79)”, flash ADDR BYTES (address: 0x74), “flash opcode (address 0x78)”, “flash dummy bytes (address 0x75)”, “flash read data byte quantity (address 0x77)”, “flash write data byte quantity (address 0x76)” • I 2C write to “flash mode control (address 0x08)” to select to select flash read mode (data = 3) and give control of configuration space to the flash interface • I 2C read of the flash read data register (address 0x07) (I2C read returns contents of 32 bits flash data per address) • Repeat I 2C reads until the pre-defined byte count is reached. If more I 2C reads were performed than defined in the DMA length, then the last data is repeated • I 2C poll of main status register (address 0x03) to check if the flash transactions is complete – No other configuration access shall be performed via I 2C until the DMA completes, or it aborts • I 2C write to “flash mode control (address 0x08)” to place the flash controller back in idle mode (data = 0)

below is the python code i have written for this

def DPP2607_Read_FlashData();

#Set flash start address
i2c.write([0x79, 0x00, 0x00, 0x00, 0x00])
#Set flash address bytes (winbond 16M as 24bit(3 bytes) address)
i2c.write([0x74, 0x00, 0x00, 0x00, 0x03])
#set flash Opcode (0x0B for fast read)
i2c.write([0x78, 0x00, 0x00, 0x00, 0x0B])
#set flash dummy bytes (1 byte)
i2c.write([0x75, 0x00, 0x00, 0x00, 0x01])
#set flash read data byte quantity(4 bytes as 0x07 register can hold 4 bytes data)
i2c.write([0x77, 0x00, 0x00, 0x00, 0x04])
#set flash write data byte quantity(4 bytes as 0x07 register can hold 4 bytes data)
i2c.write([0x76, 0x00, 0x00, 0x00, 0x04])
#set flash mode control to read 0x03
i2c.write([0x08, 0x00, 0x00, 0x00, 0x03])


#Read flash data register 0x07
i2c.write([0x15, 0x07])
payload = i2c.read(4)
print(payload)

#Read flash data register 0x07
i2c.write([0x15, 0x07])
payload = i2c.read(4)
print(payload)

#Read flash data register 0x07
i2c.write([0x15, 0x07])
payload = i2c.read(4)
print(payload)
i2c.write([0x08, 0x00, 0x00, 0x00, 0x03])

return 0
Output
[0x00, 0x10, 0x00, 0xC8]
[0x00, 0x10, 0x00, 0xC8]
[0x00, 0x10, 0x00, 0xC8]
The data returned by the flash data register 0x07 is always 
[0x00, 0x10, 0x00, 0xC8]
Is their anything missing from my side. ?
  • Expert 3495 points
    Hi Husnain

    Welcome to E2E and thank you for your interest in DLP technology.

    Our team will get back to you soon regarding your query.

    Regards
    Azad
  • In reply to Azad:

    Husnain,

    I'll take a look to see if we have any example code to implement this functionality and respond in this thread within a couple of business days. Thanks in advance for your patience.

    Best Regards,
    Philippe Dollo
  • In reply to Philippe Dollo:

    Husnain,

    I haven't had any luck yet regarding your current issue, but I'm still looking. What are you trying to accomplish by reading the flash device, if I may ask? If there is a better way to implement what you are trying to do I may be able to suggest an alternative.

    Best Regards,
    Philippe Dollo
  • In reply to Philippe Dollo:

    Husnain,

    Do you have any feedback from your end? If not, I will assume for now that you don't need any assistance and tentatively close this topic. Feel free to reopen if you need further assistance.

    Unfortunately, I do not have example code available at this time.

    Best Regards,
    Philippe Dollo
  • In reply to Philippe Dollo:

    Hi Philippe,

    Sorry for the late response,

    What i want to accomplish is i want to read the contents of the SPI flash(W25) , i can do so(play around) with  a MCU ,but to do so i wanted to take a back up of the data using the procedure defined in the software guide as i want to be safe in case of data coruuption.

    The purpose of reading the flash contents is read and understand the batch files and also the splash images,by decoding the byte data.

  • In reply to Husnain Khan:

    Husnain,

    It may be challenging to do this via I2C. Typically, reading the flash data is done by communicating directly with the device over SPI. Please accept my friend request on E2E. Once you do, send me a private message and I can assist you further.

    Best Regards,
    Philippe Dollo
  • In reply to Philippe Dollo:

    Thanks Philippe Dollo.

    Where can i see and accept your friend request ,

    And I will get back to you sometime later , actually i have somewhat dismembered the EVM, removed the SPI flash from the board and trying to read it through MCU, i am having a few issues with the 1.8V flash as i have to use level shifter and read from my 3.3V/5V MCU.

  • In reply to Husnain Khan:

    Husnain,

    Friend requests should be visible on the top right toolbar. Just send me a private message once you accept it. :)
  • In reply to Philippe Dollo:

    Thanks Philippe.

    Done, have accepted friend request and sent a ACK about the same.

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.