This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to handle flashwrit in an safe way.

Hi,

i need to store data in my Flash, for that i use the flashwrite example. Am i right taht i can use the remain of my application flash? So all flash = 256 kB - App = 20 kB = Flash i can use to write my Data to ?

I read that if i use flashwrite and the Softdevie, that i have to halt the Softdevie becauose of the latncy of flahswriting is that right? How can i handle this in a safe way?

Best reagrds Nils

Parents
  • Hi Nils,

    I think you're asking two things:

    (1) How to erase* and write to Flash (2) How to construct and erase a circular/ring buffer

    *I'm preempting what's coming next. IIRC, you need to erase the Flash page at least once every two write cycles.

    I would say it's reasonable to ask for support on the first question, but the second question is a bit of stretch as it's a generic programming issue. Unfortunately, I can't share our code to do it as we consider it proprietary, but there're some examples of how to do this on the Interweb. For example:

    http://www.embedded.com/electronics-blogs/embedded-round-table/4419407/The-ring-buffer

    Note: the example is a simple ring buffer, but the contents of a ring buffer itself can easily be a struct that contains your datatypes.

    -m

Reply
  • Hi Nils,

    I think you're asking two things:

    (1) How to erase* and write to Flash (2) How to construct and erase a circular/ring buffer

    *I'm preempting what's coming next. IIRC, you need to erase the Flash page at least once every two write cycles.

    I would say it's reasonable to ask for support on the first question, but the second question is a bit of stretch as it's a generic programming issue. Unfortunately, I can't share our code to do it as we consider it proprietary, but there're some examples of how to do this on the Interweb. For example:

    http://www.embedded.com/electronics-blogs/embedded-round-table/4419407/The-ring-buffer

    Note: the example is a simple ring buffer, but the contents of a ring buffer itself can easily be a struct that contains your datatypes.

    -m

Children
No Data