"Memory card error" for some SD cards - page 6 - DryOS Development - CHDK Forum supplierdeeply

"Memory card error" for some SD cards

  • 53 Replies
  • 26709 Views
*

Offline srsa_4c

  • ******
  • 4451
Re: "Memory card error" for some SD cards
« Reply #50 on: 22 / December / 2014, 17:43:32 »
Advertisements
Do FAT and directory entries update at close stage?
Good question... I think the filesystem code may do some caching which may delay writing those details...

The problem is, you're experiencing the same issue on two different cameras which (I think) should rule out accidental memory corruption by PSM code.

I don't have any idea other than trying to find out what is causing the writing failure.

If you have an operational PTP connection, you could try to dump some RAM (perhaps the first 4..6 MB) to the PC. You should do it with cards that are the same size, have the same content (no images, only PSM related files), one card that is working with AC power, another that is not working with AC power.
Test scenario:
- dump RAM
- open() for writing
- dump RAM
- close()
- dump RAM

The RAM snapshots can then be analysed/compared.

It can of course be that filesystem related data is located elsewhere in RAM, and that won't make things easier...

Some other suggestions:
- try making a .fi2 version of your code and see whether you get the same issues
- try putting PSM into the AdditionAgentRAM area and see whether it behaves differently
//   ARAM_HEAP_START = 0x60e000  // Found @ 0xff99dc24
//   ARAM_HEAP_SIZE  = 0x22000   // Found @ 0xff99dbe4

*

Offline alvm

  • ***
  • 123
Re: "Memory card error" for some SD cards
« Reply #51 on: 07 / January / 2015, 07:43:49 »
Some info: if I mask middle pin on battery the error appears. The pin is connected to ground inside battery. Does anybody know where I can found status of the pin in memory?  There isn't the status in physw_status.
« Last Edit: 07 / January / 2015, 07:52:33 by alvm »

*

Offline reyalp

  • ******
  • 14121
Re: "Memory card error" for some SD cards
« Reply #52 on: 07 / January / 2015, 12:57:01 »
Some info: if I mask middle pin on battery the error appears. The pin is connected to ground inside battery. Does anybody know where I can found status of the pin in memory?  There isn't the status in physw_status.
I assume this is the battery temp thermistor (which may just be a resistor or open circuit on dummy adapters or clones)? This thread may be useful: http://chdk.setepontos.com/index.php?topic=10385.0

Since it's analog, it is connected to an ADC channel (5 on all it's know for, AFAIK) not a physw bit.  I don't know if there is a convenient place to override the value but that thread should provide some places to look.
Don't forget what the H stands for.

*

Offline alvm

  • ***
  • 123
Re: "Memory card error" for some SD cards
« Reply #53 on: 07 / January / 2015, 13:27:35 »
There is >10K between middle pin and ground for battery but there isn't any pin for ac adapter. So camera see infinity resistance here and this affect to SD card writing (except SanDisk SD).

For AC adapter and  normal room temp:

GetBatteryTemperature returned -20(0xffffffec)
GetAdChValue 5 returned 1023(0x3ff)

For battery:

GetBatteryTemperature returned 30(0x1e)
GetAdChValue 5 returned 299(0x12b)


I assume this is the battery temp thermistor (which may just be a resistor or open circuit on dummy adapters or clones)? This thread may be useful: http://chdk.setepontos.com/index.php?topic=10385.0

Since it's analog, it is connected to an ADC channel (5 on all it's know for, AFAIK) not a physw bit.  I don't know if there is a convenient place to override the value but that thread should provide some places to look.

Thanks for the link, its very useful!
« Last Edit: 07 / January / 2015, 15:58:44 by alvm »


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal