Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By brutzler
#26207 OK,
will try your example later on.

Talking about the other idea. How can i write/read a byte into flash?
I have searched a little bit, and seen in the flash_utils.h there is some SPIRead, SPIWrite....
Is this the right way?

Edit:
Looks like spi_flash_read and spi_flash_write are my friends.
Just struggling with them (partial success)
User avatar
By brutzler
#26242 OK, nice to know.
Found this library, but thought this is only for EEPROM. Even cause the examples are the same as in the "normal" Arduino EEPROM library.

But looks not so trivial on the first steps.
e.g. EEPROM.read (0x6b000) doesn't read the expected memory area. (I can verify this, because I already had success with "spi_flash_read(0x6b000, (uint32*)buf, buflen)"
looking at the Library I see this:
Code: Select alluint8_t EEPROMClass::read(int address)

If address is only an int, I will never be able to readout 0x6b000.
Certainly a thought-error on my side :?
User avatar
By martinayotte
#26264 The address that you provide is an offset to a base address, not an absolute address.
The reference doc http://arduino.esp8266.com/staging/doc/reference.html mentioned that EEPROM emulation is storing its data in its own area :

Code: Select allEEPROM library uses one sector of flash located at 0x7b000 for storage.


Code: Select all|--------------|-------|---------------|--|--|--|--|--|
^              ^       ^               ^     ^
Sketch    OTA update   File system   EEPROM  WiFi config (SDK)