External Flash Interface on HSPI, Garbage data read issue
Posted: Tue Sep 12, 2017 12:16 pm
Hello,
I have interfaced flash chip (Windbond's W25Q128FV) on HSPI interface with wrover kit. I am facing one issue with IDFv2.1 while reading the data from external flash, while this issue is not produced in IDFv2.0.
[*]The issue is that on each read command I get extra 3 bytes with 0 value before actual data.
[*]For example on reading data from address 0x000000 of the flash having first 5 bytes of data as {0x01,0x02,0x03,0x04,0x05}.
so, while reading 5 bytes from 0x000000 with flash read command(0x03), I get data in spi_transaction_t rx_buffer as { 0x00,0x00,0x00,0x01,0x02}.
[*]If I read 7 bytes then I get data as {0x00,0x00,0x00,0x01,0x02,0x03,0x04}.
[*]In short I get data {0x00,0x00,0x00}, first 3 bytes as extra dummy bytes with IDFv2.1 only. This is not with the case for IDFv2.0, in v2.0 this works perfectly. I get first 5 bytes read as {0x01,0x02,0x03,0x04,0x05} in IDFv2.0.
My configurations are as below,
esp_err_t ret;
spi_device_handle_t spi;
spi_bus_config_t buscfg={
.miso_io_num=12,
.mosi_io_num=13,
.sclk_io_num=14,
.quadwp_io_num=-1,
.quadhd_io_num=-1,
.max_transfer_sz=0, //comment out this line for IDFv2.0
};
spi_device_interface_config_t devcfg={
.clock_speed_hz=800000,
.mode=0,
.spics_io_num=5,
.queue_size=7,
.flags=SPI_DEVICE_HALFDUPLEX,
};
ret=spi_bus_initialize(HSPI_HOST, &buscfg, 1);
assert(ret==ESP_OK);
ret=spi_bus_add_device(HSPI_HOST, &devcfg, &spi);
assert(ret==ESP_OK);
Is there required to change any configurations for IDFv2.1..? Hope I have given understandable explanation of the issue.
Thanks.
I have interfaced flash chip (Windbond's W25Q128FV) on HSPI interface with wrover kit. I am facing one issue with IDFv2.1 while reading the data from external flash, while this issue is not produced in IDFv2.0.
[*]The issue is that on each read command I get extra 3 bytes with 0 value before actual data.
[*]For example on reading data from address 0x000000 of the flash having first 5 bytes of data as {0x01,0x02,0x03,0x04,0x05}.
so, while reading 5 bytes from 0x000000 with flash read command(0x03), I get data in spi_transaction_t rx_buffer as { 0x00,0x00,0x00,0x01,0x02}.
[*]If I read 7 bytes then I get data as {0x00,0x00,0x00,0x01,0x02,0x03,0x04}.
[*]In short I get data {0x00,0x00,0x00}, first 3 bytes as extra dummy bytes with IDFv2.1 only. This is not with the case for IDFv2.0, in v2.0 this works perfectly. I get first 5 bytes read as {0x01,0x02,0x03,0x04,0x05} in IDFv2.0.
My configurations are as below,
esp_err_t ret;
spi_device_handle_t spi;
spi_bus_config_t buscfg={
.miso_io_num=12,
.mosi_io_num=13,
.sclk_io_num=14,
.quadwp_io_num=-1,
.quadhd_io_num=-1,
.max_transfer_sz=0, //comment out this line for IDFv2.0
};
spi_device_interface_config_t devcfg={
.clock_speed_hz=800000,
.mode=0,
.spics_io_num=5,
.queue_size=7,
.flags=SPI_DEVICE_HALFDUPLEX,
};
ret=spi_bus_initialize(HSPI_HOST, &buscfg, 1);
assert(ret==ESP_OK);
ret=spi_bus_add_device(HSPI_HOST, &devcfg, &spi);
assert(ret==ESP_OK);
Is there required to change any configurations for IDFv2.1..? Hope I have given understandable explanation of the issue.
Thanks.