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

qspi write more then 16 byte gets scrambled after 18 byte

hello Nordic 

i work with nrf52840, SDK16.0 S140

i use QSPI for writing to an external flash (IS25LP064A)

if i write 16 bytes then its all ok but if i try to write more then i don't get the values i put after the 18 byte 

i tried first with 240, then 24, then 16, then 20 (all aligned sizes).

here how i init the QSPI:

 uint32_t err_code = 0;
    nrfx_qspi_config_t config = NRFX_QSPI_DEFAULT_CONFIG;

    config.prot_if.readoc   = NRF_QSPI_READOC_READ2IO; //NRF_QSPI_READOC_FASTREAD;
    config.prot_if.writeoc  = NRF_QSPI_WRITEOC_PP;
    config.prot_if.addrmode = NRF_QSPI_ADDRMODE_24BIT;
     
    config.pins.sck_pin = FLASH_MEM_SPI_CLK;  //19;
    config.pins.csn_pin = FLASH_MEM_SPI_CS;   //17;
    config.pins.io0_pin = FLASH_MEM_SPI_MOSI; //20;
    config.pins.io1_pin = FLASH_MEM_SPI_MISO; //21;
    config.pins.io2_pin = NRF_QSPI_PIN_NOT_CONNECTED;
    config.pins.io3_pin = NRF_QSPI_PIN_NOT_CONNECTED;
    
    config.phy_if.sck_freq = NRF_QSPI_FREQ_32MDIV1; 

    err_code = nrfx_qspi_init(&config, qspi_handler, NULL);
    APP_ERROR_CHECK(err_code);

    configure_memory();     
    External_flash_erase();

    for( uint8_t i = 0; i < 240; i++)
    {
        syntetic_240_buff[i] = i;
    }

this is the configuration commands for the flash:

and here is my write command:

err_code = nrfx_qspi_write(syntetic_240_buff, AUDIO_BUFF_SIZE, audio_address_mark);
audio_address_mark += AUDIO_BUFF_SIZE;

any ideas what causes this ?

hope to read from you soon

best regards

Ziv

Parents
  • well after debugging this with an oscilloscope i found out that the data was actually transmitted ok but in read i found it hard to understand what's going on .. i used this command to read, so its 2 ios:

    NRF_QSPI_READOC_READ2IO  = QSPI_IFCONFIG0_READOC_READ2IO,  /**< Dual data line SPI. READ2IO (opcode 0xBB). */

    when i changed it to this command (slower probably since using only one line):

    PI_READOC_FASTREAD = QSPI_IFCONFIG0_READOC_FASTREAD, /**< Single data line SPI. FAST_READ (opcode 0x0B). */

    then it all works fine 

    so is this some Nordic bug in reading the data from dual ios or did i had to use some different configuration for the external flash or the qspi to be able to work with dual lines for read operation ?

    this is a photo describing the data transfer on 2 ios according to external flash data sheet:

    hope to read from you soon

    best regards

    Ziv

Reply
  • well after debugging this with an oscilloscope i found out that the data was actually transmitted ok but in read i found it hard to understand what's going on .. i used this command to read, so its 2 ios:

    NRF_QSPI_READOC_READ2IO  = QSPI_IFCONFIG0_READOC_READ2IO,  /**< Dual data line SPI. READ2IO (opcode 0xBB). */

    when i changed it to this command (slower probably since using only one line):

    PI_READOC_FASTREAD = QSPI_IFCONFIG0_READOC_FASTREAD, /**< Single data line SPI. FAST_READ (opcode 0x0B). */

    then it all works fine 

    so is this some Nordic bug in reading the data from dual ios or did i had to use some different configuration for the external flash or the qspi to be able to work with dual lines for read operation ?

    this is a photo describing the data transfer on 2 ios according to external flash data sheet:

    hope to read from you soon

    best regards

    Ziv

Children
No Data
Related