Git Product home page Git Product logo

Comments (3)

q2dg avatar q2dg commented on July 26, 2024

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.

cmaglie avatar cmaglie commented on July 26, 2024

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.

q2dg avatar q2dg commented on July 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.