Hi all,
I'm trying to port the CHDK to ELPH135, up to now just self learning, but reached a pitfall. I own the camera and have some knowledge about microcontrollers, assembler, hardware, C development, linux, etc.
What I've done:
- Studied the FW with IDA;
- Download trunk, copied the A2500 as base, maybe the ELPH115 was more close in features, but the ROM has 16MB;
- Sucessfully build, missing symbols and addresses dummy filled in stubs_entry_2.S;
- Tried to guess the led address and put an assembly blinker in the entry.S, but DISKBOOT.BIN crash the camera;
- Back to the basics, searched the led address with this approach
http://chdk.setepontos.com/index.php?topic=9005.msg93932#msg93932, found 0xC022302C and 0xC022D1FC, and strangely like camcrazy, it's needed to write to both to control the led, this way Poke8 made the led turn on/off;
- This code is actually on entry.S:
.section .entry
// looks like idle cycle is required for proper shutdown
MOV R3, #0xF0000
0:
SUB R3, R3, #1
CMP R3, #0
BNE 0b
// ordinary startup...
LDR R3, =0xC022302C
LDR R4, =0xC022D1FC
MOV R1,#10
1:
MOV R2, #0x46
STR R2, [R3]
STR R2, [R4]
MOV R0, #0x8000
2:
SUB R0,R0,#1
CMP R0,#0
BNE 2b
MOV R2, #0x44
STR R2, [R3]
STR R2, [R4]
MOV R0, #0x8000
3:
SUB R0,R0,#1
CMP R0,#0
BNE 3b
SUB R1,R1,#1
CMP R1,#0
BNE 1b
- It still crashing the camera, both the DISKBOOT.BIN (read only card) and the MAIN.BIN (loaded by
http://chdk.wikia.com/wiki/Canon_Basic/Scripts/Loader )
So, even with everything else (entry points, addresses) wrong, the code on entry.S should work, right ?
DISKBOOT.BIN maybe wrong encoded, but MAIN.BIN should be correctly loaded right ?
Regards
Nelson