E Amazings
  • Home
  • Automotive
  • Business
  • CBD
  • Crypto
  • Education
  • Entertainment
  • Fashion
  • Finance
  • Health
  • Home Improvement
  • Law \ Legal
  • News
  • Shopping
  • Sports
  • Technology
  • Travel

Subscribe to Updates

Get the latest creative news from FooBar about art, design and business.

What's Hot

Apple AirPods Pro 2 likely to come with USB Type-C charging case

July 4, 2022

Fighting All That Can Go Wrong With Resin

July 4, 2022

NFT, BTC Scams Featured on British Army’s Compromised Twitter, YouTube Accounts

July 4, 2022
Facebook Twitter Instagram
E Amazings
  • Home
  • Automotive
  • Business
  • CBD
  • Crypto
  • Education
  • Entertainment
  • Fashion
  • Finance
  • Health
  • Home Improvement
  • Law \ Legal
  • News
  • Shopping
  • Sports
  • Technology
  • Travel
Facebook Twitter Instagram
E Amazings
You are at:Home»Technology»Kved: An Embeddable Key/Value Datastore
Technology

Kved: An Embeddable Key/Value Datastore

Paul EasterBy Paul EasterJune 14, 2022No Comments2 Mins Read
Facebook Twitter Pinterest LinkedIn Tumblr Email
Share
Facebook Twitter Pinterest WhatsApp Email


At some point when developing embedded applications, you’re going to want to store unique values in non-volatile memory, values that can’t be fixed at compilation time. Many microcontrollers have a small amount of EEPROM memory for this very purpose, but it’s usually rather limited if it’s provided at all. Even if you do have a bit of space on an EEPROM at your disposal, actually formatting your values into the memory and dealing with the pesky problem of wear leveling (necessary for parameters that need to change often) can be a bit of a hassle.

Lucky for us, [Marcelo Barros] decided to share his own implementation, Kved (key/value database) which uses the flash memory instead for such storage. Kved implements a dictionary type data structure, using numeric keys and values, supporting a few integer types. Using the library should be straightforward enough, as [Marcelo] says, all you need are a pair of spare flash sectors and the ability to port the flash the sector read, write, and erase functions. There are plenty of examples of such code available for practically any microcontroller out there, so that should be no barrier. For those who want to play with it right now, the repo currently has ports for the STM32L433RC and STM32F411CE, as well as a simulated version you can compile and run on your computer.

From an implementation perspective, the write algorithm uses a COW (Copy On Write) method. Changed values are invalidated by over-writing the storage location with all-zeros, and re-writing the changed value to a new location, cycling through the unused locations until the sector is full. Data-integrity mechanisms are implemented, preventing corruption of the data structure due to power fail situations, so incorrectly written values will be corrected on start-up and not affect the integrity of the configuration.

When looking around, we found a similar project, Embedis, over on hackaday.IO, as well as this article on the subject of embedded filesystems from a little while back.



Source link

Paul Easter

Related Posts

Fighting All That Can Go Wrong With Resin

By Paul EasterJuly 4, 2022

Think You Know How Mario Kart Works?

By Paul EasterJuly 4, 2022

Dithering Makes Everything Cooler: Now Even Animated

By Paul EasterJuly 4, 2022

Moteus Open Source BLDC Controller Gets Major Upgrade

By Paul EasterJuly 4, 2022
Add A Comment

Comments are closed.

Our Picks

Apple AirPods Pro 2 likely to come with USB Type-C charging case

By Paul EasterJuly 4, 2022

Fighting All That Can Go Wrong With Resin

By Paul EasterJuly 4, 2022

NFT, BTC Scams Featured on British Army’s Compromised Twitter, YouTube Accounts

By Paul EasterJuly 4, 2022
Recent Posts
  • Apple AirPods Pro 2 likely to come with USB Type-C charging case July 4, 2022
  • Fighting All That Can Go Wrong With Resin July 4, 2022
  • NFT, BTC Scams Featured on British Army’s Compromised Twitter, YouTube Accounts July 4, 2022
  • Akasa Air showcases crew uniform; conducts proving flight test July 4, 2022
  • Air India alerts people about hoax communication; link offering Rs 6000, fake, says company July 4, 2022
  • Will recession hit Indian shores in six months? Zee Business Managing Editor Anil Singhvi decodes July 4, 2022
  • Ethereum Name Service Sells for Second-Highest Price Ever of 300 ETH July 4, 2022
Archives
  • July 2022
  • June 2022
Facebook Twitter Instagram Pinterest TikTok
  • Home
© 2022 E Amazings - All Rights Reserved.

Type above and press Enter to search. Press Esc to cancel.