Support for cards greater than 2GB in size

Forum for announcements and discussion of beta firmware.

Is it worth limiting SD cards sizes to a maximum of 2GB to gain space for other features?

Yes, definitely!
5
63%
Only as a last resort.
3
38%
I don't care.
0
No votes
No! Don't do it!
0
No votes
 
Total votes: 8

Mark
Site Admin
Posts: 411
Joined: Sun Jul 28, 2013 6:47 am
Location: Brisbane, Australia

Support for cards greater than 2GB in size

Postby Mark » Tue Sep 24, 2013 2:08 pm

For anyone that doesn't already know, space is at a premium on the ATmega328P - there's only 32KB of Flash - 2KB of that is already used by the boot loader. The current firmware is pretty much at the size limit - I've been working on optimizing the code for size, but it's slow work and not very fruitful.

One of the biggest users of the remaining 30KB is the SD card library - it uses somewhere in the region of 13KB just on it's own. I'm currently looking at replacing the standard SD library with something a bit smaller - my current thoughts are to try the SDFat16 library. The obvious advantage with this library is that it's significantly smaller - using it instead should free up at least 5KB of flash allowing room for more features, etc. The main downside is that it only supports SD cards formatted with FAT16 which basically means cards that are 2GB or less in size. The other main disadvantage is that it requires others to install an extra library before they can recompile the firmware themselves.

2GB really ought to be way more than anyone should need for this purpose. I'd estimate that we're looking at around 0.5 MB per hour of logging with the current code, so 2GB should last over 5 months! The main problem is that 2GB and smaller cards are getting harder to buy and probably won't be available for too much longer.

At the moment, I'm inclined to go with the SDFat16 library, but I thought that it would be worth checking what others think:

Paul.Allen
Site Admin
Posts: 98
Joined: Tue Aug 06, 2013 5:33 am
Location: Utah, United States

Re: Support for cards greater than 2GB in size

Postby Paul.Allen » Tue Sep 24, 2013 4:01 pm

Forgive me for my Ignorance, but would it be possible to use a larger card and just only be able to access 2G of it?

Mark
Site Admin
Posts: 411
Joined: Sun Jul 28, 2013 6:47 am
Location: Brisbane, Australia

Re: Support for cards greater than 2GB in size

Postby Mark » Tue Sep 24, 2013 11:25 pm

I think that should be possible - it's more a matter of how difficult it would be to do.

I'll look into it and reply back once I've confirmed a way to do it.

JGSchubert
Posts: 25
Joined: Sun Jul 28, 2013 7:59 pm

Re: Support for cards greater than 2GB in size

Postby JGSchubert » Wed Sep 25, 2013 3:36 am

There are always ways to get older technology. Some warehouse has millions of smaller SD cards sitting there waiting for a market. Well, this is one new use for them and we should be able to find where the smaller cards are and direct USC users to where to get them.

The only other options I can think of are to drop local logging entirely and leave it to further development to add external logging devices (user upgrades?) - simply output status messages to the serial port, or drop the virtual machine implementation and go with more straightforward coding. I admit that I do not know how much space that part takes up though. If it is not much, then best leave it as it does add features and flexibility to the system.

-- Geoffrey

(Still working on the 'user guide' here... Trying to accumulate how everything works and making it look good is not so easy, but I will get it! Might do a shorter 'quick start' version also featuring just how the switches and button work together to get users started.)

Mark
Site Admin
Posts: 411
Joined: Sun Jul 28, 2013 6:47 am
Location: Brisbane, Australia

Re: Support for cards greater than 2GB in size

Postby Mark » Wed Sep 25, 2013 4:35 am

I don't think that dropping local logging is a good option - being able to log data to an SD card on board is one of the great things about this charger.

Dropping the virtual machine would probably save some space, but probably nowhere near as much as reducing support down to 2GB card sizes.

Mark
Site Admin
Posts: 411
Joined: Sun Jul 28, 2013 6:47 am
Location: Brisbane, Australia

Re: Support for cards greater than 2GB in size

Postby Mark » Wed Sep 25, 2013 5:55 am

OK, I've successfully copied a blank 2GB SD to a 4GB using an imaging tool and the 4GB card then looks like a 2GB card, so I don't think there's any real reason not to go ahead with this...

Paul.Allen
Site Admin
Posts: 98
Joined: Tue Aug 06, 2013 5:33 am
Location: Utah, United States

Re: Support for cards greater than 2GB in size

Postby Paul.Allen » Wed Sep 25, 2013 7:12 am

So if I got it correctly, the card has to be formatted or set up on the computer before it can be used in the charger?

Mark
Site Admin
Posts: 411
Joined: Sun Jul 28, 2013 6:47 am
Location: Brisbane, Australia

Re: Support for cards greater than 2GB in size

Postby Mark » Wed Sep 25, 2013 7:14 am

Yes - if I make this change and someone wants to use a card that is larger than 2GB, then they would need to reformat it using a non standard procedure.

Paul.Allen
Site Admin
Posts: 98
Joined: Tue Aug 06, 2013 5:33 am
Location: Utah, United States

Re: Support for cards greater than 2GB in size

Postby Paul.Allen » Wed Sep 25, 2013 7:30 am

Well, most people will probably keep the card and the charger paired so it would most likely be a one time deal. Sure it would be great if they didn't have to do anything, but I think the gain in space far outways the inconvenience of having to format the card.

I will look around for some 2G or less cards and try to get a bulk deal on them. Then I can offer them for cheap to those who really don't like it.

Mark
Site Admin
Posts: 411
Joined: Sun Jul 28, 2013 6:47 am
Location: Brisbane, Australia

Re: Support for cards greater than 2GB in size

Postby Mark » Wed Sep 25, 2013 8:08 am

Sounds like a good plan!

If you can only get 4GB cards, you could just get a heap of them and reformat them as 2GB for those that can't do it themselves. Would only take a few seconds to do each card...


Return to “Beta Testers”

Who is online

Users browsing this forum: No registered users and 1 guest