ELPH300HS aka IXUS220HS - Porting Thread - page 44 - DryOS Development - CHDK Forum  

ELPH300HS aka IXUS220HS - Porting Thread

  • 897 Replies
  • 271262 Views
*

Offline tommi2water

  • ***
  • 157
  • IXUS 220 HS Firmware: 1.00c
Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #430 on: 03 / December / 2011, 11:01:01 »
Advertisements
...
The line:
   *(int*)(0x2638) = (*(int*)0xC0220130)&1 ? 0x200000 : 0x100000;
should be
   *(int*)(0x25F4) = (*(int*)0xC0220130)&1 ? 0x200000 : 0x100000;
...

Phil, some days ago you saved my life with above advice. :D

I couldn't figure out from where you know the correct value. How can I find this in firmware?

The reason why I'm asking, I'm trying to support the ELPH310 porting thread (http://chdk.setepontos.com/index.php?topic=7149.msg77262#msg77262). It seems that we need to know the above value for ELPH310. But I don't know where/how I can find the correct value in ELPH310 firmware. We will now try to use the value from ELPH500 in our next try.

Could you please point us to the right location or explain how you found out the correct value?

Thanks in advance.  :)

Update:
Uups, I think I found it already:
Code: [Select]
void __attribute__((naked,noinline)) sub_FF864E00_my(  ) {
asm volatile (
" LDR R3, =0x25F4 \n"                     
" CMP R2, #0 \n"                           
" MOV R12, #0 \n"                         
" MOVNE R2, #0x400000 \n"                 
" STR R12, [R3] \n"                       
" STRNE R2, [R3] \n"                       
" CMP R0, #0 \n"                           
" LDRNE R0, [R3] \n"                       
" ORRNE R0, R0, #0x100000 \n"             
" STRNE R0, [R3] \n"                       
" CMP R1, #0 \n"                           
" LDRNE R0, [R3] \n"                       
" ORRNE R0, R0, #0x200000 \n"             
" STRNE R0, [R3] \n"                       
" BX LR \n"                               
)
}
« Last Edit: 03 / December / 2011, 11:09:21 by tommi2water »

Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #431 on: 03 / December / 2011, 14:54:30 »
Found another crash bug.  The universal Tv script blows up when you half-press the shutter.

This is on firmware 1.01a, build 1446 from autobuild.

*

Offline FaKK

  • *
  • 17
Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #432 on: 03 / December / 2011, 15:31:25 »
how do i get the firmware version of my ixus 220hs? recommended to update to the 1.01e?

Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #433 on: 03 / December / 2011, 15:44:58 »
how do i get the firmware version of my ixus 220hs? recommended to update to the 1.01e?

link> Determining the firmware version in your camera.
Ported :   A1200    SD940   G10    Powershot N    G16


Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #434 on: 03 / December / 2011, 15:45:24 »
In the trunk build for this camera, subject distance override doesn't do anything (as has been mentioned before).  The CHDK documentation indicates you have to be in manual focus mode in order for this to work... but the IXUS 220 doesn't _have_ manual focus mode; that's one of the reasons I want CHDK.  :D

So I played with forcing it via CAM_CAN_SD_OVER_NOT_IN_MF, and it mostly worked, but the camera crashed occasionally (presumably when its own continuous autofocus clashed with CHDK's override).

As I surmised earlier,

So perhaps I could update shooting_can_focus() in core/shooting.c to check AFL on cameras that don't have manual focus mode?

That's what I did in the attached builds.  And it seems to work.  Subject distance override still does nothing when not in AF lock mode... but when you are in AF lock mode (half-press + left arrow), it works, and I haven't seen it crash.

(The easiest way to see it work is:
  • Enable AF lock (half-press + left)
  • Enter ALT mode
  • Press UP for manual focus toggle
  • Press DOWN for infinity focus
  • Now use the zoom lever to go out and back in; it's most noticeable when you go wrap around from 0 (closest) to 65536 (infinity)

Note that the property indicating AF lock (11) was not in propset4.h, so I added it.  I found that number in http://chdk.wikia.com/wiki/PropertyCase under property set 2, but confirmed that this is correct on the IXUS 220.  So perhaps it should go in propset2.h and propset3.h as well.

I've attached a patch, but it's probably not ready for the trunk; it needs review from CHDK gurus, especially since it is not an ELPH 300/IXUS 220-specific change.

I've also attached builds--if you're interested in manual focus, please give it a try.
« Last Edit: 03 / December / 2011, 15:49:55 by jstanley0 »

Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #435 on: 03 / December / 2011, 15:47:10 »
manual focus-enabled builds for 1.01a and 1.01c (1.01d/1.01e can use the 1.01c build)

Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #436 on: 03 / December / 2011, 16:02:30 »
Found another crash bug.  The universal Tv script blows up when you half-press the shutter.

This is on firmware 1.01a, build 1446 from autobuild.

Unless I'm mistaken, this assert in capt_seq.c is what tripped:

Code: [Select]
"loc_FF8CBE7C: \n"
"               LDR     R0, =0xFF8C75F4 \n" //"ExpDrv.c"
"               BL      _DebugAssert \n"
"               B       loc_FF8CBDAC \n"

Guessing this because 0xFF8C75F4 is near the top of the stack trace in the ROM log.

Time to brush up on my ARM assembly and see if I can figure out what causes us to go there.

*

Offline whim

  • ******
  • 2022
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #437 on: 03 / December / 2011, 16:39:43 »
Hi Tommi,

While on the subject of kbd handling (your post #430)

ixus220_elph300hs (100c, all revisions tested so far) still exhibit non-standard
key response while booting:
Quote
Playback button:   short press => REC mode,   long press => REVIEW mode
On/Off button:      short press => REC mode,   long press => REC mode
while AFAIK 'Standard' CHDK behaviour for DRYOS camera with Playback button is:
Quote
Playback button:   short press => REVIEW mode,   long press => REVIEW mode
On/Off button:      short press => REVIEW mode,   long press => REC mode
Normally, it would be possible to simply switch between these 2 'modes' (see here)
by changing (in /platform/ixus220_elph300hs/sub/{firmware}/boot.c)
Quote
*(int*)(0x25F4) = (*(int*)0xC0220130)&1 ? 0x200000 : 0x100000;
to
Quote
*(int*)(0x25F4) = (*(int*)0xC0220130)&1 ? 0x100000 : 0x200000;
I tried this, and it works, except that now all of the above key presses take us to REVIEW mode,
in other words, the only way to go to REC is pressing half-shutter after booting to REVIEW.

I suppose this means something in kbd.c (keymasks and/or keymap ?) needs tweaking ?

wim


*

Offline philmoz

  • *****
  • 3156
    • Photos
Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #438 on: 03 / December / 2011, 17:10:24 »
In the trunk build for this camera, subject distance override doesn't do anything (as has been mentioned before).  The CHDK documentation indicates you have to be in manual focus mode in order for this to work... but the IXUS 220 doesn't _have_ manual focus mode; that's one of the reasons I want CHDK.  :D

So I played with forcing it via CAM_CAN_SD_OVER_NOT_IN_MF, and it mostly worked, but the camera crashed occasionally (presumably when its own continuous autofocus clashed with CHDK's override).

As I surmised earlier,

So perhaps I could update shooting_can_focus() in core/shooting.c to check AFL on cameras that don't have manual focus mode?

That's what I did in the attached builds.  And it seems to work.  Subject distance override still does nothing when not in AF lock mode... but when you are in AF lock mode (half-press + left arrow), it works, and I haven't seen it crash.

(The easiest way to see it work is:
  • Enable AF lock (half-press + left)
  • Enter ALT mode
  • Press UP for manual focus toggle
  • Press DOWN for infinity focus
  • Now use the zoom lever to go out and back in; it's most noticeable when you go wrap around from 0 (closest) to 65536 (infinity)

Note that the property indicating AF lock (11) was not in propset4.h, so I added it.  I found that number in http://chdk.wikia.com/wiki/PropertyCase under property set 2, but confirmed that this is correct on the IXUS 220.  So perhaps it should go in propset2.h and propset3.h as well.

I've attached a patch, but it's probably not ready for the trunk; it needs review from CHDK gurus, especially since it is not an ELPH 300/IXUS 220-specific change.

I've also attached builds--if you're interested in manual focus, please give it a try.

The propcase value looks ok (matches on the G12).
The code should probably be enabled with a new camera.h/platform_camera.h define to avoid unexpected surprises on existing cameras that have AFL (the G12 has both AFL and MF). This new #define should default to #undef in camera.h

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)

*

Offline philmoz

  • *****
  • 3156
    • Photos
Re: ELPH300HS aka IXUS220HS - Porting Thread
« Reply #439 on: 03 / December / 2011, 17:13:27 »
Found another crash bug.  The universal Tv script blows up when you half-press the shutter.

This is on firmware 1.01a, build 1446 from autobuild.

Unless I'm mistaken, this assert in capt_seq.c is what tripped:

Code: [Select]
"loc_FF8CBE7C: \n"
"               LDR     R0, =0xFF8C75F4 \n" //"ExpDrv.c"
"               BL      _DebugAssert \n"
"               B       loc_FF8CBDAC \n"

Guessing this because 0xFF8C75F4 is near the top of the stack trace in the ROM log.

Time to brush up on my ARM assembly and see if I can figure out what causes us to go there.

At the top of the log is the module name "ExpDrv.c" and the line number of the assert.
The module name is loaded into R0 and the line number into R1 before DebugAssert is called.
There may be multiple asserts in a given module - the line number will help you find which one was called.

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)

 

Related Topics