EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Efficient datahandling in flash

Started by Henrik [6650] May 24, 2006
Hello group,

After years of development on various windows CE platforms, I am now tasked
with developing software for a new Atmel ARM7 based design.
We plan to use a serial SPI flash for datastorage, but I lack a little
understanding. We need to handle about 2MBytes of sessiondata and
systemconfig data and we need to be able to dump and modify these data on a
PC via ethernet link. Also the target unit itself need fast and easy access
to the data. If I was using Windows CE, i would have used the CE database to
store and handle all these data.
But what do people do when data resides in serial flash? Is serial flash
really what we want? Do you use any readily available databases for small
embedded systems, and if yes, which? Do you use some small flash filesystem?
And if yes, which? Do you write your own proprietary datastorage scheme. I
like the idea of a database, because of the possibility to to organize the
data into tables and let the DB worry about sorting, searching, wearleveling
etc.

I had a look on SQLite, from an advice in an earlier post, but I did not
think that it would be possible to run it on my target system as it appears
to be targeted against some PC filesystem....

Thank you for any and all inputs.

Best regards
Henrik


Henrik [6650] wrote:
> > I had a look on SQLite, from an advice in an earlier post, but I did not > think that it would be possible to run it on my target system as it appears > to be targeted against some PC filesystem.... >
There are people using SQLite in embedded devices without a filesystem. SQLite has an interchangeable OS interface that you can replace with your own code that talks to whatever kind of mass storage you want. Use the existing os_unix.c and/or os_win.c files as your guide and implement os_arm7.c (or whatever) that talks directly to flash. This is not a trivial exercise, but it is not an insurmountable barrier either. Many others have already been down the same path.
"Henrik [6650]" <not@valid.com> skrev i meddelandet
news:4474dac7$0$47029$edfadb0f@dread15.news.tele.dk...
> Hello group, > > After years of development on various windows CE platforms, I am now > tasked > with developing software for a new Atmel ARM7 based design. > We plan to use a serial SPI flash for datastorage, but I lack a little > understanding. We need to handle about 2MBytes of sessiondata and > systemconfig data and we need to be able to dump and modify these data on > a > PC via ethernet link. Also the target unit itself need fast and easy > access > to the data. If I was using Windows CE, i would have used the CE database > to > store and handle all these data.
> But what do people do when data resides in serial flash? Is serial flash > really what we want? Do you use any readily available databases for small > embedded systems, and if yes, which? Do you use some small flash > filesystem?
You can get the Dataflash File System from your local Atmel distributor, and since you are in Denmark, that would be Arrow or EBV. This will need adaption to fit the SAM7.
> And if yes, which? Do you write your own proprietary datastorage scheme. I > like the idea of a database, because of the possibility to to organize the > data into tables and let the DB worry about sorting, searching, > wearleveling > etc.
Alternatively, you can get the USB Mass Storage Adapter code from www.at91.com which runs on the AT91. If you are using an AT91SAM7 then you are likely to find SPI the fastest way to access external flash, since you do not have any external bus. Another approach allowing parallel memory would be an AT91RM9200 + 8 MB of Flash running JFFS2/Linux. This would have spare area for you database
> > I had a look on SQLite, from an advice in an earlier post, but I did not > think that it would be possible to run it on my target system as it > appears > to be targeted against some PC filesystem.... > > Thank you for any and all inputs. > > Best regards > Henrik >
-- Best Regards, Ulf Samuelsson This is intended to be my personal opinion which may, or may not be shared by my employer Atmel Nordic AB

Memfault Beyond the Launch