How can I shoot without the lenses? - page 8 - Hotwire! Hardware Mods, Accessories and Insights - CHDK Forum  

How can I shoot without the lenses?

  • 121 Replies
  • 46568 Views
Re: How can I shoot without the lenses?
« Reply #70 on: 30 / November / 2011, 16:51:42 »
Advertisements
Hello all,
i just registered to this Forum - even if i am a long time CHDK user...

I have a IXUS 120 that suffers from "E32" (Showing "ISDriveError" on ver.req screen) and it shuts down after exactly 1 minute. Before shutdown i can use all functions and the camera seems to work fine (i can shoot photos, videos, zoom, focus, etc.).

I was just about to give up on this cam when i stumbled upon this thread. Now i have spent the whole Afternoon downloading CHDK sources and setting up a development environment and reading lots of info on CHDK development in hope to redo what you guys (microfunguy, funnel, srsa_4c etc.) have done for sh1981, so that my IXUS120 will work normal again.

But i am failing at the first step :( I can not understand how you got the function address for "DisableISDriveError"... I have a 103b firmware dump (the same as on my IXUS) and the strings.txt says: 0000003ACA1E    DisableISDriveError. But this is not the right address of the function that must be called, is it? I have to add the rom starting address FF810000 to that? or am i completely on the wrong track?

I think i am totally lost at what i try to accomplish  ::)

So my question would be if anyone of you could be so nice to tell me how to get the right function address and maybe microfunguy could even send me a diff of his work so that i can modify the IXUS120 103b CHDK like he did but with the right address for IXUS120.

That would be really nice of you!

Thanks,
dr.james

*

Offline srsa_4c

  • ******
  • 4447
Re: How can I shoot without the lenses?
« Reply #71 on: 30 / November / 2011, 19:40:04 »
Hi!

I have come up with the following. The idea is that CHDK issues a call to DisableISDriveError() after every mode change when the current mode is not play mode. Previously sh1981 had problems turning on his camera when this call was issued too early (or in play mode, who knows), so this time it's delayed by at least 2 seconds after each mode change.

On how to find this function (I've never used the Windows CHDK dev. environment, so some steps might be missing for that):
First, let's get a disassembly of the firmware:
./disassemble.pl 0xff810000 PRIMARY.BIN
this results in several files being created, we need PRIMARY.BIN.dis, which is the disassembly.

If we search for "DisableISDriveError" in this file, we find it here:

Code: [Select]
ffbbca18: 6f727245 svcvs 0x00727245
"..DisableISDriveError":
ffbbca1c: 69440072 stmdbvs r4, {r1, r4, r5, r6}^
ffbbca20: 6c626173 stfvse f6, [r2], #-460 ; 0xfffffe34
ffbbca24: 44534965 ldrbmi r4, [r3], #-2405 ; 0x965
ffbbca28: 65766972 ldrbvs r6, [r6, #-2418]! ; 0x972
ffbbca2c: 6f727245 svcvs 0x00727245
"..SetISLPFAaxis":
ffbbca30: 65530072 ldrbvs r0, [r3, #-114] ; 0x72
Note, that the string is not 32bit aligned, it starts at 0xffbbca1e
Let's search for that address.

Code: [Select]
ffb81b94: ffbbca1e undefined instruction 0xffbbca1e
ffb81b98: ffa685d0 undefined instruction 0xffa685d0

We find it in a table which consists of string addresses followed by other addresses. The constant at 0xffb81b98 is our function's address, it's 0xffa685d0

This is the function:

Code: [Select]
ffa685d0: e92d4010 push {r4, lr}
ffa685d4: ebf81d82 bl ff86fbe4 <_start+0x5fbe4>
ffa685d8: e3a00000 mov r0, #0
ffa685dc: e8bd8010 pop {r4, pc}

It always returns 0.
Does it take parameters?

Code: [Select]
ff86fbe4: e3a01000 mov r1, #0
ff86fbe8: e3a0009c mov r0, #156 ; 0x9c
ff86fbec: ea031f04 b ff937804 <_start+0x127804>

Nope, R0 and R1 are populated at its start, it has no parameters.
So, it's safe to call it.

I've attached a source patch which (I hope, haven't tried it, may contain bugs) does what I wrote at the start of this message. Also attached is a DISKBOOT.BIN for the firmware version you have.

Another possibility would be to call this firmware function from a lua script, but that would require a CHDK build with native calls enabled. If my solution fails, you could try that. All you need is the address of DisableISDriveError().

Re: How can I shoot without the lenses?
« Reply #72 on: 01 / December / 2011, 13:57:28 »
Hey srsa_4c,

THANK YOU SO MUCH for this great explanation and for even compiling a diskboot - which i tested immediately and seems to work! My battery went flat after 2-3 minutes of testing but that is longer than the usual 1 minute and the battery is recharging now so i can do more tests after that. I will report back after more testing and if i encouter any more (e32-)crashing.

meanwhile i'm off to reproduce your finding of the right address etc. so that i can do it myself in the future :D

Thanks again, that was a really great help and very quick response as well 8)

*

Offline srsa_4c

  • ******
  • 4447
Re: How can I shoot without the lenses?
« Reply #73 on: 01 / December / 2011, 18:52:05 »
@dr.james
You're welcome.

The method of calling that function could be better: It probably only needs to be done when "record" mode is entered (from switched off state or from play mode), but if the current solution is not causing any trouble, I won't touch it :)
I also don't know what happens when the camera goes to "sleep" (power saving) and then wakes up.

In case somebody is interested, the disassembly was done with a script from this Wikia page.

I've also noticed that the diskboot.bin has now 3 downloads, but don't know, why  ???


Re: How can I shoot without the lenses?
« Reply #74 on: 02 / December / 2011, 05:00:16 »
Hey,

so i tested some more last night after the battery was charged and i have to say it works fine as long as i stay in record mode. I can take photos and record video for as long as i want without it turning off. Thats great!

In Playback mode i get the e32 error if i stay in this mode for longer than one minute but that is not a problem for me - funny though as for sh1981 the e32 error seemed only to come up in record mode. I will later test if my camera also crashes when i issue the DisableISDriveError while in playback mode (i think it will).

Thanks again for your great help!

Re: How can I shoot without the lenses?
« Reply #75 on: 05 / September / 2013, 11:30:55 »
Hello,
I´m trying to disable IS error (E32) of a camera sx 260 hs with 1.0.0 a firmware
Someone know how to do it?

Thanks

*

Offline reyalp

  • ******
  • 13675
Re: How can I shoot without the lenses?
« Reply #76 on: 05 / September / 2013, 13:00:31 »
Hello,
I´m trying to disable IS error (E32) of a camera sx 260 hs with 1.0.0 a firmware
Someone know how to do it?

Thanks
You might find some idea here: http://chdk.wikia.com/wiki/User:Srsa_4c/Working_with_a_broken_camera

edit:
OK, that mostly links back here... so read the thread, and please don't post the same question in multiple places, it makes the answers much harder to follow ;)
« Last Edit: 05 / September / 2013, 13:10:46 by reyalp »
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4447
Re: How can I shoot without the lenses?
« Reply #77 on: 05 / September / 2013, 18:14:49 »
I´m trying to disable IS error (E32) of a camera sx 260 hs with 1.0.0 a firmware
A question: do you get E32 in play mode too, or only in rec mode?

Are you already using CHDK on the camera? If not, this utility can help: http://zenoshrdlu.com/stick/stick.html

To suppress the E32 error, put the following 3 lines in a simple text file, name it e32fix.lua, and run it on the camera before it shows the error. To be able to run the script, you'll have to enable "Lua native calls" in the Miscellaneous menu.
Code: (Lua) [Select]
call_event_proc("Mecha.Create")
call_event_proc("StartImStEventProc")
call_event_proc("DisableISDriveError")
You'll need to re-run the script after each play -> rec mode transition (and vice versa, if you also get e32 in play mode). If you need an easier to use solution, you can get a special CHDK build that disables the error.


Re: How can I shoot without the lenses?
« Reply #78 on: 09 / September / 2013, 09:04:14 »
A question: do you get E32 in play mode too, or only in rec mode?

Are you already using CHDK on the camera? If not, this utility can help: http://zenoshrdlu.com/stick/stick.html

To suppress the E32 error, put the following 3 lines in a simple text file, name it e32fix.lua, and run it on the camera before it shows the error. To be able to run the script, you'll have to enable "Lua native calls" in the Miscellaneous menu.
Code: (Lua) [Select]
call_event_proc("Mecha.Create")
call_event_proc("StartImStEventProc")
call_event_proc("DisableISDriveError")
You'll need to re-run the script after each play -> rec mode transition (and vice versa, if you also get e32 in play mode). If you need an easier to use solution, you can get a special CHDK build that disables the error.


Yes, i've got the error in play mode too.
i will try this, but i can't get to the miscellanueous menu because i have the menu button broken. I use the chdkptp to use the camera.

Do you know how to activate native calls whit a command? or were i can get a chdk with native calls activate?

Thanks.

*

Offline srsa_4c

  • ******
  • 4447
Re: How can I shoot without the lenses?
« Reply #79 on: 09 / September / 2013, 09:38:39 »
Yes, i've got the error in play mode too.
Thx, that's useful to know.
Quote
Do you know how to activate native calls whit a command?
You can't due to a design decision.
Quote
or were i can get a chdk with native calls activate?
I'll create a custom build, if you tell me your camera's exact firmware version.

 

Related Topics