Main Site Documentation

[Closed]EMX: Another SD card out of order


#1

Again one of our customers who uses our custom board based on EMX have troubles. After trying to copy configuration files on the SD card, system becomes unresponsive. SD has been corrupted by?

Using MSC the SD card shows correct files except one. This file is empty. Trying to delete using windows and MSC does not returns error but after refreshing screen (using F5) the file is again on the SD. Trying to format using windows and MSC fails. Now windows says that SD is not formatted.

How can it be possible that a GHI devices corrupt an SD card like that! Our devices in the embedded world can be switch off wildely during a writing process. It seems that it can causes some errors on SD card. Ok but how to solve that?


#2

Cards are 8GB samsung EVO series µSDHC UHS-I class 10.


#3

Try to use more “low-level” software to format the SDCard.

E.g.: https://www.sdcard.org/downloads/formatter_4/


#4

This is exactly why I gave up on GHI’s SD implementation. FAT32 can get easily currupted, especially on power offs, and EMX cannot recover from that.


#5

This is really problematic and I didn’t observe such kind of failure with other devices (RaspPi, OMAP, tons of FPGA, beagleboard…). An effort has to be made to achieve a better reliability. Is there’s something we can do at software level? I am flushing after each write.
At the hardware level, it will be really a pain to redesign the board with an emergency battery to allow the end of writing process and flush the filesystem properly.


#6

FAT is guaranteed to get corrupted when writing data and power loss. This is expected and by design.


#7

@ leforban - volume must be unmounted before card is removed. This applies to anything and everything FAT.


#8

What about a recovery? When I put corrupted SD card in a PC, it kindly asks me if I want to fix it. Could EMX do that some time in the future?


#9

@ Simon from Vilnius - Windows is a very large system with all kinds of resources, so it has drivers to recovery and it maybe even a bit smarter on handling a corrupted media. This is not the case in embedded systems. While sounds simple, a recovery tool is quite complex.


#10

Well you can handle FAT on ALFAT chip very nicely, so I’m not quite convinced with that “not the case in embedded systems” :slight_smile:


#11

@ Gus - I don’t remove the card; the system is a kind of datalogger, SD is not reachable by customers and therefore not removable. But power can be switch off and this seems to be the root of this problem . In some cases (when power is switch off during a writing process), the system can not access to the SD card anymore and SD becomes corrupted.

I have tons of products that uses SD (camera, loggers, players) none of them seems to have such a problem. Maybe they are dealing with power loss detection to unmount quickly?

I can’t believe I am the only one to have this problematic


#12

Common Gus, this is not an answer, power losses exist. If by software nothing can be done (your post goes in that way), this is done by hardware? why my picture camera do not kill SD cards but the GHI based product yes? Do you have some advice?


#13

@ andre.m - correct. And that is why we have a special power loss feature in ALFAT.


#14

Knowing that this can create big issues for most of designers; why not adding a note in documentation that says SD can be corrupted by the devices if power losses are not managed…


#15

GHI could also add this note for free in the product documentation. Unexperienced designers then have the choice to subscribe for a GHI support or to design a smart power management feature. Customers have to be informed about this risk (as well as customers should be informed about known issues…)


#16

Most devices with SD card are battery powered so they can handle power off in a controlled manner. They can fail if you pull out the battery if they happen to be writing at the time. Seen it before with an Android phone but as Simon hinted, they have repair code to handle this.

The only real way for you to handle this is to do the same. Maybe just having a power fail detection circuit with enough capacitance to hold power until you stop any SD writing?

When your system uses any type of memory card, you need to design this into the system. We have the very same issue on the odd occasion with a Windows XP Embedded system where the D: drive gets corrupt if they just power off without doing a shutdown. We now have a UPS fitted as standard and teach the operator to either use START and shutdown or press the power button to shutdown.


#17

it makes sense and we have already supercaps for this purpose on new designs. However writing it in the doc does not cost anything and may help other GHI customers.


#18

This sounds also clear to me and definitely believe that this sould be added to the doc!


#19

I did not see this on https://www.ghielectronics.com/downloads/man/EMX_User_Manual.pdf