Occasional SD card: ERROR: Unable to write file : INT_ERR #220
Replies: 7 comments
-
Posted at 2014-02-15 by @gfwilliams There isn't a way to tell if there has been an error I'm afraid. A return value could be good though... Have you tried using the absolute latest from http://www.espruino.com/binaries/git/commit_date/? I recently updated to a more recent filesystem library and rewrote bits of the SPI interface, so you might find that it fixes your problems. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-02-16 by dprime At the moment I'm using the Espruino to do some long term logging tests, using the serial port rather than the SD card. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-02-23 by dprime My second Espruino arrived on Friday, so I've had a chance to do some more testing. I see this problem on two different Espruino's and two SDcards (although both SDcards are the same make , Kingston 8GB). If I run the following test program which simulates the type of logging I've been doing:
On Espruino running v1.50, I see the occasional INT_ERR, often two in a row on average 1 in every 100 writes. The log file on the SD card is missing the line logged:
On Espruino v1.52, the errors are still there but the error type and pattern has changed. Now I see bursts of around 10 consecutive DISK_ERR. Again, the log file on the SD card is missing the lines logged:
I think the problem seems to be a little worse when I run PWM outputs, onewire temperature probes and serial output. I did wonder if the problem is related to electrical noise or maybe a problem with interrupts. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-02-24 by @gfwilliams It could be interrupts I guess (especially on Serial IO). SPI is a little frustrating in that the hardware output buffer is effectively 2 bytes but the input buffer is 0ne byte, so it's amazingly easy to lose a byte if you don't service SPI immediately. However that's unlikely to be the problem, as you should get an You could also try calling |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-02-24 by DrAzzy Is there a way to determine when this has failed, so, we could, for example, automatically retry writing it? I will run into this issue pretty soon in my project. I need to be able to make sure that the data I'm logging is being recorded. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-02-25 by @gfwilliams I could make it return a boolean value I guess - that would be the easiest way to check... I'd really like to try and find the root of the problem though ;) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-02-25 by dprime Hi Gordon, I've doing a full format (FAT32) to the cards between each test to ensure they start off in a known state. I just ran the test overnight, setting the SPI speed to a lower bit rate after the initial write as you suggested. The problem is still there and I have more of an idea of how often it occurs... The results:
That means bursts of errors happen about every 1000 writes and on average every 72 writes. Although I have several SD cards, they're only one type (Kingston, 8GB, Class4). Is there anyone who has a different type of card that could run the test listed in post number 4? You will need to run the test for at least a couple of hours to be reasonably sure of encountering the problem. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2014-02-15 by dprime
I'm writing some code to do some logging of data to the SD card and am seeing occasional errors when calling appendFileSync(), 2 writes out of 160 in a recent run.
The error is: "ERROR: Unable to write file : INT_ERR"
The appendFileSync() doesn't return a value to tell me programatically whether the operation succeeded or not. Is there any other way to tell if appendFileSync() encountered an error?
Beta Was this translation helpful? Give feedback.
All reactions