-->
Page 4 of 6

Re: ESP8266-100 $2.67 each

PostPosted: Tue Oct 11, 2016 3:04 pm
by piersfinlayson
I've written a simple non OS SDK test app and have confirmed I can't access any flash data address above 0x400000, no matter what value is in the upper 4 bits of byte[3] of flash. Makes me think the SDK (and possibly the ROM functions) don't actually support > 4MB access.

Re: ESP8266-100 $2.67 each

PostPosted: Tue Oct 11, 2016 4:20 pm
by KevinA
piersfinlayson wrote:I've written a simple non OS SDK test app and have confirmed I can't access any flash data address above 0x400000, no matter what value is in the upper 4 bits of byte[3] of flash. Makes me think the SDK (and possibly the ROM functions) don't actually support > 4MB access.


Must be missing something, I can't believe Wemos would build product with 16MB chips if we can't access >4MB :o

Re: ESP8266-100 $2.67 each

PostPosted: Wed Oct 12, 2016 3:26 am
by piersfinlayson
KevinA wrote:
piersfinlayson wrote:I've written a simple non OS SDK test app and have confirmed I can't access any flash data address above 0x400000, no matter what value is in the upper 4 bits of byte[3] of flash. Makes me think the SDK (and possibly the ROM functions) don't actually support > 4MB access.


Must be missing something, I can't believe Wemos would build product with 16MB chips if we can't access >4MB :o


It does seem unlikely doesn't it? I've asked on bbs.espressif.com.

I can't find any evidence on the internet anyone having successfully accessed >4MB flash from within the SDK. I have seem people who've added support to the flash tools and accessed the extra flash _externally_ - and I have this working fine. If anyone does have it working within the SDK (so from onboard the ESP8266) please let me know how!

Re: ESP8266-100 $2.67 each

PostPosted: Wed Oct 12, 2016 1:20 pm
by piersfinlayson
Espressif have replied on their bbs and showed how to access the extra flash memory.

Essentially it seems like the byte[3] stored on the flash can't be used to indicate more than 4MB to the ROM or SDK. However, there's a structure flashchip(.chip_size) which stores the size in bytes of the flash chip, so if you modify that you can access the extra space.

Their example shows you wrapping the usual spi_flash functions with routines that stores off the original value of flashchip before your operation and then restores afterwards - so presumably the SDK will barf if you have flashchip.chip_size set to > 4MB.

I'll give this a go later.

Here's the thread with espressif:

http://bbs.espressif.com/viewtopic.php?f=7&t=2865