A495 porting thread - page 23 - DryOS Development - CHDK Forum

A495 porting thread

  • 346 Replies
  • 122310 Views
Re: A495 porting thread
« Reply #220 on: 04 / June / 2011, 00:41:14 »
Advertisements
100d video crashed after ~ 10-12 seconds, the camera freezes with black screen, video does not save on SD
@KPOT :  You are the first to try the 1.00d port so I thank you for the comments.   Can I assume all the CHDK menus function and regular JPG picture taking seem to work correctly ?

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: A495 porting thread
« Reply #221 on: 04 / June / 2011, 02:05:04 »

So,  here's an interesting challenge.   The address you posted for WriteSDCard versus the one I found.  Different addresses - identical code except for how it uses two registers - R5 vs R6 and R6 vs R7.


WriteSDCard is tricky - there are two functions that are very similar. One is for reading the SD the other is for writing the SD.

The method I'm using to find WriteSDCard is:
- find the string "Mounter.c" in the firmware. This should be followed by five pointers to functions.
Code: [Select]
aMounter_c      DCB "Mounter.c",0,0,0   ; DATA XREF: _sub_FFC506CC__Mounter.c__0+3C
                                        ; _sub_FFC507DC__Mounter.c__0+15C
off_FFC50960    DCD sub_FFCFC938        ; DATA XREF: _sub_FFC506CC__Mounter.c__0+54
off_FFC50964    DCD sub_FFCFCB1C        ; DATA XREF: _sub_FFC506CC__Mounter.c__0+60
off_FFC50968    DCD sub_FFCFC888        ; DATA XREF: _sub_FFC506CC__Mounter.c__0+6C
off_FFC5096C    DCD sub_FFCFCEC8        ; DATA XREF: _sub_FFC506CC__Mounter.c__0+7C
off_FFC50970    DCD sub_FFCFCF38        ; DATA XREF: _sub_FFC506CC__Mounter.c__0+84

- look at the code that is using these function pointers (in IDA you can double click the DATA XREF name). They will all be used in the same function:
Code: [Select]
_sub_FFC506CC__Mounter.c__0
                STMFD   SP!, {R4-R6,LR}
                MOV     R6, R0
                LDR     R0, =0x32350
                   .....
                LDR     R1, =sub_FFCFC938
                STR     R0, [R4,#0x3C]
                STR     R1, [R4,#0x50]
                LDR     R1, =sub_FFCFCB1C     <<-------- WriteSDCard
                MOV     R0, #0
                STR     R1, [R4,#0x54]        <<-------- saved to [R4 + 0x54]
                LDR     R1, =sub_FFCFC888
                STR     R0, [R4,#0x38]
                STR     R1, [R4,#0x58]
                STR     R0, [R4,#0x5C]
                LDR     R0, =sub_FFCFCEC8
                STR     R0, [R4,#0x60]
                LDR     R0, =sub_FFCFCF38
                STR     R0, [R4,#0x64]
                LDMFD   SP!, {R4-R6,PC}

Each of the five function addresses is loaded into R1 or R0 and then stored into the memory block pointed to by R4, each with a different offset.

The address stored into [R4,#0x54] is WriteSDCard.
FYI - the address stored into [R4,#0x50] is ReadSDCard (which we don't use).

I discovered this by examining UpdateMBROnFlash which uses these stored addresses to read a block from the SD card then write it back.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline KPOT

  • *
  • 10
Re: A495 porting thread
« Reply #222 on: 04 / June / 2011, 02:22:00 »
@waterwingz: it seems all works fine except video, if I find bugs I'll let you know, thx

Re: A495 porting thread
« Reply #223 on: 04 / June / 2011, 02:35:53 »
100d video crashed after ~ 10-12 seconds, the camera freezes with black screen, video does not save on SD
@KPOT :  You are the first to try the 1.00d port so I thank you for the comments.   Can I assume all the CHDK menus function and regular JPG picture taking seem to work correctly ?



Hi WaterWingz,

I have now loaded CHDK files on a 2GB SD card. I make the sd card bootable and click play. And CHDK boots with logo and all... think it is as it should...

I have taken 3 pictures in jpg without any crash. I need to learn how to use this i think ... had problems shooting because of some script thing... but i will just have to learn it since i will have to build a trigger too :D ....

anyway i tested video too and the problem is the same as described by kpot.

It is awesome... waterwingz i think i own your a beer :) where do you live ? :P

*

Offline KPOT

  • *
  • 10
Re: A495 porting thread
« Reply #224 on: 04 / June / 2011, 03:29:21 »
got crash when take shoot with 'Enable edge overlay'

Re: A495 porting thread
« Reply #225 on: 04 / June / 2011, 06:45:53 »

Re: A495 porting thread
« Reply #226 on: 04 / June / 2011, 08:11:07 »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: A495 porting thread
« Reply #227 on: 04 / June / 2011, 08:35:22 »
WriteSDCard is tricky - there are two functions that are very similar. One is for reading the SD the other is for writing the SD.
It almost looks like WriteSDCard does an inline ReadSDCard code added right after it writes - making 3 blocks of almost identical code to decide between.

Did you have any advice about the ND filter in & out code ?  Somewhere near the sting NdActuator.c I suspect ?

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: A495 porting thread
« Reply #228 on: 04 / June / 2011, 08:45:12 »

Did you have any advice about the ND filter in & out code ?  Somewhere near the sting NdActuator.c I suspect ?


Search for the strings "TurnOnNdFilter" and ""TurnOffNdFilter".
Somewhere before these strings will be a table of offsets that has pointers to these two strings.
The offsets come in pairs, after the pointer to each string is the pointer to the function.

For A495 1.00d:
Code: [Select]
ROM:FFEE9D40 aTurnoffndfilte DCB "TurnOffNdFilter",0 ; DATA XREF: ROM:FFEC3800
ROM:FFEE9D50 aTurnonndfilter DCB "TurnOnNdFilter",0  ; DATA XREF: ROM:off_FFEC37F8

and:
Code: [Select]
ROM:FFEC37F8 off_FFEC37F8    DCD aTurnonndfilter     ; DATA XREF: sub_FFDFAC48+20
ROM:FFEC37F8                                         ; sub_FFDFAC74+4
ROM:FFEC37F8                                         ; "TurnOnNdFilter"
ROM:FFEC37FC                 DCD sub_FFDFACA4
ROM:FFEC3800                 DCD aTurnoffndfilte     ; "TurnOffNdFilter"
ROM:FFEC3804                 DCD sub_FFDFACC8
ROM:FFEC3808                 DCD 0
ROM:FFEC380C                 DCD 0

Some cameras don't have the "TurnOnNdFilter" and "TurnOffNdFilter" strings, they have "PutInNdFilter" and "PutOutNdFilter"
strings instead.

Also some (like the G12) have both sets of strings with different function pointers for each. On the G12 the PutInNdFilter function crashes the camera while the TurnOnNdFilter function works. So you may need to experiment a bit.

Phil.
« Last Edit: 04 / June / 2011, 08:47:13 by philmoz »
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: A495 porting thread - Beta 3 release for firmwares 1.00d 1.00e 1.00f
« Reply #229 on: 04 / June / 2011, 08:50:17 »
This should fix the movie recording crash in the 1.00d.  I also updated the WriteSDCard address from philmoz - might help with some other things.

CHDK A495 firmware 1.00d Beta 3 : 1.00D
CHDK A495 firmware 1.00e Beta 3 : 1.00E
CHDK A495 firmware 1.00f Beta 3 : 1.00F
« Last Edit: 04 / June / 2011, 08:55:32 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal © 2008-2014, SimplePortal