Comments (3)
Ooh, I see...PROGMEM is only valid in AVR, so this library would be like a "replacement" of this feature, isn t?
Sorry for bothering you
from flashstorage.
Ooh, I see...PROGMEM is only valid in AVR, so this library would be like a "replacement" of this feature, isn t?
Well not exactly.
The equivalent of PROGMEM for ARM is to just declare data as static const
, since ARM Cortex-M has a flat addressing space and you can access flash memory directly, you don't need to pass through all the pgmspace.h
mess like on AVR.
const char flash_string[] = "Hello!"; // <-- On 32-bit ARM Cortex this is stored in Flash
void loop() {
Serial.println(flash_string);
}
This is far easier compared to AVRs!
On the other hand most Cortex-M based CPU doesn't provide an EEPROM (well, some chip-maker may have some CPU models with it, but from my experience it's not so common) so this library is aimed to be an alternative to EEPROM (in fact allows you to change the content of the data stored in flash).
Of course this library shows also the limits of a Flash memory compared to an EEPROM:
- Flash memory must be written in "pages" and those pages must be erased before write: if you need to change just 1 byte you must erase + write a block of 256 bytes (a page) while with an EEPROM you can just write 1 byte.
- Flash memory wears out quickly compared to an EEPROM: a typical flash memory can perform between 20k..50k erase cycles before starting to lose ability to retain data, an EEPROM can do 10x that.
from flashstorage.
Oooh, I see! Thanks a lot for your explanation! Maybe it should be placed in README.md, as it clears several doubts other people could also have. Thanks!
from flashstorage.
Related Issues (20)
- EEPROM storage allocated even though it is not used HOT 3
- 16 bit ?
- 840 byte struct can crash function ?
- You can adjust the linker script to avoid overwriting EEPROM HOT 1
- Any chance to port to nRF52840? HOT 4
- SAMD51 NVM cache disable before write HOT 2
- EEPROM on nano-33 is complicated HOT 1
- Data Types for millis() HOT 1
- doubles and floats are no longer the same HOT 1
- Compile error for feather m4 HOT 1
- FlashAsEEROM weird issues HOT 13
- typo , should be SR but wrote CR HOT 3
- Are you sure about the 10K write cycles?
- A lot of errors while compiling FlashStoreAnd Retrieve HOT 1
- Arduino Nano 33 BLE listed as compatible on Arduino's website HOT 1
- Updating value inside struct.
- erase() fails if FlashClass::flash_size > ROW_SIZE
- trying to write/read a string (variable length) to persistent storage on Nano 33 IOT HOT 3
- Either Initilizing, Writing or Reading a String from Flash Storage bricks Seeeduino XIAO. HOT 1
- DO NOT USE IT ON ANTHING WITH BOOTLOADER AND Serial USB ARDUINO BOARDS
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flashstorage.