Canon PowerShot A4000 IS CHDK - CHDK Releases - CHDK Forum

Canon PowerShot A4000 IS CHDK

  • 14 Replies
  • 13214 Views
Canon PowerShot A4000 IS CHDK
« on: 21 / April / 2012, 08:44:28 »
Advertisements
I'm trying to get the CHDK for Canon PowerShot A4000 IS, but I'm unable to find one. Could anyone please help me find the Canon PowerShot A4000 IS CHDK.

I'm also willing to write a CHDK for Canon PowerShot A4000 IS if it doesn't already exist. I'd appreciate if I get help on writing the CHDK too.

Thanks!!

Re: Canon PowerShot A4000 IS CHDK
« Reply #1 on: 21 / April / 2012, 08:56:00 »
I'm trying to get the CHDK for Canon PowerShot A4000 IS, but I'm unable to find one. Could anyone please help me find the Canon PowerShot A4000 IS CHDK.
Sorry - doesn't look like anyone has ported it yet, although someone seems to have started here : a4000 disassembling problem

link> CHDK FAQ : My camera isn't ported yet

Quote
I'm also willing to write a CHDK for Canon PowerShot A4000 IS if it doesn't already exist. I'd appreciate if I get help on writing the CHDK too.
Hopefully you have some experience with software - C and assembler in particular.  Its possible to force your way through without it but I've only seen that done once.  Read carefully through the articles on this wiki page http://chdk.wikia.com/wiki/For_Developers , particulary http://chdk.wikia.com/wiki/Adding_support_for_a_new_camera .  Once you are ready to go,  start a thread on this forum with the title "A4000 Porting Thread" to report your progress and seek assistance.

Good luck and welcome !
« Last Edit: 21 / April / 2012, 09:00:12 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Canon PowerShot A4000 IS CHDK
« Reply #2 on: 21 / April / 2012, 09:01:31 »
A mighty thanks, waterwingz!!!  :D

*

Offline reyalp

  • ******
  • 14125
Re: Canon PowerShot A4000 IS CHDK
« Reply #3 on: 21 / April / 2012, 14:45:29 »
FYI, it looks like user alvm has already done some work on this camera, see http://chdk.setepontos.com/index.php?topic=7940.0

Also, the A4000 uses a new version of dryos (R50) which has some differences from previous versions. If you are going to work on this, you should probably keep an eye on the SX260 thread http://chdk.setepontos.com/index.php?topic=7889.0 since it also uses this dryos version
Don't forget what the H stands for.

Re: Canon PowerShot A4000 IS CHDK
« Reply #4 on: 21 / April / 2012, 15:08:33 »
FYI, it looks like user alvm has already done some work on this camera, see http://chdk.setepontos.com/index.php?topic=7940.0
echo ... :P
Sorry - doesn't look like anyone has ported it yet, although someone seems to have started here : a4000 disassembling problem
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline alvm

  • ***
  • 123
Re: Canon PowerShot A4000 IS CHDK
« Reply #5 on: 22 / May / 2012, 09:10:24 »
I've just started port and met some problem with pass parameter to strlen() function:

Code: [Select]
{
      const char *test_text[] =
      {
        "CHDK'" HDK_VERSION " " BUILD_NUMBER "'" ,
        "Build: " __DATE__ " " __TIME__ ,
        "Camera: " PLATFORM " - " PLATFORMSUB
      };

      unsigned int w;

      for(i = 0; i< 3; i++)
        w = strlen(test_text[i]);
}

w is 0 always.

Code: [Select]
w = strlen(test_text[0]);
w = strlen(tets_text[1]);
w = strlen(test_text[2]);

w is right...

a810 has the same problem (release #0050 [2.59], DIGIC4  for both cams)
« Last Edit: 22 / May / 2012, 09:14:15 by alvm »

*

Offline reyalp

  • ******
  • 14125
Re: Canon PowerShot A4000 IS CHDK
« Reply #6 on: 23 / May / 2012, 01:06:07 »
I'd suggest looking at the disassambly of the function identified as 'strlen' and also of your two test cases above.  Disassembly of your CHDK binary can be found in core/main.dump

The most likely causes I can think of are either something horribly wrong with your toolchain, or what you are calling strlen isn't quite like normal strlen.
Don't forget what the H stands for.

*

Offline alvm

  • ***
  • 123
Re: Canon PowerShot A4000 IS CHDK
« Reply #7 on: 23 / May / 2012, 04:35:29 »
Both examples work fine for a800, a495, ... I'd check strlen() function's body in dump and it the same for a4000 and a800 for example:

a800:
Code: [Select]
sub_FFC04108                            ; CODE XREF: sub_FFC01910+10
                                        ; sub_FFC01910+34...
                CMP     R0, #0
                BXEQ    LR
                MOV     R1, R0

loc_FFC04114                            ; CODE XREF: sub_FFC04108+18
                LDRB    R2, [R1]
                CMP     R2, #0
                ADDNE   R1, R1, #1
                BNE     loc_FFC04114
                SUB     R0, R1, R0
                BX      LR



a4000:

Code: [Select]
sub_FF812E28                            ; CODE XREF: sub_FF811934+10
                                        ; sub_FF811934+34 ...
                CMP     R0, #0
                BXEQ    LR
                MOV     R1, R0

loc_FF812E34                            ; CODE XREF: sub_FF812E28+18
                LDRB    R2, [R1]
                CMP     R2, #0
                ADDNE   R1, R1, #1
                BNE     loc_FF812E34
                SUB     R0, R1, R0
                BX      LR


a800 uses DIGICIII and a4000, a810 use DIGIC4 - perhaps Canon changes some memory managment...
« Last Edit: 23 / May / 2012, 04:40:17 by alvm »

*

Offline reyalp

  • ******
  • 14125
Re: Canon PowerShot A4000 IS CHDK
« Reply #8 on: 24 / May / 2012, 01:17:31 »
a800 uses DIGICIII and a4000, a810 use DIGIC4 - perhaps Canon changes some memory managment...
This doesn't make any sense. There's no memory management going on. The compiler is generating the address and putting it in r0 for strlen. strlen returns it's value in r0.

The function you quoted above is clearly strlen. As long as it gets the right address, it will work. Since that's the only part of the process that is in the canon firmware, there is nothing canon could change that would affect it. Digic version has nothing to do with it, unless your digic spontaneously changes the values of registers.

Either your test case is invalid somehow, or something in your build is very very broken.
« Last Edit: 24 / May / 2012, 01:19:15 by reyalp »
Don't forget what the H stands for.

*

Offline alvm

  • ***
  • 123
Re: Canon PowerShot A4000 IS CHDK
« Reply #9 on: 24 / May / 2012, 04:37:55 »
Quote
Either your test case is invalid somehow, or something in your build is very very broken.

The test code is the same. A compiler is the same. Address of strlen() is right. A800, A495 work fine but A4000, A810 not. What can be wrong? I think the problem is common for some set of functions not only for strlen().

 

Related Topics


SimplePortal © 2008-2014, SimplePortal