[SOLVED] JFlashSPI cannot wake up flash chip from power-down state before trying (and failing) to read flash ID

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] JFlashSPI cannot wake up flash chip from power-down state before trying (and failing) to read flash ID

    Is there any way to force JFlashSPI to write a custom SPI command *before* it tries to read the flash ID?

    I'm using a JLink Plus to program a W25X40CL SPI flash[0] for a Lattice ICE40 FPGA. The FPGA reads the configuration bitstream from the flash at reset, and then issues the 0xB9 (Deep Power Down) command to the flash chip[1]. After that command, the flash chip does not respond to any commands except for 0xAB (Release from Deep Power Down). When the JFlashSPI tries to read the flash ID (0x9F), the flash chip does not respond (as expected).

    I've tried creating an init sequence to write the 0xAB command, but JFlashSPI always tries (and fails) to read the flash ID before it starts the init sequence, so I cannot wake up the flash chip.

    My current workaround is to disable auto-detecting the flash chip and manually specifying the flash details with the flash ID replaced by FF FF FF. This allows the flash ID check to pass so we can move on to the init sequence that wakes up the chip, and then everything continues normally.

    [0] winbond.com/resource-files/w25…pdf?src-supplier=Digi-Key
    [1] http://www.latticesemi.com/view_document?document_id=46502
  • Hello,

    Thank you for your inquiry.
    Currently JFlashSPI will always first try to detect the Flash ID. This is to make sure that a reliable connection to the chip is established so no damage can be done.
    So unfortunately you would have to use your workaround in this specific case.

    Alternatively you can also purchase the J-Link SDK and create your own version of the J-Flash SPI that handles such special cases:
    segger.com/products/debug-prob…nk/technology/j-link-sdk/

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.