This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

QSPI does not work in quad mode on NRF52840

Hello,

I am trying to use the QSPI example from NRF SDK 17.0.2. I am using a NRF52840 dongle with W25Q32 SPI flash.
The example works with Fast Read and PP but when I try to use in quad mode (Quad read and Quad Write) it does not work.

I can see the data being transferred but i cannot seem to figure out whats the issue.

I have enabled the quad mode of W25Q32 as well by sending 0x31 0x02.

The image below shows the reset enable, reset and QSPI enable transfers. The decoding at the bottom may not be correct.

  • What data, and how are you trying to write over QSPI? Please note that all memory access by the QSPI peripheral should be word-aligned to the external memory address space, so you can only write/read in full 32-bit words. This is described in detail in section 4.3.1 in the nRF52840 product specification.

    Best regards,

    Simon

  • I am using the examples/peripheral/qspi example from the SDK.

    It works in normal SPI mode (Fast read and Page Program) But when i try in QSPI mode ( READ4O and PP4O) it does not work.

  • Did some more experiments. The example does not work when i use rand() as follows.

    for (i = 0; i < QSPI_TEST_DATA_SIZE; ++i) {
        m_buffer_tx[i] = (uint8_t)rand();
    }

    Logs:

    [22:48:43:938] <info<0xfe><info> app: QSPI write and read example using 24bit addressing mode␍␍␊
    [22:48:43:996] <info> app: QSPI example started.␍␍␊
    [22:48:43:999] <info> app: temp: 0x00␍␍␊
    [22:48:44:003] <info> app: Process of erasing first block start␍␍␊
    [22:48:44:254] <info> app: Process of writing data start␍␍␊
    [22:48:44:264] <info> app: Data read␍␍␊
    [22:48:44:264] <info> app: Compare...␍␍␊
    [22:48:44:264] <info> app: TX:␍␍␊
    [22:48:44:264] <info> app:  00 2D CF 46 29 04 B4 78|.-.F)..x␍␍␊
    [22:48:44:268] <info> app:  D8 68 A7 FF 3F 2B F1 FC|.h..?+..␍␍␊
    [22:48:44:278] <info> app:  D9 7A 96 09            |.z..    ␍␍␊
    [22:48:44:278] <info> app: ␍␍␊
    [22:48:44:278] <info> app: ␍␍␊
    [22:48:44:278] <info> app: ␍␍␊
    [22:48:44:278] <info> app: RX:␍␍␊
    [22:48:44:282] <info> app:  00 2C 46 20 44 88 86 8A|.,F D...␍␍␊
    [22:48:44:287] <info> app:  7F C3 F2 F1 0D 97 A9 6F|.......o␍␍␊
    [22:48:44:294] <info> app:  FF FF FF FF            |....    ␍␍␊
    [22:48:44:294] <info> app: Data inconsistent␍␍␊


    But if i make it a static data as follows (0xA5 is an example), then the data written and data read are consistent in Quad I/O (READ4O and PP4O).

    for (i = 0; i < QSPI_TEST_DATA_SIZE; ++i) {
        m_buffer_tx[i] = 0xA5;
    }

    Logs
    [22:50:43:719] <info<0xfe><info> app: QSPI write and read example using 24bit addressing mode␍␍␊
    [22:50:43:772] <info> app: QSPI example started.␍␍␊
    [22:50:43:779] <info> app: temp: 0x00␍␍␊
    [22:50:43:783] <info> app: Process of erasing first block start␍␍␊
    [22:50:44:033] <info> app: Process of writing data start␍␍␊
    [22:50:44:044] <info> app: Data read␍␍␊
    [22:50:44:044] <info> app: Compare...␍␍␊
    [22:50:44:044] <info> app: TX:␍␍␊
    [22:50:44:044] <info> app:  A5 A5 A5 A5 A5 A5 A5 A5|........␍␍␊
    [22:50:44:053] <info> app:  A5 A5 A5 A5            |....    ␍␍␊
    [22:50:44:053] <info> app: ␍␍␊
    [22:50:44:053] <info> app: ␍␍␊
    [22:50:44:053] <info> app: ␍␍␊
    [22:50:44:053] <info> app: RX:␍␍␊
    [22:50:44:061] <info> app:  A5 A5 A5 A5 A5 A5 A5 A5|........␍␍␊
    [22:50:44:067] <info> app:  A5 A5 A5 A5            |....    ␍␍␊
    [22:50:44:067] <info> app: Data consistent␍␍␊



  • The connection was a problem. Fixed it by resoldering!

Related