ESP8266 Developer Zone The Official ESP8266 Forum 2015-09-13T18:01:55+08:00 https://bbs.espressif.com:443/feed.php?f=65&t=667 2015-09-13T18:01:55+08:00 2015-09-13T18:01:55+08:00 https://bbs.espressif.com:443/viewtopic.php?t=667&p=3677#p3677 <![CDATA[Re: Reading FLASH arrays?]]> Statistics: Posted by eriksl — Sun Sep 13, 2015 6:01 pm


]]>
2015-07-04T15:06:34+08:00 2015-07-04T15:06:34+08:00 https://bbs.espressif.com:443/viewtopic.php?t=667&p=2491#p2491 <![CDATA[Re: Reading FLASH arrays?]]> Statistics: Posted by scargill — Sat Jul 04, 2015 3:06 pm


]]>
2015-07-01T17:04:36+08:00 2015-07-01T17:04:36+08:00 https://bbs.espressif.com:443/viewtopic.php?t=667&p=2461#p2461 <![CDATA[Re: Reading FLASH arrays?]]>
static const uint32_t petes[] ICACHE_RODATA_ATTR = {
55,45,66,77,88,12,76,23,45,67,34,65,25,74,234,67,3,643,646,
55,45,66,77,88,12,76,23,45,67,34,65,25,74,234,67,3,643,646,
55,45,66,77,88,12,76,23,45,67,34,65,25,74,234,67,3,643,646};

iprintf is just a macro for a normal printf function...

iprintf("Data= %ld",petes[37]);

Immediate reboot....

Ideas?

Statistics: Posted by scargill — Wed Jul 01, 2015 5:04 pm


]]>
2015-07-01T10:31:26+08:00 2015-07-01T10:31:26+08:00 https://bbs.espressif.com:443/viewtopic.php?t=667&p=2451#p2451 <![CDATA[Re: Reading FLASH arrays?]]>

Code:

static const char XXXX[] ICACHE_RODATA_ATTR = { ........ }


Flash is 4 bytes aligned, so your array has to be "uinit32" , read and write every 4 bytes.

Statistics: Posted by Guest — Wed Jul 01, 2015 10:31 am


]]>
2015-07-01T08:15:13+08:00 2015-07-01T08:15:13+08:00 https://bbs.espressif.com:443/viewtopic.php?t=667&p=2447#p2447 <![CDATA[Reading FLASH arrays?]]>
As a pseudo example (which clearly is fictional)

uint8_t fred[10]={ 1,2,3,4,5,6,7,8,9,10 }

a=fred[6];

but any array I've seen - event with CONST written all over it, still ends up using RAM! what C code would we need in order to create and access a similar array that never leaves FLASH and could hence be quite big.

??

Pete.

p.s. clarly it can be done - as there are routines in the SDK (and TUANPM wrote some) to store information in FLASH and bring it back... but it would be nice if somehow one could make something simple that doesn't involve knowing the exact location of the array in FLASH beforehand.

Statistics: Posted by scargill — Wed Jul 01, 2015 8:15 am


]]>