The cam boots, but it shuts down.
It starts normally, i.e. lens extracts, OSD shows and so on?
No. I only use play mode, because I don't want the lens to go ... and stuck.
It starts it's led blinking show as expected, power led goes on, led lights continue blinking, still black screen. cam switches off when the last blink_LED_YELLOW passed.
Same try, but hold set button while power on, cam starts the fancy 3d clock. It runs exactly until last blink_LED_YELLOW. Also the gravity works while(!)
All LED calls saves it's registers.
Without any hooks, the cam must power up normal, no?!
One exception: start_diskboot must be prevented - which you do. So, yes, the cam should start up normally.
So as I expected. If I leave out the hook one stage earlier, I get a boot loop.
"ldmia sp!, {r4, pc} \n"
// "ldmia sp!, {r4, lr} \n"
// "B sub_FF815070 \n"
);
}; //#fe
You realize, that you skip sub_FF815070 that way?
No, look closer
I also catched that point!
Another Idea: If the cam starts and runs normally as long as task_startyp_my is running, you may just need to prevent it from returning => while (1) {};
like this:
"rofl: \n"
" b rofl \n"
I tried. Power LED stays on, black screen, blinker task runs.
With set button: blinker task and 3d clock keeps running, but does not react on gravity(!)
In general: If the cam doesn't work after task_startup has run, something before must have gone wrong. I had the situation where my code has been overwritten. I moved it 64k (or so) higher and everything worked.
Cheers.
Also tried to increase memory. Mh, without any chdk hooks, it must boot up normally even if there are still mistakes in stubs_min.S for example. This is the only file I'm not 100% sure.
I inserted udumper and took a ram snapshot: first I wonder because ram at 0x0000~0x800 was 0xff ... but copying this range to 0x500000 before dumping it looks 100% ok. I guess the SD write/dma/memory protection/cache stuff
No, everything looks ok, chdk is in place and canon stuff below.
Also I ran this show in qemu ... which just crashes a bit earlier:
IO write 0xc0800018, 0x0
IO write 0xc0800008, 0x8881
IO write 0xc0220134, 0x46 <- green led ;)
IO write 0xc0220134, 0x44
IO read 0xc02200f8
< Error Exception >
TYPE : undefined
ISR : FALSE
TASK ID : 131074
TASK Name : init
R 0 : 19980218
R 1 : 19980218
R 2 : 00001000
R 3 : 00000000
R 4 : 19980218
R 5 : 19980218
R 6 : 19980218
R 7 : 19980218
R 8 : 19980218
R 9 : 19980218
R10 : 19980218
R11 : 19980218
R12 : 00000000
R13 : 0000ee8c
R14 : ff811904
PC : ff811904
CPSR : 00000093
IO write 0xc0220134, 0x46
IO write 0xc0220134, 0x44
IO write 0xc0400030, 0x1
IO read 0xc040004c
However, I expect there are more bugs in qemu then in my boot.c
)