Porting a camera sx530hs - page 16 - DryOS Development - CHDK Forum

Porting a camera sx530hs

  • 300 Replies
  • 153603 Views
*

Offline blackhole

  • *****
  • 946
  • A590IS 101b
    • Planetary astrophotography
Re: Porting a camera sx530hs
« Reply #150 on: 30 / April / 2016, 15:32:22 »
Advertisements
Quote
That explains it. Assuming it's the most recent camera crash, can you make a romlog (using a good card of course) and upload it here?
ROMLOG

*

Offline srsa_4c

  • ******
  • 4451
Re: Porting a camera sx530hs
« Reply #151 on: 30 / April / 2016, 15:55:49 »
ROMLOG
Ahh. Error 50, FormatError. Without stackdump, unfortunately.
I'll see if I can find where it comes from. If not, I'll switch to reyalp's debug method and use the camera log.

*

Offline srsa_4c

  • ******
  • 4451
Re: Porting a camera sx530hs
« Reply #152 on: 30 / April / 2016, 16:43:13 »
Turns out, any error in the format process ends with error 50.
Attached is a version of the debug code that puts messages in the camera log.
Please use a bad card, format it while CHDK is running. After it shuts down, put in a good card and retrieve the romlog. Nothing else is needed this time.
Add this line to stubs_entry_2.S:
Code: [Select]
NHSTUB(LogCameraEvent, 0xff035954)

*

Offline blackhole

  • *****
  • 946
  • A590IS 101b
    • Planetary astrophotography
Re: Porting a camera sx530hs
« Reply #153 on: 30 / April / 2016, 17:03:45 »
Turns out, any error in the format process ends with error 50.
Attached is a version of the debug code that puts messages in the camera log.
Please use a bad card, format it while CHDK is running. After it shuts down, put in a good card and retrieve the romlog. Nothing else is needed this time.
Add this line to stubs_entry_2.S:
Code: [Select]
NHSTUB(LogCameraEvent, 0xff035954)
New ROMLOG

*

Offline srsa_4c

  • ******
  • 4451
Re: Porting a camera sx530hs
« Reply #154 on: 30 / April / 2016, 17:35:55 »
New ROMLOG
Closer. Execution doesn't go deeper than sub_FF3A54D8, so something in that sub fails.
I'll probably continue tomorrow.
BTW, sorry about the very inconvenient testing method, but this is the first complete 'trail' I could find while testing on my cam. (By 'trail' I mean the chain of Canon functions as executed, from WriteSDCard backwards.)

*

Offline srsa_4c

  • ******
  • 4451
Re: Porting a camera sx530hs
« Reply #155 on: 01 / May / 2016, 15:36:03 »
Execution doesn't go deeper than sub_FF3A54D8, so something in that sub fails.
After inspecting sub_FF3A54D8, the cause of failure seems to be sub_FF03078C. That function checks bit2 of the word at 0x1b960+0x6c=0x1b9cc, and returns 1 if it's set.
If it returns 0, that means "SD is not detect." as a Canon debug message shows (in another part of the firmware).

Now, the problem is, in all the dumps I have (good and bad), that bit is set (the word is 7).

@blackhole
Can you try inspecting that memory location (0x1b9cc) with rmem and see if you ever see bit2 unset, using a 'bad' card? (Bit0 is the least significant bit of the word)

*

Offline blackhole

  • *****
  • 946
  • A590IS 101b
    • Planetary astrophotography
Re: Porting a camera sx530hs
« Reply #156 on: 01 / May / 2016, 16:22:46 »
Quote
Can you try inspecting that memory location (0x1b9cc) with rmem and see if you ever see bit2 unset, using a 'bad' card?
No, bit is always set,word is always 7 (0111).

*

Offline srsa_4c

  • ******
  • 4451
Re: Porting a camera sx530hs
« Reply #157 on: 01 / May / 2016, 16:52:04 »
No, bit is always set,word is always 7 (0111).
OK, here's one more try.
I'm trying to log stuff around the suspected locations.
Process is again: use bad card -> format (+camera crash) -> use good card -> retrieve romlog

*

Offline blackhole

  • *****
  • 946
  • A590IS 101b
    • Planetary astrophotography
Re: Porting a camera sx530hs
« Reply #158 on: 01 / May / 2016, 17:20:38 »
Quote
Process is again: use bad card -> format (+camera crash) -> use good card -> retrieve romlog
ROMLOG

*

Offline srsa_4c

  • ******
  • 4451
Re: Porting a camera sx530hs
« Reply #159 on: 01 / May / 2016, 17:30:34 »
ROMLOG
Wonderful. All logged values of [0x1b9cc] in the format task are 1.
Now the question is, how does that happen...

edit:
This research will likely take some time again.
« Last Edit: 01 / May / 2016, 17:33:45 by srsa_4c »

 

Related Topics


SimplePortal © 2008-2014, SimplePortal