Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By piersfinlayson
#56387 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.
User avatar
By KevinA
#56390
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
User avatar
By piersfinlayson
#56405
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!
User avatar
By piersfinlayson
#56426 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