Hi folks, need some help finally.
Porting of sx110 stucks. I'm running out of ideas.
I think I have ported almost all camera dependent parts. But I can't test that it works because the camera doesn't boot. I'm struckling around for days/weeks now and can't identify the reason.
I'm appreciate for any help.
What I've done so far:
core/gui.c
core/kbd.c
include/camera.h
loader/<cam>/main.c
loader/<cam>/resetcode/main.c
platform/<cam>/kbd.c
platform/<cam>/lib.c
platform/<cam>/main.c
platform/<cam>/shooting.c
platform/<cam>/wrappers.c
platform/<cam>/sub/<fw>/boot.c
platform/<cam>/sub/<fw>/capt_seq.c
platform/<cam>/sub/<fw>/lib.c
platform/<cam>/sub/<fw>/makefile.inc
platform/<cam>/sub/<fw>/movie_rec.c
platform/<cam>/sub/<fw>/stubs_entry.S
platform/<cam>/sub/<fw>/stubs_entry_2.S
platform/<cam>/sub/<fw>/stubs_min.S
All files are checked and/or modified. I think I've understand the depencies of all those files, the boot process and how CHDK works.
Environment: Windows CHDK Shell 2.12, Trunk 725 (I had problems with setting up a working cross-compile-environment under Linux, so I decided to do the job under Windows)
What's wrong?
Boot process stops (presumably not really, it behaves as not as expected 😀).
The call trace is as following, observated by blinking LEDs.
--> startup () --> boot() --> loc_FFC001A4_my() --> sub_FFC00F98_my()
Let's concentrate to sub_FFC00F98_my: there are 2 interesting things..
1.) we have to change the preparation of a function call (""LDR R1, =sub_FFC04D90_my\n")
2.) divert to another function nearly at the end ("BL sub_FFC02D3C\n")
The latter statement is called but doesn't come back to sub_FFC00F98_my (I implemented those functions as inline asm in boot.c ).
As a remainder: sub_FFC02D3C contains 3 of those DryosPanic-calls. sub_FFC02D3C jumps to sub_FFC01998 at the end. sub_FFC01998 jumps again to loc_FFC00528.
loc_FFC00528 does some useful things and the last statement of it is ""LDMFD SP!, {R0-R12,LR,PC}^\n". In my understanding, loc_FFC00528 should return to sub_FFC00F98_my. But not at all: its return to somewhere and we are lost...
Memory Mapping? Stack Smashing? Dullness?
BTW, if I'm change the boot procedure to use the original loc_FFC001A4 instead of our loc_FFC001A4_my (that means leave CHDK at a very early stage and resume with Canon-code) so nothing will happen --> camera doesn't bot. But I can't exclude a fundamental misunderstandig of CHDK of mine.
So, what happens? As said before, I believe that something goes wrong in advance (possibly before startup()). That means either I did a fatal mistake (most likely) or
SX110 is more tricky than expected.
@the more experienced developers: I know for sure that dealing with camera ports is a time consuming task and that it is not in your primary interest to go in with every camera on the market (there are even other things around us 😀). But, it is possible, that someone might check my code and take a look at the fw dump?
Are there any ideas?
Cheers.
Again, I've put all my code into an archive and attached it to this post (but you have to use a forum account to download the attachment)
edit: attachment deleted