"Memory card error" for some SD cards

  • 53 Replies
  • 8051 Views
*

Offline alvm

  • ***
  • 123
"Memory card error" for some SD cards
« on: 22 / November / 2014, 15:35:54 »
Advertisements
Hello,

For some SD cards "Memory card error" message appears after shooting when using AC adapter. If battery using shooting is fine. I've found the string in dump but there aren't any links to it. So does anabody know how can I track a chain to the string  or, better, what is cause of the error?

ShowSDStatus return SD Exist, SD not protect.

Thanks,
Alex.
« Last Edit: 22 / November / 2014, 15:37:44 by alvm »

Re: "Memory card error" for some SD cards
« Reply #1 on: 22 / November / 2014, 15:57:29 »
I'm not sure that tracking strings in the source code is going to do you much good.

If you are getting that sort of error using an AC adapter but not when using batteries,  it suggests a problem with the AC adapter. 

Are you using a genuine Canon product?  (and which camera do you have?)

If it's a homebrew or cheap Chinese clone from eBay then it's quite possible that it does not provide enough current during the card write operation (causing the voltage to "droop" and the card write to fail).

Also, does the resulting image save properly to the SD card?  Or is it corrupted?  Or is it not there at all?
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline alvm

  • ***
  • 123
Re: "Memory card error" for some SD cards
« Reply #2 on: 22 / November / 2014, 16:11:05 »
If you are getting that sort of error using an AC adapter but not when using batteries,  it suggests a problem with the AC adapter. 

If it's a homebrew or cheap Chinese clone from eBay then it's quite possible that it does not provide enough current during the card write operation (causing the voltage to "droop" and the card write to fail).

Yes, I think so too but a camera works fine without chdk.

Are you using a genuine Canon product?  (and which camera do you have?)

The problem appeared for IXUS145 and repeated for SX520.

Also, does the resulting image save properly to the SD card?  Or is it corrupted?  Or is it not there at all?

There aren't at all even camera log.

I've tried five SD cards and only one works fine.

Re: "Memory card error" for some SD cards
« Reply #3 on: 22 / November / 2014, 16:36:02 »
Yes, I think so too but a camera works fine without chdk.
Hmmm ... camera power circuitry is pretty simple. AFAIK the code has no way to know if it's running on battery or A/C power. 

However,  there is one "dirty little CHDK secret" that I'd planned to study this week related to battery voltage. There is a theory that when CHDK loads, it accidentally sets the minimum battery shutdown voltage for the camera to a higher value than normal.  This is because CHDK is sneaking in via a hacked "firmware update" method (in both boot methods) and this causes the cameras to set a higher shutdown voltage (to protect against weak batteries expiring during a real firmware update and potentially "bricking" the cameras).  If your power supply is "weak" then you could be triggering this in CHDK mode and just squeaking by without CHDK loaded.

Edit : see Battery shutdown voltages with CHDK and without CHDK

More to come on that.
Quote
Are you using a genuine Canon product?  (and which camera do you have?)
The problem appeared for IXUS145 and repeated for SX520.
I meant are you using a genuine CANON POWER SUPPLY ... not fake a Canon camera. Cheap supply - cheap quality - possible problems.

Quote
There aren't at all even camera log.
What camera log?

Quote
I've tried five SD cards and only one works fine.
Interesting.  Care to share what's different about that card?  ( size, brand, speed)
« Last Edit: 01 / October / 2015, 20:41:40 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline reyalp

  • ******
  • 11514
Re: "Memory card error" for some SD cards
« Reply #4 on: 22 / November / 2014, 16:56:06 »
Yes, I think so too but a camera works fine without chdk.
Hmmm ... camera power circuitry is pretty simple. AFAIK the code has no way to know if it's running on battery or A/C power. 
I'm pretty sure the firmware knows on cameras that don't use a dummy battery.

On D10 if you have a battery in the camera and plug or unplug in the AC with the camera on, the camera shuts down.

It looks like on this camera physw_status[1] & 0x00004000 is 0 if external power is plugged in, 1 if not.

Both of the above only apply if there is actually power on the plug.

edit:
The above does suggest that incorrect bit fiddling on in physw_status might have side effects depending on the power state, but this shouldn't vary between cards!
« Last Edit: 22 / November / 2014, 16:58:42 by reyalp »
Don't forget what the H stands for.

*

Offline alvm

  • ***
  • 123
Re: "Memory card error" for some SD cards
« Reply #5 on: 22 / November / 2014, 17:16:18 »
Hmmm ... camera power circuitry is pretty simple. AFAIK the code has no way to know if it's running on battery or A/C power. 

However,  there is one "dirty little CHDK secret" that I'd planned to study this week related to battery voltage. There is a theory that when CHDK loads, it accidentally sets the minimum battery shutdown voltage for the camera to a higher value than normal.  This is because CHDK is sneaking in via a hacked "firmware update" method (in both boot methods) and this causes the cameras to set a higher shutdown voltage (to protect against weak batteries expiring during a real firmware update and potentially "bricking" the cameras).  If your power supply is "weak" then you could be triggering this in CHDK mode and just squeaking by without CHDK loaded.

Let's try using GetAdVBattBottom. CHDK - 936, no CHDK - 929 for AC adapter, 774 for battery.

I meant are you using a genuine CANON POWER SUPPLY ... not fake a Canon camera. Cheap supply - cheap quality - possible problems.

I'm using NoName AC adapter - WP-AC04315V

What camera log?
I mean a result of GetLogToFile. Log not be saved on SD card.

Interesting.  Care to share what's different about that card?  ( size, brand, speed)

Sure:

works fine: Sandisk 4GB sdhc 4
error: Adata 8GB sdhc 10, Transcend 2GB, Team 4GB sdhc 10, Kingston 16GB/32GB sdhc 10,
 

*

Offline srsa_4c

  • ******
  • 3695
Re: "Memory card error" for some SD cards
« Reply #6 on: 22 / November / 2014, 17:19:23 »
This is an issue we know very little about. It seems to affect some cameras on certain cards: sx130, sx150, sx160.
Since I've never experienced it, I have no idea what could cause it (but I don't think it's any way related to the power supply*). reyalp's idea with physw_status might be right.

About the string: "Memory card error" is a resource string (it is localized). It's either referenced by its ordinal in a data block which belongs to a GUI resource ("dialog"), OR its ordinal is passed to a function I named "get_string_by_id". "get_string_by_id" is located by the sigfinder, the address is in the funcs_by_name.csv file (though it could be wrong on those cameras). Getting the ordinal is trickier...

edit:
* should have read the original post

edit2:
ordinal is 0x108 for the ixus145
« Last Edit: 22 / November / 2014, 18:01:43 by srsa_4c »

Re: "Memory card error" for some SD cards
« Reply #7 on: 22 / November / 2014, 17:19:53 »
I'm pretty sure the firmware knows on cameras that don't use a dummy battery. On D10 if you have a battery in the camera and plug or unplug in the AC with the camera on, the camera shuts down.
Interesting.  I've always assumed this was just the jack & socket doing a mechanical switch-over. Sort of like plugging in headphones on a radio - the internal speaker cuts out when the jack opens that circuit.  Suggests we could mask something to allow "bumpless" transfers between battery and AC power maybe?
Quote
It looks like on this camera physw_status[1] & 0x00004000 is 0 if external power is plugged in, 1 if not. Both of the above only apply if there is actually power on the plug. The above does suggest that incorrect bit fiddling on in physw_status might have side effects depending on the power state, but this shouldn't vary between cards!
Kind of hard to find a scenario where CHDK can do something to the physw_status that makes SD card writes fail based on external vs battery power?
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline alvm

  • ***
  • 123
Re: "Memory card error" for some SD cards
« Reply #8 on: 22 / November / 2014, 17:23:51 »
I'm pretty sure the firmware knows on cameras that don't use a dummy battery.

On D10 if you have a battery in the camera and plug or unplug in the AC with the camera on, the camera shuts down.

It looks like on this camera physw_status[1] & 0x00004000 is 0 if external power is plugged in, 1 if not.

Both of the above only apply if there is actually power on the plug.

edit:
The above does suggest that incorrect bit fiddling on in physw_status might have side effects depending on the power state, but this shouldn't vary between cards!

AC adapter:

ShowPhySwStatus
NotifyMask   95-64 |0x1770fbff|  63-32 |0x00000000|  31-0 |0x00000000|
SwitchMask   95-64 |0x1770fbff|  63-32 |0x00000000|  31-0 |0x00000000|
InvertData   95-64 |0x0100fbff|  63-32 |0x00000000|  31-0 |0x00000000|
ChataNone    95-64 |0x04700000|  63-32 |0x00000000|  31-0 |0x00000000|
ChataDefault 95-64 |0x1300fbff|  63-32 |0x00000000|  31-0 |0x00000000|
GpioStatus   95-64 |0x0410fbff|  63-32 |0x0090507d|  31-0 |0x00600001|
SwitchStatus 95-64 |0x05100000|  63-32 |0x00000000|  31-0 |0x00000000|

battery:

ShowPhySwStatus
NotifyMask   95-64 |0x1770fbff|  63-32 |0x00000000|  31-0 |0x00000000|
SwitchMask   95-64 |0x1770fbff|  63-32 |0x00000000|  31-0 |0x00000000|
InvertData   95-64 |0x0100fbff|  63-32 |0x00000000|  31-0 |0x00000000|
ChataNone    95-64 |0x04700000|  63-32 |0x00000000|  31-0 |0x00000000|
ChataDefault 95-64 |0x1300fbff|  63-32 |0x00000000|  31-0 |0x00000000|
GpioStatus   95-64 |0x0410fbff|  63-32 |0x0090503d|  31-0 |0x33600001|
SwitchStatus 95-64 |0x05100000|  63-32 |0x00000000|  31-0 |0x00000000|

Looks like there isn't gpio for AC adapter/battery. AC adapter has only two pins but battery three.
« Last Edit: 22 / November / 2014, 17:29:16 by alvm »

Re: "Memory card error" for some SD cards
« Reply #9 on: 22 / November / 2014, 17:29:41 »
I'm using NoName AC adapter - WP-AC04315V
The only reference I could find for that is "fake battery" adapter - so none of the phsyw bits are going to change based on that.

What camera are you using?

EDIT :
Looks like there isn't gpio for AC adapter/battery. AC adapter has only two pins but battery three.
Yup - fake battery power supply.   The third pin on the real battery connects a thermistor used to avoid battery overheating during charging.  (The camera can also measure the thermistor if its there but does not do anything with the information AFAIK).
« Last Edit: 22 / November / 2014, 17:34:39 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics