read/write external flash(GD25Q16E) fail with QSPI

Hi Nordic,

I am working with nRF52840, sdk17.1.0 and got a pcb with external flash with GD25Q16E.

Pins usage are:  SCLK: P0.25,  CS:P1.00,  SIO0:P0.21,   SIO1:P0.15,  SIO2:P0.22, SIO3:P0.19

First I have modified the pins and used the example on sdk\examples\peripheral\qspi\ to run on pcb.

    .pins = {                        \
       .sck_pin     = 25,            \
       .csn_pin     = 32,            \
       .io0_pin     = 21,            \
       .io1_pin     = 15,            \
       .io2_pin     = 22,            \
       .io3_pin     = 19,            \
    }, 

After running the code, I got "Data inconsistent". The result is fail, all read data is 0x88.

Then. I compared commands between GD25Q16E and MX25R6435F, most commands are the same but switching to qspi mode.

So I removed the "switching to qspi mode" code, run again. The result is still fail, all read data is changed to 0xFF.

#if 0
    // Switch to qspi mode
    cinstr_cfg.opcode = QSPI_STD_CMD_WRSR;
    cinstr_cfg.length = NRF_QSPI_CINSTR_LEN_2B;
    err_code = nrf_drv_qspi_cinstr_xfer(&cinstr_cfg, &temporary, NULL);
    APP_ERROR_CHECK(err_code);
#endif

My questions are:

1. What will cause the all data is 0xFF? Is it possible writing also fail?

2. Does need resister/capacitance/... on the qspi pins  or  just connected directly ?

3. Do you have worked on GD25Q16E? Could give me a guide?

Best Regards,

Gavin

Parents
  • Hi Nordic,

    I found nrfjprog can be used to read/write external MX25R6435F QSPI flash.

    Is it also workable for GD25Q16E?

    Does the nrfjprog use page program(cmd: 0x02) to write data ?

    Best Regard,

    Gavin

  • I suggest you play around and test a bit with nrfjprog command line to interface your qspi flash first to ensure that it's electrically correct before you start with the code development. 

    For instance you can find there is both an 'nrfjprog --qspieraseall' and 'nrfjprog --readqspi filename' that can be used. Note however that you may need to adjust C:\Program Files (x86)\Nordic Semiconductor\nrf-command-line-tools\share\QspiDefault.ini file in a text editor to fit with your hardware layout.

    For instance in the .ini file I suggest you try with Frequency = M2

    Remember to take a copy of the .ini file.

    Best regards,
    Kenneth

  • Looks like it:

    The QSPI flash will be mapped from memory location starting from 0x12000000.

    Kenneth

  • Hi Kenneth,

    I tested on our pcb and got these log.

    C:\Users\Gavin>nrfjprog --memrd 0x12000000
    ERROR: Unable to connect to a debugger.
    ERROR: JLinkARM DLL reported an error. Try again. If error condition
    ERROR: persists, run the same command again with argument --log, contact Nordic
    ERROR: Semiconductor and provide the generated log.log file to them.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed.

    Does it mean QSPI interface not correct?

    Best regards,

    Gavin

  • That error sounds like a more generic error with the connection between jlink and nRF52. Does any other nrfjprog command work? E.g. how about just reading internal flash of the nRF52 using nrfjprog --memrd 0

    What does it say if you call nrfjprog --version

    If you are able to read using nrfjprog --memrd 0, then it sounds to be a error of the qspi interface yes. Though you can run the qspi commands on an DK for comparison also. 

    Though you have not told me if the 'nrfjprog --qspieraseall' and 'nrfjprog --readqspi filename' did succeed.

    Best regards,
    Kenneth

  • Hi Kenneth,

    update first:

    C:\Users\Gavin>nrfjprog --version
    nrfjprog version: 10.15.2 external
    JLinkARM.dll version: 7.58b

    C:\Users\Gavin>nrfjprog --memrd 0
    ERROR: Unable to connect to a debugger.
    ERROR: JLinkARM DLL reported an error. Try again. If error condition
    ERROR: persists, run the same command again with argument --log, contact Nordic
    ERROR: Semiconductor and provide the generated log.log file to them.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed.

    'nrfjprog --qspieraseall' and 'nrfjprog --readqspi filename' both fail.

    Although this problem(Unable to connect to a debugger) occurs, Jlink is workable in SEGGER IDE.

    Is it weired?    what is the different  between jlink and nrfprog?

    Best regards,

    Gavin

  • Can you try to do a restart of your computer, and don't start up any other program on your pc, but only try to run the nrfjprog command? Are you sure you have connected both gnd, vdd, swdio and swdclk.

    Kenneth

Reply Children
No Data
Related