ESP8266 Developer Zone The Official ESP8266 Forum 2016-07-19T16:31:56+08:00 https://bbs.espressif.com:443/feed.php?f=6&t=2439 2016-07-19T16:31:56+08:00 2016-07-19T16:31:56+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2439&p=8023#p8023 <![CDATA[Re: SPI flash. 64 bytes read hangs.]]>
pratik wrote:
Hello,

I will forward the issue to engineers.
Meanwhile, let me know which flash chip you are using (part number).


I'm not sure what flash chip part number. I use ESP-12E module from AI-Thinker.

Code:

> esptool.py flash_id
Connecting...
Manufacturer: e0
Device: 4016

The Internet says BergMicro 25q32A is used as a flash memory chip in ESP-12E.

pratik wrote:
What is your test address? Is it properly boundary-aligned?


My test address is 0x200000.
I can read and write from/to it just fine.
I don't think boundary-alignment is necessary for reading. For writing the page boundary should not be crossed but for reading it is irrelevant as far as I understand.

Best regards

Statistics: Posted by shein — Tue Jul 19, 2016 4:31 pm


]]>
2016-07-18T19:22:24+08:00 2016-07-18T19:22:24+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2439&p=8007#p8007 <![CDATA[Re: SPI flash. 64 bytes read hangs.]]>
I will forward the issue to engineers.
Meanwhile, let me know which flash chip you are using (part number).
What is your test address? Is it properly boundary-aligned?

Statistics: Posted by Guest — Mon Jul 18, 2016 7:22 pm


]]>
2016-07-18T15:19:04+08:00 2016-07-18T15:19:04+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2439&p=8004#p8004 <![CDATA[Re: SPI flash. 64 bytes read hangs.]]>
pratik wrote:
So you faced the same issue with the SDK as well? Which SDK version were you using?

I use esp-open-rtos, it's based on the last RTOS SDK that was MIT licensed.
But I specifically created stripped example to show that the problem is not SDK dependent.

Statistics: Posted by shein — Mon Jul 18, 2016 3:19 pm


]]>
2016-07-18T12:31:28+08:00 2016-07-18T12:31:28+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2439&p=8003#p8003 <![CDATA[Re: SPI flash. 64 bytes read hangs.]]> Statistics: Posted by Guest — Mon Jul 18, 2016 12:31 pm


]]>
2016-07-17T16:27:38+08:00 2016-07-17T16:27:38+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2439&p=7997#p7997 <![CDATA[Re: SPI flash. 64 bytes read hangs.]]>
The reading of 64 bytes block fails in every possible way. I tried it without writing with the same result.
And yes, I used serial output to pin point the place that hangs.

Originally I stumbled upon this issue when I was developing inside an SDK, and my module immediately resets after hang due to WDT.
But without any SDK, I assume WDT is not initialised and the chip simply hangs.

Statistics: Posted by shein — Sun Jul 17, 2016 4:27 pm


]]>
2016-07-16T23:20:09+08:00 2016-07-16T23:20:09+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2439&p=7991#p7991 <![CDATA[Re: SPI flash. 64 bytes read hangs.]]>
Does the reading fail if you try to power up and just perform a read operation?
See if inserting a small delay after the write operation helps resolve this error.

Also, how do you know where the code is getting stuck? Posting the UART log will help as well. Things getting stuck should usually cause a WDT reset.

Statistics: Posted by Guest — Sat Jul 16, 2016 11:20 pm


]]>
2016-07-16T22:06:06+08:00 2016-07-16T22:06:06+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2439&p=7990#p7990 <![CDATA[SPI flash. 64 bytes read hangs.]]>
I use only SPI registers to read/write flash and experience strange problem.
64 bytes write works fine, but 64 bytes read hangs.

There're 16 SPI data registers, each register is 32 bit. (W0-W15)
So, it seems like I should be able to read/write 64 bytes blocks of data.
For writing it is the case. I can write up to 64 byte block at a time. And can verify that operation is successful.
But reading works up to 63 bytes block. If attempt to read 64 bytes block system hangs.

Code:

 
    int i;
    uint32_t buf[16];

    SPI(0).ADDR = TEST_ADDR | (64 << 24);
    SPI(0).CMD = SPI_CMD_READ;

    while (SPI(0).CMD) {};   // operation never ends, loop forever

    for (i = 0; i < 16; i++) {
        buf[i] = SPI(0).W[i];
    }
   


There's a sample project that demonstrates this problem https://github.com/sheinz/esp-spi-flash-test
It doesn't use any SDK libraries.

Thanks.

Statistics: Posted by shein — Sat Jul 16, 2016 10:06 pm


]]>