ELPH 340 (IXUS 265) - page 5 - DryOS Development - CHDK Forum supplierdeeply

ELPH 340 (IXUS 265)

  • 174 Replies
  • 88619 Views
*

Offline srsa_4c

  • ******
  • 4451
Re: ELPH 340 (IXUS 265)
« Reply #40 on: 11 / November / 2014, 15:53:22 »
Advertisements
Hi, I was able to extract the LED addresss, I see something changing from 0x08 to 0x09 at 0xC022D1FC (green) and 0xC022D200 (AF).
Interesting, those are the 2 last entries in the GPIO table, but I don't see the corresponding indexes (0x61, 0x62) anywhere.

Quote
I put these addresses in the boot assembler (entry.s), but I still do not see a reaction.
I think my DISKBOOT.BIN is not recognized as a valid image? If I present a diskboot.bin with just 0x00 inside, The camera will hang also.
The diskboot file requires to be encoded with the appropriate "dancingbits" sequence, you used the value from stubs_entry.S (NEED_ENCODED_DISKBOOT = 12), so that's probably correct (but unverified).
Note that if you manage to start a diskboot and let the camera continue with the bootup sequence, you need to prevent starting the diskboot again, otherwise you'll stuck in a boot loop. So, to try the LEDs, you need to temporarily halt further code execution with an infinite loop.
If the encoding isn't right, the camera will try to execute "garbage" and usually hang.
Quote
Obviously I do something wrong with some very basic settings.
Up to now i just set up some stuff in my diskboot.bin and added some stubs.
How can I verify those very basic settings? Yet I do not understand several stuff like PLATFORMID. I hope I set them right, but I'm not sure.
PLATFORMID is required to produce a firmware update binary that the camera will accept. You don't need any EXMEM related definitions in makefile.inc at this point. Using stuff you find at the beginning of stubs_entry.S (below "Values for makefile.inc") should be OK (KEYSYS is d4f, but that only matters when using the firmware update boot method).

You can try poking the LED addresses from Canon Basic (I'm not sure whether it will work, it doesn't on DIGIC6) with the Poke32 command (registered by System.Create).

You can also try to make an unencoded binary and run it as a task like this, but obviously you need to compile for armv5. The loading address is 0x60e000 on your cam (found in stubs_entry.S).
 There probably is a "right way" of extracting the pure code from the resulting .elf file, I just used a hex editor to extract the right looking bytes.

edit: the correct commands are:
arm-elf-gcc -Wl,-N,-Ttext,0x60e000 -nostdlib try1.s -o try1.elf
arm-elf-objcopy -O binary try1.elf try1.bin

You can then copy try1.bin to the card and use this Canon Basic script to start it:
Code: [Select]
private sub Initialize()
    System.Create()
    AdditionAgentRAM("A/try1.bin","something")
end sub


If something isn't clear, please do ask.
« Last Edit: 11 / November / 2014, 17:15:06 by srsa_4c »

Re: ELPH 340 (IXUS 265)
« Reply #41 on: 11 / November / 2014, 18:17:38 »
Hi all,

Ixus_265_trunk-3605.rar

Attached is the last version of my source code for the ELPH 340 (IXUS 265).

As this is an experimental, partial, "Double Blind" Port it will require some debugging
and the fixing various compile errors.

I have now deleted the older versions for the Ixus 265.

It will be a while before I will be able to have some spare time to continue on with this port.

A Sx600 Reference Camera was used for this experimental, partial, "Double Blind" Port.

H-H

« Last Edit: 11 / November / 2014, 18:34:18 by Hardware_Hacker »

Re: ELPH 340 (IXUS 265)
« Reply #42 on: 23 / November / 2014, 08:58:23 »
Thank you all for your hard work. I'm the original poster. Is that .rar file what I will download to my SD card on my ELPH 340? I'm obviously not a developer and although I have downloaded that file, I haven't tried it yet. You guys and CHDK is awesome! I had an A4000IS with CHDK that I mounted to my quadcopter. I crashed it and couldn't get another A4000IS so I bought the ELPH 340 and then found out there was not CHDK for it. . .

Joe

Re: ELPH 340 (IXUS 265)
« Reply #43 on: 23 / November / 2014, 10:37:10 »
Is that .rar file what I will download to my SD card on my ELPH 340?
That file contains the source code that hardware_hacker created for the ELPH340.  It needs to be compiled to create the necessary files for use with the camera.   I tried just adding it "as is" to a standard built tree but it would not compile.  I didn't have any time to figure out why.
Ported :   A1200    SD940   G10    Powershot N    G16


Re: ELPH 340 (IXUS 265)
« Reply #44 on: 23 / November / 2014, 12:24:15 »
Thanks

Re: ELPH 340 (IXUS 265)
« Reply #45 on: 29 / December / 2014, 14:06:29 »
Hello everyone,

I am new to the scene and just recently purchased a 340HS. I was wondering if anyone has made any progress on this or if H-H has had anymore time to tinker?

I am trying to learn as I go, I've downloaded CHDK-Shell and tried compiling it myself, but when I run the compiler I get

Quote
========== C:\CHDK\TRUNK\TRUNK3661\BIN\LOGS\ERR-IXUS265_ELPH340HS-100A.TXT ==========

C:\CHDK\gcc\bin\gmake.exe[1]: *** No rule to make target `clean'.  Stop.
gmake: *** [clean-recursive] Error 1
C:\CHDK\gcc\bin\gmake.exe[1]: *** No rule to make target `clean'.  Stop.
gmake: *** [clean-recursive] Error 1


For the heck of it, I tried turning on the "Skip GMAKE clean AFTER" and it got rid of one of the two errors. Then I tried turning on the incremental gmake fir and it started giving me errors suggesting that there were some ('s missing in the shooting.h file. After inspecting the file, I found nothing immediately out of place and attempted to recompile. Now I am receiving this:

Quote
========== C:\CHDK\TRUNK\TRUNK3661\BIN\LOGS\ERR-IXUS265_ELPH340HS-100A.TXT ==========

In file .o/fselect.elf:
elf2flt unknown symbol: '_call_via_r3'
elf2flt unknown symbol: '_call_via_r5'
elf2flt unknown symbol: '_call_via_r4'
elf2flt unknown symbol: '_call_via_r6'
elf2flt unknown symbol: '_call_via_r7'
elf2flt unknown symbol: '_call_via_r1'
elf2flt unknown symbol: '_call_via_r2'
C:\CHDK\gcc\bin\gmake.exe[1]: *** [fselect.flt] Error 5
gmake: *** [all-recursive] Error 1


Maybe I am not compiling this properly at all, but if anyone can help that would be great, or if anyone already has a working version for our 340HS/265 it would be awesome.

I am trying to learn about this to see if I can take a stab at porting it. I have usually been pretty good with reverse engineering code in the past, I'm hoping I can do the same here.

Thanks in advance for the help and all the work you have all already done!

*

Offline srsa_4c

  • ******
  • 4451
Re: ELPH 340 (IXUS 265)
« Reply #46 on: 29 / December / 2014, 16:22:31 »
I was wondering if anyone has made any progress on this or if H-H has had anymore time to tinker?
To me it looks like he no longer has any ixus265's.

Quote
I am trying to learn as I go, I've downloaded CHDK-Shell and tried compiling it myself, but when I run the compiler I get
(...)
First, make sure you can compile for any supported camera. You may need to manually retrieve current CHDK code (I'd recommend the release-1_3 branch), and work on that (due to changes on assembla.com CHDK-Shell is no longer able to get the up-to-date source).

Quote
I am trying to learn about this to see if I can take a stab at porting it. I have usually been pretty good with reverse engineering code in the past, I'm hoping I can do the same here.
You can find some information on the http://chdk.wikia.com/wiki/For_Developers page. Currently there is another DIGIC 4+ camera being ported: Ixus145/Elph135
I'm not sure how much help H-H's source is as he hadn't been able to get rid of the compile errors...

Re: ELPH 340 (IXUS 265)
« Reply #47 on: 29 / December / 2014, 19:33:42 »
Thanks for the information! I tried reading through that Page but there is definitely a ton of information to take in. I'll do as you said and try to compile a known working build.

That's good to know, will it be easy to adapt it for the 265/340 once it's completed? I actually have a 135 waiting to be returned because I wanted the features of the 340 lol.


*

Offline srsa_4c

  • ******
  • 4451
Re: ELPH 340 (IXUS 265)
« Reply #48 on: 30 / December / 2014, 11:14:01 »
Thanks for the information! I tried reading through that Page but there is definitely a ton of information to take in.
You don't need to read everything that appears there, of course. Some of that information might be somewhat outdated or incomplete.
Quote
will it be easy to adapt it for the 265/340 once it's completed?
I'm not sure I understand this question.

Nobody is currently working to port the ixus265/elph340. If you want CHDK on this camera, have some skills (basic C, basic ARM assembly) and some free time, there's a good chance that you'll be able to make a port. We can help if you get stuck with something.

The basic process is: make a copy of a new camera's directories in /platform  and /loader, name the copied directory according to your camera model name, and adapt the files inside to your firmware. You'll need disassemblies of the reference firmware and your camera's firmware. You can use either the GPL tools listed on the "for developers" page or IDA if you have access to it.

Re: ELPH 340 (IXUS 265)
« Reply #49 on: 16 / February / 2015, 01:43:49 »
I want chdk on my canon 265 hs and i am willing to hekp the only problem is that i no nothing about programming  :lol so can anybody complete the process of porting left by HH?  ::) bcause the functions included with the camera are only the basic ones :(

 

Related Topics