spi_flash_read fails above 512K for a 4M flash

sake402
Posts: 7
Joined: Fri Sep 30, 2016 6:18 am

spi_flash_read fails above 512K for a 4M flash

Postby sake402 » Sat Oct 01, 2016 1:36 am

I have an ESP12.

Reading flash below 512k is successful, but not above.

I confirmed that the flash is 4M with esp_tool

Code: Select all

esptool.py v1.2-dev
Connecting...
Manufacturer: ef
Device: 4016


And I successfully loaded a 128KBytes spiff binary at address 0x3D7000

Code: Select all

esptool.py --port COM1 write_flash 0x3D7000 output/data.bin
esptool.py v1.2-dev
Connecting...
Running Cesanta flasher stub...
Writing 131072 @ 0x3d7000... 0 (0 %)
Wrote 131072 bytes at 0x3d7000 in 11.7 seconds (89.7 kbit/s)...
Leaving...


But in the code, attempting to read the spiff binary fails

Code: Select all

SPIFF: Reading flash address: 0x3d70fe size: 2
SPIFF: Reading flash fails @ address 0x3d70fc


I am using the RTOS SDK

pratik

Re: spi_flash_read fails above 512K for a 4M flash

Postby pratik » Sat Oct 01, 2016 11:12 am

SPIFF: Reading flash address: 0x3d70fe size: 2

What does the size:2 mean in your log? Does it mean you are reading 2 bytes?

sake402
Posts: 7
Joined: Fri Sep 30, 2016 6:18 am

Re: spi_flash_read fails above 512K for a 4M flash

Postby sake402 » Sun Oct 02, 2016 4:24 am

Yes

And the second line means the address is adjusted to 4 byte alignment before reading

pratik

Re: spi_flash_read fails above 512K for a 4M flash

Postby pratik » Sun Oct 02, 2016 12:01 pm

Not sure what function is accessing the flash, so cannot exactly say, but you should probably try reading in multiples of 4 bytes as well. Like for 2 bytes, read 4 and use first 2 bytes, don't just read two.
That might solve your issue.

sake402
Posts: 7
Joined: Fri Sep 30, 2016 6:18 am

Re: spi_flash_read fails above 512K for a 4M flash

Postby sake402 » Tue Oct 04, 2016 4:47 am

Yes.
I never read two byte. If you check the log again you 'll notice FE was warped to FC in order to read four bytes.

Who is online

Users browsing this forum: No registered users and 3 guests