Abrupt power loss, now bricked

Started by seulater, September 01, 2014, 05:11:36 PM

Previous topic - Next topic

seulater

I have read here and there that improper shutdown can cause the uSD card to get corrupted causing the device not to be able to boot up again. I don't know if this applies to nand flash as well. I am new to embedded Linux and need to get this sorted out before I keep going down this so far wonderful new road.

In other words lets say  I created a headless product that controls a doorway latch. It had an RF ID tag reader to let people in and out. A storm comes through and the power goes out. Since my device did not have time to properly shutdown do I run the risk of it not starting back up when the power comes back on because the storage media got corrupted ? I dont mind if I had say log files open that got corrupted, I just need to make sure the system will boot back up again. I can't have a bricked unit.

If this is true, is there a way around this other than using a UPS or battery ?
I would think there just has to be. Who would sell a product knowing that it could be bricked because either the user yanked the battery while it was on, or did not install it on a UPS. Would any of you pay thousands of dollars for a 60" TV that had the risk of not starting back up because the power glitched. Most of us do not have our TV on a ups.

With these thoughts in mind what are these manufacturers doing to keep their product from being bricked.


kantal

Hi!

I think that an OLIMEX board itself are not considered security product.
Such a board would be only part of your product. You have to add the other necessary components.
E.g. a small LIPO battery, and write software to check the voltage and make shutdown if it is low, etc.

JohnS

I think the reason things can be corrupted are things like failing to choose a file system which avoids that - usually because the intended use doesn't need what you want.

You can't brick an Allwinner chip in that scenario because they have FEL mode - see the linux-sunxi.org site.

I expect you'd want to use a suitable file system (and avoid writing to NAND) but also the LiPo battery sounds a plausible way to go and the usual things engineers do to avoid or deal with the sorts of problems you feel you may have.

John

seulater

Quote from: JohnS on September 01, 2014, 08:43:03 PM
You can't brick an Allwinner chip in that scenario because they have FEL mode - see the linux-sunxi.org site.

I used the term bricked a little to loose here. I meant it in the sense that when the power comes back on the storage device is corrupt and not the system cannot boot back up.



JohnS


seulater

Quote from: JohnS on September 01, 2014, 10:25:10 PM
See the rest of my post.

John

Hi, John.  I did. you said "... use a suitable file system" which honestly Is unclear to me. Aren't my options only uSD and nand flash ?  Can you clarify what you meant please.

I understand that placing a battery will solve the issue. But I am trying to understand how others are able to prevent the problem. For instance how does android phone manuf. get around this problem ?  I am sure with all the phones out there, there has been many times a user has yanked the battery while the phone was still on. Yet you never read or hear anything about if you do that your phone might become useless and never turn back on.

JohnS

You do hear of tablets getting corrupted and being factory restored.  That's what FEL mode allows, as an example.  I've no idea which if any phones use these very cheap processors but many tablets do,

Google will let you read up on file systems.

John

seulater

Quote from: JohnS on September 02, 2014, 01:37:25 AM
You do hear of tablets getting corrupted and being factory restored.  That's what FEL mode allows, as an example.  I've no idea which if any phones use these very cheap processors but many tablets do,

Google will let you read up on file systems.

John

Its not what processor is used is the issue, It's the media in which they use to load the OS with.

JohnS

Well have it your own way but what I meant is clear: a suitable FS is needed and may well be an automatic choice on phones.

John

dave-at-axon

Android seems to be a little more reliable in this matter. I've had an Olimex A20 now for about 6 months with Android in NAND and I've powered off a few times (this will be remotely located so has to work like this) and so far it seems very stable and I've not seen any issues with corruption of the filing system.

I do agree with your that there must be a solution as there are many Linux devices out there such as my Set-top box that runs it and there is no power off function. You just switch it off. With the poor power here that has happened a few times and it still works.

PS.. Are you the same GHI Forum user who is dabbling with Linux (there was a mention of it recently) and your username seems to cross reference via other forums.

Regards
Dave McL. :)

seulater

#10
Yes, that was I at GHI. Now that I have finally decided to bear down and learn Embedded Linux it blows my mind how much more I can do, and do it far better with it compared to using a say an 'ole Atmega or ST micro. They have their place don't get me wrong. However my projects are continuing to grow outside their capabilities.

I just have to resolve this one issue about the power before i can use it in a commercial application.

Now that you mention set-top box. I have 3 Roku boxes here in the house. They do not have a power switch on them either. Might have to crack one open to see if there is a battery inside it. If not, then I am back to wondering how this is done. I cannot imaging a company like Roku who is making millions of these things taking the chance that a power outage will wipe out their box.

EDIT: I took apart the Roku box. it has a Broadcom CPU, Samsung K4B2G1646C-HCH9 DRAM & Toshiba TC58NVG1S3ETA00 EEProm.