CHDK Forum

CHDK Development => General Discussion and Assistance => DryOS Development => Topic started by: Ameglin on 16 / August / 2010, 09:20:15

Title: Powershot A3100 - Porting thread
Post by: Ameglin on 16 / August / 2010, 09:20:15
Ok, let's start.
Firmware:
DUMP_FF810000_A3100_1.00B.BIN - 23.81MB (http://www.zshare.net/download/79399884f6f88283/)
Start adress: 0xFF810000
Just cut it to 8mb and start to disasm
Key/iv, as I saw, is different with the 2009th cameras
Title: Re: Powershot A3100 - Porting thread
Post by: c10ud on 16 / August / 2010, 13:52:58
great find!
http://www.zshare.net/download/7941026873c6c1ed/ (http://www.zshare.net/download/7941026873c6c1ed/) 8mb version
Title: Re: Powershot A3100 - Porting thread
Post by: fe50 on 17 / August / 2010, 01:35:00
Good work; added to the dumps archive...
Added the A3100 1.00B dump from this post (http://chdk.setepontos.com/index.php/topic,5560.msg53784.html#msg53784) (8MB full dump, by Ameglin / c10ud, dumped with reyalP's new CBasic udumper) to the drop.io - chdkdumps3 (http://drop.io/chdkdumps3) backup archive.
  http://drop.io/chdkdumps3/asset/a3100-100b-7z
Thx to the 'dumpers' & uploaders !
Title: Re: Powershot A3100 - Porting thread
Post by: reyalp on 17 / August / 2010, 01:59:59
"DRYOS version 2.3, release #0043"

A new one, the highest previously known was 39 (edit: for P&S, looks like EOS 550D uses this too)

edit:
Looks to me like the key is different by the IV is same as other d4 ?

Also, dancingbits updated.
Title: Re: Powershot A3100 - Porting thread
Post by: Ameglin on 17 / August / 2010, 09:12:57
Dancingbits is correct. I used it as encoder in udumper nudryos and dumped SX210IS&A3100 firmware so I suppose, that other 2010th cameras has the same dancingbits:
http://chdk.setepontos.com/index.php/topic,5045.msg53819.html#msg53819 (http://chdk.setepontos.com/index.php/topic,5045.msg53819.html#msg53819)
Title: Re: Powershot A3100 - Porting thread
Post by: Ameglin on 18 / August / 2010, 07:55:24
I found all LED's using cycling code:
Code: [Select]
#define LED_POWER   0xC0220010
#define LED_AF   0xC0220008
#define LED_AF_ALT           0xC0220009
#define LED_AF_ALT_2        0xC022000A
#define LED_AF_ALT_3   0xC022000B
#define WHITE_SCREEN   0xC0220007
#define WHITE_SCREEN_ALT 0xC0220006
#define FLASH 0xC022000C
AF LED has 4 various adresses
WHITE_SCREEN "LED" powers on display with just white color (has 2 various adresses)
FLASH "LED" shoots flash once
Title: Re: Powershot A3100 - Porting thread
Post by: Ameglin on 19 / August / 2010, 09:13:32
I'm now trying to boot CHDK, and  have a little problem. After executing resetcode/main.c program doesn't jump to core/entry.s
Here some code:
Code: [Select]
resetcode/main.c

void __attribute__((noreturn)) copy_and_restart(void *dst_void, const void *src_void, long length) {

        {
char *dst = dst_void;
                const char *src = src_void;

                if (src < dst && dst < src + length)
                {
                        /* Have to copy backwards */
                        src += length;
                        dst += length;
                        while (length--)
                        {
                            *--dst = *--src;
                        }
                }
                else
                {
                        while (length--)
                        {
                                *dst++ = *src++;
                        }
                }

        }
        asm volatile (

"MRS     R0, CPSR\n"
                 "BIC     R0, R0, #0x3F\n"
                 "ORR     R0, R0, #0xD3\n"
                 "MSR     CPSR, R0\n"
"STM SP!,{R1,R2}\n"
"LDM SP!,{R1,R2}\n"
                 "LDR     R1, =0xC0200000\n"
                 "MOV     R0, #0xFFFFFFFF\n"
                 "STR     R0, [R1,#0x10C]\n"
                 "STR     R0, [R1,#0xC]\n"
                 "STR     R0, [R1,#0x1C]\n"
                 "STR     R0, [R1,#0x2C]\n"
                 "STR     R0, [R1,#0x3C]\n"
                 "STR     R0, [R1,#0x4C]\n"
                 "STR     R0, [R1,#0x5C]\n"
                 "STR     R0, [R1,#0x6C]\n"
                 "STR     R0, [R1,#0x7C]\n"
                 "STR     R0, [R1,#0x8C]\n"
                 "STR     R0, [R1,#0x9C]\n"
                 "STR     R0, [R1,#0xAC]\n"
                 "STR     R0, [R1,#0xBC]\n"
                 "STR     R0, [R1,#0xCC]\n"
                 "STR     R0, [R1,#0xDC]\n"
                 "STR     R0, [R1,#0xEC]\n"
                 "CMP     R4, #7\n"
                 "STR     R0, [R1,#0xFC]\n"
                 "LDMEQFD SP!, {R4,PC}\n"
                 "MOV     R0, #0x78\n"
                 "MCR     p15, 0, R0,c1,c0\n"
                 "MOV     R0, #0\n"
                 "MCR     p15, 0, R0,c7,c10, 4\n"
                 "MCR     p15, 0, R0,c7,c5\n"
                 "MCR     p15, 0, R0,c7,c6\n"
                 "MOV     R0, #0x40000006\n"
                 "MCR     p15, 0, R0,c9,c1\n"
                 "MCR     p15, 0, R0,c9,c1, 1\n"
                 "MRC     p15, 0, R0,c1,c0\n"
                 "ORR     R0, R0, #0x50000\n"
                 "MCR     p15, 0, R0,c1,c0\n"
                 "LDR     R0, =0x12345678\n"
                 "MOV     R1, #0x40000000\n"
                 "STR     R0, [R1,#0xFFC]\n"
                 //"LDR     R0, =sub_FF810000\n"
                 "MOV     R0, #0\n"              // new jump-vector

                 "LDMFD   SP!, {R4,LR}\n"

//"STM SP!,{R1,R2}\n"
//"LDR     R1, =0xC0220000\n"
//"MOV   R2, #0x46\n" //LED_On
//"STR   R2, [R1,#0x10]\n"
//"LDM   SP!,{R1,R2}\n"
                 "BX      R0\n"
                 : : "r"(dst_void) : "memory","r0","r1","r2","r3","r4");
        while(1);
}
I don't know what exactly it can be, but I think it is because last operand "BX R0" doesn't work as it must, or R0 has wrong value. I tried to light LED at the beginning of core/entry.s with this code (it works in other entry's), but had no success:
Code: [Select]
STM SP!,{R1,R2}
LDR    R1, =0xC0220000
MOV   R2, #0x46
STR   R2, [R1,#0xA]
LDM SP!,{R1,R2}
Has anyone ideas why it can be?
Title: Re: Powershot A3100 - Porting thread
Post by: whoever on 19 / August / 2010, 09:30:56
I don't know what exactly it can be, but I think it is because last operand "BX R0" doesn't work as it must, or R0 has wrong value.
It does have a wrong value, as you have "MOV  R0, #0\n" a few lines before BX. I reckon it should be "mov  R0, %0\n" instead.
Title: Re: Powershot A3100 - Porting thread
Post by: Ameglin on 23 / August / 2010, 06:51:33
Thanks! It was my mistake. After changing to MOV R0, %0 jump succeed.
Now I'm trying to adapt boot process to this camera...
Title: Re: Powershot A3100 - Porting thread
Post by: Ameglin on 24 / August / 2010, 05:19:00
For now loader works well. Here it is:
Code: [Select]
loader\a3100\resetcode\main.c:
void __attribute__((noreturn)) copy_and_restart(void *dst_void, const void *src_void, long length) {
        {
char *dst = dst_void;
                const char *src = src_void;

                if (src < dst && dst < src + length)
                {
                        /* Have to copy backwards */
                        src += length;
                        dst += length;
                        while (length--)
                        {
                            *--dst = *--src;
                        }
                }
                else
                {
                        while (length--)
                        {
                                *dst++ = *src++;
                        }
                }
        }
        asm volatile (

"MRS     R0, CPSR\n"
                 "BIC     R0, R0, #0x3F\n"
                 "ORR     R0, R0, #0xD3\n"
                 "MSR     CPSR, R0\n"
//"STM   SP!,{R1,R2}\n"
//"LDR   R1, =0xC0220000\n"
//"MOV   R2, #0x46\n" //Debug LED_on
//"STR   R2, [R1,#0x10]\n"                           //0x10 - Power_LED
//"LDM   SP!,{R1,R2}\n"
                 "LDR     R1, =0xC0200000\n"
                 "MOV     R0, #0xFFFFFFFF\n"
                 "STR     R0, [R1,#0x10C]\n"
                 "STR     R0, [R1,#0xC]\n"
                 "STR     R0, [R1,#0x1C]\n"
                 "STR     R0, [R1,#0x2C]\n"
                 "STR     R0, [R1,#0x3C]\n"
                 "STR     R0, [R1,#0x4C]\n"
                 "STR     R0, [R1,#0x5C]\n"
                 "STR     R0, [R1,#0x6C]\n"
                 "STR     R0, [R1,#0x7C]\n"
                 "STR     R0, [R1,#0x8C]\n"
                 "STR     R0, [R1,#0x9C]\n"
                 "STR     R0, [R1,#0xAC]\n"
                 "STR     R0, [R1,#0xBC]\n"
                 "STR     R0, [R1,#0xCC]\n"
                 "STR     R0, [R1,#0xDC]\n"
                 "STR     R0, [R1,#0xEC]\n"
                 "CMP     R4, #7\n"
                 "STR     R0, [R1,#0xFC]\n"
                 "LDMEQFD SP!, {R4,PC}\n"
                 "MOV     R0, #0x78\n"
                 "MCR     p15, 0, R0,c1,c0\n"
                 "MOV     R0, #0\n"
                 "MCR     p15, 0, R0,c7,c10, 4\n"
                 "MCR     p15, 0, R0,c7,c5\n"
                 "MCR     p15, 0, R0,c7,c6\n"
                 "MOV     R0, #0x40000006\n"
                 "MCR     p15, 0, R0,c9,c1\n"
                 "MCR     p15, 0, R0,c9,c1, 1\n"
                 "MRC     p15, 0, R0,c1,c0\n"
                 "ORR     R0, R0, #0x50000\n"
                 "MCR     p15, 0, R0,c1,c0\n"
                 "LDR     R0, =0x12345678\n"
                 "MOV     R1, #0x40000000\n"
                 "STR     R0, [R1,#0xFFC]\n"
                 //"LDR     R0, =sub_FF810000\n"
                 "MOV     R0, %0\n"              // new jump-vector
                 "LDMFD   SP!, {R4,LR}\n"
                 "BX      R0\n"

                 : : "r"(dst_void) : "memory","r0","r1","r2","r3","r4");
        while(1);
}
Code: [Select]
loader\a3100\resetcode\entry.s:
              .section .entry
MOV     SP, #0x1900
MOV     R11, #0
B copy_and_restart
Code: [Select]
loader\a3100\main.c:
static void __attribute__((noreturn)) shutdown();
static void __attribute__((noreturn)) panic(int cnt);

extern long *blob_chdk_core;
extern long *blob_copy_and_reset;
extern long blob_chdk_core_size;
extern long blob_copy_and_reset_size;


void __attribute__((noreturn)) my_restart()
{
    void __attribute__((noreturn)) (*copy_and_restart)(char *dst, char *src, long length);
    int i;

    for (i=0; i<(blob_copy_and_reset_size/sizeof(long)); i++){
((long*)(RESTARTSTART))[i] = blob_copy_and_reset[i];
    }

    copy_and_restart = (void*)RESTARTSTART;
    copy_and_restart((void*)MEMISOSTART, (char*)blob_chdk_core, blob_chdk_core_size);
//LED_power_on_short();
//LED_power_off();
}

#define LED_PR 0xC0220010


static void __attribute__((noreturn)) shutdown()
{
    volatile long *p = (void*)LED_PR;       // turned off later, so assumed to be power
       
    asm(
         "MRS     R1, CPSR\n"
         "AND     R0, R1, #0x80\n"
         "ORR     R1, R1, #0x80\n"
         "MSR     CPSR_cf, R1\n"
         :::"r1","r0");
       
    *p = 0x44;  // led off.

    while(1);
}


static void __attribute__((noreturn)) panic(int cnt)
{
volatile long *p=(void*)LED_PR;
int i;

for(;cnt>0;cnt--){
p[0]=0x46;

for(i=0;i<0x200000;i++){
asm ("nop\n");
asm ("nop\n");
}
p[0]=0x44;
for(i=0;i<0x200000;i++){
asm ("nop\n");
asm ("nop\n");
}
}
shutdown();
}
Code: [Select]
loader\a3100\entry.s:
MOV     R3, #0x8000   
1:
SUB R3, R3, #1
CMP R3, #0
BNE 1b

// ordinary startup...

MOV     SP, #0x1900
MOV     R11, #0
B my_restart
Code: [Select]
loader\a3100\blobs.s:
    .globl blob_copy_and_reset, blob_copy_and_reset_size
    .globl blob_chdk_core, blob_chdk_core_size

    .section .blob_copy_and_reset
blob_copy_and_reset_start:
    .incbin RESET_FILE
blob_copy_and_reset_end:

    .section .blob_chdk_core
blob_chdk_core_start:
    .incbin CORE_FILE
blob_chdk_core_end:

    .text
blob_chdk_core_size:
    .long blob_chdk_core_end - blob_chdk_core_start
blob_chdk_core:
    .long blob_chdk_core_start

blob_copy_and_reset_size:
    .long blob_copy_and_reset_end - blob_copy_and_reset_start
blob_copy_and_reset:
    .long blob_copy_and_reset_start
And I modified boot.c, so camera now starts normally with spytask, but all hooks don't work yet. My next step will be founding right func addresses (stubs_entry_2.s) and making all hooks work properly.
Title: Re: Powershot A3100 - Porting thread
Post by: Microfunguy on 24 / August / 2010, 14:00:46

#define FLASH   0xC022000C

FLASH "LED" shoots flash once

You are saying that writing the value 0x46 to address 0xC022000C triggers the camera's electronic flash ?
Title: Re: Powershot A3100 - Porting thread
Post by: Ameglin on 24 / August / 2010, 14:46:23
You are saying that writing the value 0x46 to address 0xC022000C triggers the camera's electronic flash ?
Yes (if flash's capacitor is full and battery not low voltage), and the same situation is for sx210 and sd3500, but addresses may be different, because I don't explore deeply that cameras, just used blinker (0xC0220000-0xC02200FF), and flash triggered.
But flash triggers just once, I don't know why, because if &(0xC022000C)==0x46 flash must triggers when capacitor recharge process completed, but recharge time pass and nothing happens. I'll make some experiments with flash tomorrow, and report any results
Title: Re: Powershot A3100 - Porting thread
Post by: Microfunguy on 24 / August / 2010, 15:27:47
Maybe you have to write 0x44 to that location after flash triggers and then 0x46.
Title: Re: Powershot A3100 - Porting thread
Post by: reyalp on 24 / August / 2010, 22:12:46
I would suggest using camera functions to control the flash (once the port is a bit further along, obviously). IMO, it's one of the components more likely to have the capability to do actual damage somewhere. I'd similarly avoid unnecessary poking of random MMIO addresses, although AFAIK no one managed to melt their camera yet doing this.
Title: Re: Powershot A3100 - Porting thread
Post by: Ameglin on 26 / August / 2010, 08:31:54
Maybe you have to write 0x44 to that location after flash triggers and then 0x46.
No, it doesn't work.

Today's progress:
Looks like I found right values for vid_<> fucntions from platform/<camera>/sub/<fw>/lib.c, because draw-funcs (like draw_line, or draw_txt_string) works well, after draw_init() & font_init()

Here is source code for platform/<camera>/sub/<fw>/lib.c:
Code: [Select]
#include "platform.h"
//-- --------------------A3100IS--------------------------

char *hook_raw_image_addr()
{
//found at FFAADCF0
//Near to "CRAW BUFF       %p"
return (char*)(0x1062C660);
}

long hook_raw_size()
{
//found at FFAADD50
//Near to "CRAW BUFF SIZE  %p"
return 0x11CA240;
}

// Live picture buffer (shoot not pressed)
void *vid_get_viewport_live_fb()
{
    void **fb=(void **)0x3BC0;                               // May be not. Found: 0xFF8CD778
    unsigned char buff = *((unsigned char*)0x437C);          // found at FF8CD38C (near string "TgTask")
    if (buff == 0) buff = 2;  else buff--;   
    return fb[buff];
}

// OSD buffer
void *vid_get_bitmap_fb()
{
return (void*)0x103E1000;       // found at FFA0F230
}

// Live picture buffer (shoot half-pressed)
void *vid_get_viewport_fb()
{
return (void*)0x106F3BC0;       //found at FFAAA8E8 (search like for A2000)
}

void *vid_get_viewport_fb_d()
{                 
return (void*)(*(int*)(0x2630+0x48));    // found at FF863AC8 and  (0x48 at FF863AD0)
}

// found at FF8EBC78                 height 240
// found at FF8EBC7C                width 720

long vid_get_bitmap_screen_width()
{
return 720;
}

long vid_get_bitmap_screen_height()
{
return 240;
}


int vid_get_viewport_width()
{
    return 360;                                               
}

long vid_get_viewport_height()
{
    return 240;
}

char *camera_jpeg_count_str()
{
 return (void*)0x76B3C;    // found at FF9A9124, search string: "9999"
}

long vid_get_bitmap_buffer_width() { return 360; }

long vid_get_bitmap_buffer_height() { return 240; }
Title: Re: Powershot A3100 - Porting thread
Post by: Ameglin on 27 / August / 2010, 11:35:48
Some progress for today:
in core/main.c funcs conf_restore() & gui_init() now works, but I commented some conf defs, because of it's funcs crash camera:
Code: [Select]
void conf_load_defaults() {
   ....
    for (i=0; i<CONF_NUM; ++i) {
        #if defined (CAMERA_a3100)
if (i==65)
continue;
if (i==186)
continue;
#endif
....
I have no idea why this crash camera

gui_redraw() in main.c also partially work. But without gui_draw_osd()
Logo (from CHDK/DATA/logo.dat) doesn't work.

And another big problem: fonts are very big. OSD have only about 10x30 lines max. Why it can be? (May be wrong values of vid_get_bitmap_screen_height or vid_get_viewport_height in platform/<camera>/sub/<fw>/lib.c?)
Title: Re: Powershot A3100 - Porting thread
Post by: ZGecks on 18 / September / 2010, 23:00:49
I got my A3100 IS a while back and was completely underwhelmed by it's features. I would love an update on the progress of this hack! And is there anything I could do to help?
Title: Re: Powershot A3100 - Porting thread
Post by: pixeldoc2000 on 20 / September / 2010, 13:16:01
And another big problem: fonts are very big. OSD have only about 10x30 lines max. Why it can be? (May be wrong values of vid_get_bitmap_screen_height or vid_get_viewport_height in platform/<camera>/sub/<fw>/lib.c?)
Very likely your video buffer stuff is not correct:

platform\a3100\sub\<firmware>\lib.c
Code: (c) [Select]
long vid_get_bitmap_screen_width() { return 960; }
long vid_get_bitmap_screen_height() { return 240; }

int vid_get_viewport_width() { return 360; }
long vid_get_viewport_height() { return 240; }

long vid_get_bitmap_buffer_width() { return 960; }
long vid_get_bitmap_buffer_height() { return 270; }
These are values i currently use on SD4000 (not nesserary correct).

otherwise play with this stuff:
include\camera.h
Code: (c) [Select]
CAM_USES_ASPECT_CORRECTION
CAM_USES_ASPECT_YCORRECTION

ASPECT_XCORRECTION
ASPECT_YCORRECTION

ASPECT_VIEWPORT_XCORRECTION
ASPECT_VIEWPORT_YCORRECTION
Title: Re: Powershot A3100 - Porting thread
Post by: Ameglin on 22 / September / 2010, 06:47:37
Thanks pixeldoc2000!
I changed this:
Code: [Select]
ASPECT_XCORRECTION(x)  ( (x)/2 )   //correction x*screen_buffer_width/screen_width = x*360/720 = x/2And screen now looks pretty good.

Now I'll try to make keymap and kbd staff..
Any links "how to do" or help welcome.  :)
Title: Re: Powershot A3100 - Porting thread
Post by: pixeldoc2000 on 22 / September / 2010, 08:46:06
Now I'll try to make keymap and kbd staff..
Any links "how to do" or help welcome.  :)
Maybe this will get you started...

Keyboard:
http://chdk.setepontos.com/index.php/topic,5574.msg54447.html#msg54447 (http://chdk.setepontos.com/index.php/topic,5574.msg54447.html#msg54447)

Feather:
http://chdk.setepontos.com/index.php/topic,5045.msg54966.html#msg54966 (http://chdk.setepontos.com/index.php/topic,5045.msg54966.html#msg54966)

JogDial:
http://chdk.setepontos.com/index.php/topic,5574.msg55004.html#msg55004 (http://chdk.setepontos.com/index.php/topic,5574.msg55004.html#msg55004)
Title: Re: Powershot A3100 - Porting thread
Post by: mx3 on 23 / October / 2010, 07:09:50
Some nice guy asked me to help with porting.
So I acquired this camera.
Wish me luck :-)

EDIT:
Canon PowerShot A3100 IS
P-ID:31F1 PAL D
Firmware Ver GM1.00D (1.0.0.0)
Adj Ver.004.004
Serial No. :-)

Build: Mar 29 2010 13:50:43
NoError

Total Shoot: 2 :haha
Zoom Retry Count: 0
Mecha Condition: 0x00000000

Mecha Firm Ver. 3.01
MechaDSP Firm Ver. 1.03

Driver Info: 0x00000000
Title: Re: Powershot A3100 - Porting thread
Post by: fe50 on 24 / October / 2010, 16:36:09
Wish me luck :-)
(https://chdk.setepontos.com/proxy.php?request=http%3A%2F%2Fwww.greensmilies.com%2Fsmile%2Fsmiley_emoticons_2thumbs.gif&hash=de3f99169a58de4437714249dd2b45f8) (http://www.greensmilies.com/)
Title: Re: Powershot A3100 - Porting thread
Post by: MauricioRPP on 16 / December / 2010, 20:23:25
i wish you luck too! maybe any new progress on the other 2010 models could help?
Title: Re: Powershot A3100 - Porting thread
Post by: Radeon92 on 31 / December / 2010, 16:50:17
Is there any advances in the process??? I bought one of these cameras, tell me if there is any thing i can do to help you.
Title: Re: Powershot A3100 - Porting thread
Post by: victor on 20 / January / 2011, 10:35:36
Hello Ameglin,

I have a A3100IS camera, the firmware version is 1.00D.

I noticed that you succeed to dump the firmware with the universal method. Would you please to forward your nudryos udumper (and its source code, makefile, etc) to me, so I can dump the firmware?

I knew the Canon Basic method, but I prefered to use your ways.

Thanks.

Dancingbits is correct. I used it as encoder in udumper nudryos and dumped SX210IS&A3100 firmware so I suppose, that other 2010th cameras has the same dancingbits:
http://chdk.setepontos.com/index.php/topic,5045.msg53819.html#msg53819 (http://chdk.setepontos.com/index.php/topic,5045.msg53819.html#msg53819)
Title: Re: Powershot A3100 - Porting thread
Post by: Radeon92 on 28 / January / 2011, 13:02:38
Hello Ameglin,

I have a A3100IS camera, the firmware version is 1.00D.

I noticed that you succeed to dump the firmware with the universal method. Would you please to forward your nudryos udumper (and its source code, makefile, etc) to me, so I can dump the firmware?

I knew the Canon Basic method, but I prefered to use your ways.

Thanks.

Dancingbits is correct. I used it as encoder in udumper nudryos and dumped SX210IS&A3100 firmware so I suppose, that other 2010th cameras has the same dancingbits:
http://chdk.setepontos.com/index.php/topic,5045.msg53819.html#msg53819 (http://chdk.setepontos.com/index.php/topic,5045.msg53819.html#msg53819)

Tell me if there is any thing i can do yo accelerate the process.
Title: Re: Powershot A3100 - Porting thread
Post by: Ameglin on 11 / February / 2011, 10:19:16
Hi!
I'm sorry for this long break, but I've had pretty busy schedule last couple of months because of my work and university, but now I'll try to port this camera asap.

For everyone who want to join this process and to help developing this project, I've created project on unfuddle.com and shared developer account.

Here it is: a3100porting.unfuddle.com
Login: a3100
Password: 9CV0We

Progress for now:
1) CHDK is loading successfully
2) VideoBuffers are correct (we can use "draw" func)
3) Func adresses mostly right (but needed to be checked)
4) DebugPropertySets works well

Main objectives:
1) Keyboard. I think than keymask that I've done is correct, but keyboard are still doesn't work.
2) CHDK Menu. Crash is occure when I try to run menu, needs to be investigated why.\
3) Stubs funcs. Not all of them are found.
Title: Re: Powershot A3100 - Porting thread
Post by: uchihanleader on 31 / March / 2011, 09:30:41
Is there an any progress?
Title: Re: Powershot A3100 - Porting thread
Post by: andre777 on 01 / April / 2011, 05:18:05
Is there an any progress?
Title: Re: Powershot A3100 - Porting thread
Post by: nirah1892 on 16 / May / 2011, 15:04:01
Is there any progress? I'm still waiting for it. :(
Title: Re: Powershot A3100 - Porting thread
Post by: Radeon92 on 21 / May / 2011, 12:36:27
Is there any progress? I'm still waiting for it. :(

Me to, but i dont understand how they do it... i wish i do so i can help them.
Title: Re: Powershot A3100 - Porting thread
Post by: uchihanleader on 23 / September / 2011, 11:50:26
Is anyone working on this project?
Title: Re: Powershot A3100 - Porting thread
Post by: waterwingz on 23 / September / 2011, 17:52:10
Is anyone working on this project?

CHDK FAQ : My camera isn't ported yet (http://chdk.wikia.com/wiki/FAQ#Q._My_camera_isn.27t_ported_yet._Is_a_port_planned.C2.A0.3F_When_will_it_be_ready.C2.A0.3F_How_can_I_help.C2.A0.3F)
Title: Re: Powershot A3100 - Porting thread
Post by: nirah1892 on 15 / February / 2012, 07:19:25
I think the project is closed, right? It's almost over a year without any progress. :( I'd be glad to help but didn't find any tutorial. :(
Title: Re: Powershot A3100 - Porting thread
Post by: reyalp on 15 / February / 2012, 16:40:25
I think the project is closed, right? It's almost over a year without any progress. :( I'd be glad to help but didn't find any tutorial. :(
See the FAQ entry waterwingz posted above. Ports are done by people who have the camera.

Porting is not something that can be done by just following a tutorial. If you are a programmer, see here http://chdk.wikia.com/wiki/Adding_support_for_a_new_camera (http://chdk.wikia.com/wiki/Adding_support_for_a_new_camera)
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 08 / November / 2012, 21:12:05
I'm working on a port for the A3100 IS fw 100d.
NOT working: video (not ported yet), leds
Somewhat working: the readability of chdk's menu
Working: overrides, raw (at least DNG), lua scripts
ALT button is Disp
As soon as i have time i'll upload the sources, available now are a compiled package
<link removed, new version in thread>
and the firmware dump
https://www.box.com/s/lf30fdrvqnwm5dsashfg (https://www.box.com/s/lf30fdrvqnwm5dsashfg)
Title: Re: Powershot A3100 - Porting thread
Post by: waterwingz on 08 / November / 2012, 23:10:31
I'm working on a port for the A3100 IS fw 100d.
Yah !

Quote
NOT working: video (not ported yet), leds Somewhat working: the readability of chdk's menu Working: overrides, raw (at least DNG), lua scripts
Just being able to boot is a big first step.  Sounds like you are way beyond that.

Quote
As soon as i have time i'll upload the sources, available now are a compiled package
There have been ports "lost" in the past due to hard drive failures or porters moving on to other things.  Please post what you have as you go ?


Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 09 / November / 2012, 08:54:30
I can indeed post what i've got;
<link removed, new version in thread> (src)
But i don't have/don't want/never used (and lost a lot by not using) any kind of version managment software (svn, or even diff), so
- i'm depending on others to convert the files to a usable/includable/prepared form
- i won't take advantage of said others by posting updates every 5 minutes ;)

I've updated the package in the link above to a version with video. The 'release notes' are

****************************************

Camera depending notes:

- pre-Alpha version
- video compression/quality settings do not appear to have any effect
- optical zoom in video past optical zoom limit results in not being able to zoom back to 1x
- set_led() not implemented/checked
- dual partition boot routines for cards >4GB included but not tested
- anything that i have not yet checked, and that is a lot!

+ Raw works, including DNG, Dark frame substraction enable/disable
+ Overrides work (camera does something with the settings that is not entirely unexpected from the chosen overrides ;) )
+ Extra long exposures >64s work
+ scripting (lua) seems to work

This built is based on the port for the A3000 (boot, capt_seq, loader) and the port of the A490 (movie_rec, keyboard routines)
Title: Re: Powershot A3100 - Porting thread
Post by: waterwingz on 09 / November / 2012, 09:37:35
But i don't have/don't want/never used (and lost a lot by not using) any kind of version managment software (svn, or even diff), so
- i'm depending on others to convert the files to a usable/includable/prepared form
- i won't take advantage of said others by posting updates every 5 minutes ;)

File looks good - making a patch file for submission to the svn will only take a few seconds when you are ready.
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 09 / November / 2012, 16:19:17
(updated)New version;
Package: <see link below>
Source: <see link below>

Camera depending notes:

- Alpha version
- dual partition boot routines for cards >4GB are included but not tested
- everything that i have not (yet) checked can be broken!

+ Raw works, including DNG, Dark frame substraction enable/disable
+ Overrides work
+ Extra long exposures >64s work
+ Video settings work
+ Zoom in video works
+ scripting (lua) works
+ Simple USB remote shutter works

This built is based on the port of the A3000 (boot, capt_seq, loader) and the port of the A490 (movie_rec, keyboard routines)


Thats about work done  :haha, unless somebody is able to do some testing and posts feedback.
Title: Re: Powershot A3100 - Porting thread
Post by: nafraf on 10 / November / 2012, 06:21:34
Hi, It seems that you are using Face key as ALT button.  My suggestion is to use the standard Playback [>] button as ALT, and let the Face button as configurable option.

You can use the a3300 or a3200 as example.
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 10 / November / 2012, 06:36:23
The current Alt button is 'Disp', i'll see if i can add user configurable alt key working. Thanks for the tip of where to look. Finding stuff in CHDK is 90% of porting a camera..

<edit>
You need to modify ..\core\gui.c&h for this functionality? Then i'm afraid this will have to wait until the source is in the svn so someone with diff possibities ;) can modify it.
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 10 / November / 2012, 17:36:37
Another update;
source: (see link below for latest version)
Full package (fw 100d): (see link below for latest version)
Full package (fw 100b): (see link below for latest version)

Camera depending notes:

- Alpha version
- dual partition boot routines for cards >4GB are included but not tested
- everything that i have not (yet) checked can be broken!

+ Raw works, including DNG, Dark frame substraction enable/disable
+ Overrides work
+ Extra long exposures >64s work
+ Video settings work
+ Zoom in video works
+ scripting (lua) works
+ Simple USB remote shutter works

Alt key is 'Disp'

This built is based on the port of the A3000 (boot, capt_seq, loader) and the port of the A490 (movie_rec, keyboard routines)

History of changes
- Blind port for fw 100b
- Cosmetic changes improving the readability of chdk menu

If anyone would diff the fw 100d & 100b; there should only be changes in addresses above ff8a0000 and maybe some whitespaces and comments (and maybe one or two variables).
Title: Re: Powershot A3100 - Porting thread
Post by: waterwingz on 10 / November / 2012, 17:48:58
You need to modify ..\core\gui.c&h for this functionality?
AFAIR,  just gui.c.
Quote
Then i'm afraid this will have to wait until the source is in the svn so someone with diff possibities ;) can modify it.
Make the changes in your version. Just remind me or whoever makes the change in gui.c when creating the submitted patch file.
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 10 / November / 2012, 21:41:44
Ok, new version;

<links removed, new version available in thread>

Camera depending notes:

- Alpha version
- dual partition boot routines for cards >4GB are included but not tested
- everything that i have not (yet) checked can be broken!

+ Raw works, including DNG, Dark frame substraction enable/disable
+ Overrides work
+ Extra long exposures >64s work
+ Video settings work
+ Zoom in video works
+ scripting (lua) works
+ Simple USB remote shutter works

Alt key is 'Playback', ( best change it so 'Face' in menu)

This built is based on the port of the A3000 (boot, capt_seq, loader) and the port of the A490 (movie_rec, keyboard routines)

History of changes
- fixed free space indicator on lcd
- fixed af scan during video
- added user configurable Alt button (and removed some bugs in kbd.c)
- Blind port for fw 100b
- Cosmetic changes improving the readability of chdk menu

A3150 USERS:
If you have firmware 100b* or 100d you can also use this port!
100b: this was a blind (yet untested) port, so be the first and report the results  ;)
Title: Re: Powershot A3100 - Porting thread
Post by: erautenb on 12 / November / 2012, 11:28:25
Hi I'm new here and am attempting to shoot some time lapses with an A3100IS (firmware 1.00D).  I found this forum and am definitely interested in trying out the hack you guys are working on.  I tried the downloads casrap posted, but for some reason when I turn on my camera with the files on my SD card, unlocked and everything, the firmware update doesn't show up.  Any ideas?  Like I said, I'm new here and am trying out Canon hacks for the first time.  Thanks!
Title: Re: Powershot A3100 - Porting thread
Post by: nafraf on 12 / November / 2012, 12:31:41
Hi, a3100 is under development, version posted by casrap does not contain PS2.FI file. You need to use the bootable sd-card method (http://chdk.wikia.com/wiki/Prepare_your_SD_card#Bootable_SD_Card_Method). 
Title: Re: Powershot A3100 - Porting thread
Post by: ahull on 12 / November / 2012, 16:28:29
Ok, new version;
Alt key is 'Playback', ( best change it so 'Face' in menu)
...

A3150 USERS:
If you have firmware 100b* or 100d you can also use this port!
100b: this was a blind (yet untested) port, so be the first and report the results  ;)

I just tested on my A3150 100d (GM1.00D) I get the CHDK Splash screen, but can't find a way in to the menu, all of the buttons are still working as before.
(I do see the chdk battery meter, memory count etc).

So tantalizingly close  ::) :D thanks for all of your efforts. 
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 12 / November / 2012, 17:32:54
Try starting the camera, press the shutter so you get to record mode and then press the play button (but only short, a long press gets you back to play mode). As soon as you can get into the menu go to chdk setting and change the Alt key to 'Face' or 'Disp'.
When the camera starts up in play and you press play too long the camera shuts off, so its best to try in record mode. You can recognize Alt mode by the 'Alt' text at the bottom centered on the LCD. As soon as you see it press menu to enter chdk menu.
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 12 / November / 2012, 17:41:27
This description above was ment for ppl new to chdk, i assume you've used chdk before?
Comparing the rom dumps from the 3100 and the 3150 both should work with this port, but then again i might be wrong ;)
If you absolutly can't get it into alt mode let me know, i can change the default alt key to something else.
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 12 / November / 2012, 19:39:02
New release that fixes Alt key problem;

(updated links)
src: https://www.box.com/s/j4jbnt48hpc1iljvl0kk (https://www.box.com/s/j4jbnt48hpc1iljvl0kk)
Package for A3100/A3150 firmware 100b (untested): https://www.box.com/s/e75ewnmcd8ur4zkjse0w (https://www.box.com/s/e75ewnmcd8ur4zkjse0w)
Package for A3100/A3150 firmware 100d: https://www.box.com/s/onh14frtirntfx2hatdi (https://www.box.com/s/onh14frtirntfx2hatdi)

Any feedback is welcome!

Camera depending notes:

- The version for fw 100b is an pre-alpha version, it has not been tested at all, be the first!

+ dual partition boot for cards >4GB tested and works
+ Raw works, including DNG, Dark frame substraction enable/disable
+ Overrides work
+ Extra long exposures >64s work
+ Video settings work
+ Zoom in video works
+ scripting (lua) works
+ Simple USB remote shutter works

Default Alt key is 'Face/Print'
Install using the Bootable_SD_Card_Method (http://chdk.wikia.com/wiki/Prepare_your_SD_card#)

This built is based on the port of the A3000 (boot, capt_seq, loader) and the port of the A490 (movie_rec, keyboard routines)

History of changes
- cosmetic changes to the colors used by chdk
- fixed another bug in kbd.c preventing alt mode on formatted card
- fixed free space indicator on lcd
- fixed af scan during video
- added user configurable Alt button (and removed some bugs in kbd.c)
- Blind port for fw 100b
- Cosmetic changes improving the readability of chdk menu
Title: Re: Powershot A3100 - Porting thread
Post by: ahull on 13 / November / 2012, 06:27:20
Thanks for that update casrap, it seems to have done the trick.

I should get a chance to run some of the test scripts on my A3150 Build 100d later today, but I can now load up the menus.
Title: Re: Powershot A3100 - Porting thread
Post by: ahull on 13 / November / 2012, 09:34:43
First impressions are that it is stable on the A3150, I ran setmode.lua, which fails on one test (Set mode P) log is attached.

Lua Lib tests pass. (LLIBTST.LUA)
RomLog dumper works (and rather worryingly there was a romlog to dump, but its from 2010, so no worries there)
drawtest.lua works (colours are a little odd, but we can blame Canon for that  :blink:).
hdr script works
motion detection script works
inervalometer works.
DNG Raw shooting works, badpixel creation works. File is readable in RawTherapee, looks *very* good  :D
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 13 / November / 2012, 09:48:32
According to the firmware the mode maps are the same for the a3100 and the a3150. On the a3100 the test passes. Can you try again with parameter 'mode change delay' set to 3000?

<edit> or turn the flash off in P mode, i think that is causing the fail (charging the flash takes a lot of time).
<edit2> but then you will get an error on another mode that uses the flash.
You can also try to start the script from record mode while P is selected.
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 13 / November / 2012, 10:22:36
About the odd colors; if you go to the Alt menu->chdk settings->color settings->draw palette you can see what colors are available. While in record mode they look nice (be it without any red), but in play mode they are terrible (no red and no blue). The default selection is at least readable in both modes, but not very pleasant to look at.
It will not be easy to find a better color selection for both modes :(
Title: Re: Powershot A3100 - Porting thread
Post by: waterwingz on 13 / November / 2012, 10:33:30
It will not be easy to find a better color selection for both modes :(
You will probably want to implement the customized palette code for this camera. 

Grep for #define CAM_LOAD_CUSTOM_COLORS 1  (the A1200 implements it for example).
Title: Re: Powershot A3100 - Porting thread
Post by: ahull on 13 / November / 2012, 10:47:47
According to the firmware the mode maps are the same for the a3100 and the a3150. On the a3100 the test passes. Can you try again with parameter 'mode change delay' set to 3000?

<edit> or turn the flash off in P mode, i think that is causing the fail (charging the flash takes a lot of time).
<edit2> but then you will get an error on another mode that uses the flash.
You can also try to start the script from record mode while P is selected.

OK, switching off the flash did the trick. Test passes. Thanks.
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 13 / November / 2012, 11:01:37
Quote
You will probably want to implement the customized palette code for this camera. 

Grep for #define CAM_LOAD_CUSTOM_COLORS 1  (the A1200 implements it for example).
Already working on better colors, but the cam misses the palette functions that are present in newer cameras.
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 13 / November / 2012, 11:27:05
OK, switching off the flash did the trick. Test passes. Thanks.

Great, thanks for the test. It seems the cameras are identical.
Title: Re: Powershot A3100 - Porting thread
Post by: ahull on 13 / November / 2012, 12:05:26
OK, switching off the flash did the trick. Test passes. Thanks.

Great, thanks for the test. It seems the cameras are identical.

I thought they had to be pretty similar since they have the same P-ID, hence my earlier comment "Note: the Powershot A3150 IS has the same P-ID (31f1) as the A3100 IS, ... " when I dumped the ROM.  (http://chdk.wikia.com/wiki/A3100IS (http://chdk.wikia.com/wiki/A3100IS))

Looks like a bit of re-badging by the Canon marketing team.

I have attached a rather boring HDR image taken using this A3150 ver 1.00D just to prove it all works.  :D
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 13 / November / 2012, 15:31:05
Nice picture!
I've uploaded a new version with (much) improved colors. If you want to use the new colors and you have used a previous version on the same card it is best to reset options to default in chdk options.
I feel the port for 100d has reached beta status and could be included on the svn, but the version for the 100a is still untested...
Title: Re: Powershot A3100 - Porting thread
Post by: ahull on 13 / November / 2012, 17:34:20
How do I download the new version? Have you updated the previous links, or do I need to check out the SVN and compile?


Happy Diwali - any excuse for another HDR image from my new toy :)
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 13 / November / 2012, 17:44:44
I've updated the links in the previous post, so just download again, install, erase settings and you are done ;)

Edit:
Dual partition boot confirmed working as is.
Title: Re: Powershot A3100 - Porting thread
Post by: waterwingz on 13 / November / 2012, 20:36:01
I feel the port for 100d has reached beta status and could be included on the svn, but the version for the 100a is still untested...
Here's the necessary patch files (attached) for release-1_1 and the dev trunk.  I've built distribution files from those and posted them  here (https://www.box.com/s/p7hys8r5woksiykya4et) so that you can verify the different versions.

I rolled your patches for adjustable <ALT> key and new palette colors into the appropriate files.   I had to fix a few non-ASCII characters in lib.c that were dragged in with the dissassembly code.   I also did not try to create an A3150 version.

There is no 100a version but I included the 1.00b & 1.00d versions that were in your code.  If its the 1.00b that is untested then camera_version.csv should be modified to say SKIP_AUTOBUILD for that one (you can just edit the patch files and insert the text but make sure you use a unix format editor)

Submit them here if you are happy with them : http://chdk.setepontos.com/index.php?topic=650.0 (http://chdk.setepontos.com/index.php?topic=650.0)
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 13 / November / 2012, 21:17:18
The a3100 and the a3150 are the same camera and use the same port. I'll look at the files, and will also add the 'SKIP_AUTOBUILT' for the 100b version (not tested, blind port, chances are there is something wrong with it). Is there a 100a rom? If so i'll port it soon  :D

Thanks!
Title: Re: Powershot A3100 - Porting thread
Post by: waterwingz on 13 / November / 2012, 21:24:03
The a3100 and the a3150 are the same camera and use the same port.
The ixus115 & ixus117 are like this too - same camera in a different colored body. Only the ixus115 is in the autobuild but there is a note on the wiki page for that camera about it.

Quote
I'll look at the files, and will also add the 'SKIP_AUTOBUILT' for the 100b version (not tested, blind port, chances are there is something wrong with it).
Ummm ... 'SKIP_AUTOBUILD' ....

Quote
Is there a 100a rom? If so i'll port it soon  :D
I only mentioned 100a because you mentioned it in your earlier post  @ <Reply #60 on: Today at 01:31:05>
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 13 / November / 2012, 21:41:57
I'll check the spelling ;)
The 100a must have been a typo, thats also the reason i would like to see at least the source on the svn, at times i can get sloppy and before you know it i can start all over again ;)
Title: Re: Powershot A3100 - Porting thread
Post by: waterwingz on 13 / November / 2012, 22:00:16
I'll check the spelling ;)
The 100a must have been a typo, thats also the reason i would like to see at least the source on the svn, at times i can get sloppy and before you know it i can start all over again ;)
Tortoise SVN is pretty easy to use on Windows.   But sync'ng nicely with CHDK-Shell is a little tricky.  On Windows I finally setup batch build files to work with the CHDK-Shell toolchain against a downloaded svn repository.   Then I switched back to Linux using the toolchain from the autobuild (courtesy of hacki) with bash scripts and command line svn.  I've never looked back.

You're welcome to all those files if you want to go down any of those routes.
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 13 / November / 2012, 22:14:19
I'll keep it in mind, but i would first have to break a thick concrete mental wall i build around my idea of software developing (everything in one file if possible, do not install bloatware, or software that end up bloating my system). I'm more a 1980's guy ;)

<edit> But i couldn't ressist to take a look at tortoise, it looks easy enough so i'll start experimenting a bit and see if this old dog can learn new tricks..
Title: Re: Powershot A3100 - Porting thread
Post by: waterwingz on 13 / November / 2012, 22:39:10
I'll keep it in mind, but i would first have to break a thick concrete mental wall i build around my idea of software developing (everything in one file if possible, do not install bloatware, or software that end up bloating my system). I'm more a 1980's guy ;)
We were building fairly complex systems (mostly in assembler & C) back at the start of the 1980's that worked better in many small files.  Things built faster when you did not need to recompile everything - just the module you were working on - and the link it all together.

Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 13 / November / 2012, 22:44:00
My software has to fit in 4kB-16kB, the source can't get very big. The last time i had to use more than 3 files was in the 90's for a computer othello prg..
Title: Re: Powershot A3100 - Porting thread
Post by: waterwingz on 13 / November / 2012, 22:52:16
My software has to fit in 4kB-16kB, the source can't get very big. The last time i had to use more than 3 files was in the 90's for a computer othello prg..
We used to dream about have 2732's & 2764's instead of the 3 voltage 2708's we were stuck with .... :haha

Meanwhile, I've attached new patch files with fixes for SKIP_AUTOBUILD and corrected PLATFORMID values.
Title: Re: Powershot A3100 - Porting thread
Post by: ahull on 14 / November / 2012, 12:12:37
We used to dream about have 2732's & 2764's instead of the 3 voltage 2708's we were stuck with .... :haha

Ahhh fun days, hours spent UV erasing EPROMS, (Warning: Don't stare into the eraser with your remaining good eye).

...all so we could put the latest magic boot firmware (or hacked up peripheral driver) into some over priced Unix machine that some clown would pour coffee into a week or so later so we could come out and replace the same parts again...  >:(

The other thing I seemed to spend my life replacing in those days were 1488 and 1489 serial line drivers.... soldered onto the PCB naturally. I once managed to set fire to the customer's carpet doing that, fortunately over priced Unix machines were very heavy, and could be heaved conveniently on top of burnt carpet, with little chance that the damage would be discovered till long after I had gone....

Back on topic though, that latest build looks fine, all tests pass, colo(u)rs look ok, carpet is unburnt.     ;)

Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 14 / November / 2012, 16:40:33
I've spent almost 3 hours switching from play to record mode and back comparing the palette and selecting colo(u)rs. I can't get them any better. The only place where you get to see true red, green and blue is in the extended histogram (RGB All and R G B). The other colors are approximations that don't make anything unreadable, and where possible selected also on transparancy (so for instance the histogram doesn't hide most of the live view)
The patches are posted and will appear on the autobuild soon i guess (only the 100d, the 100b is untested)

<edit> just remembered true RGB in histo was also sacrificed for better display in play mode.
Title: Re: Powershot A3100 - Porting thread
Post by: ahull on 16 / November / 2012, 12:23:32
OK, I've done quite a bit of experimenting and testing and I'm more than happy with this. Short and long exposures (>64s) work (I'm going to have a play with that as soon as we get a clear night and I can see some stars). In fact I haven't found anything so far that doesn't work. 

Thanks once again casrap, waterwingz and everyone else involved.
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 16 / November / 2012, 17:37:26
Good to hear, i didn't notice any strange behaviour either.
Title: Re: Powershot A3100 - Porting thread
Post by: ahull on 25 / November / 2012, 12:52:54
Just had a chance to play with some long exposures, looks fine. Didn't do any formal testing, just shot off a few pictures with CHDK shutter set for 80s,  and the shutter stayed open for a convincingly long time  :)  The A3150 sees quite well in the dark it seems, better than me, thats for sure.

Another 3 exposure HDR, this time of the last of the twilight, shot with the standard CHDK HDR.LUA script (camera (A3150) was sitting on a fence post, so perhaps not absolutely level), and post processed with Luminance HDR.
Tonight  looks like being a good night to for some star trails and moving tail lights (and probably mild hypothermia :P).

Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 25 / November / 2012, 16:06:39
Good luck tonight! If you can then use darkframe substraction to reduce the nasty ampglow. For star trails i would not use that as you would get dotted lines instead of trails ;)
Title: Re: Powershot A3100 - Porting thread
Post by: ahull on 26 / November / 2012, 16:30:25
For the start trails, I was going to use something like this...

http://linuxdarkroom.tassy.net/star-trail-image-stacking/ (http://linuxdarkroom.tassy.net/star-trail-image-stacking/)

... however real life got in the way... so it'll have to wait for another night.  :D

If I get any usable results, I'll post them (or a link) here.
Title: Re: Powershot A3100 - Porting thread
Post by: rtkomar on 13 / December / 2012, 08:18:52
Hi.. What about the 100b version of A3100? I have that one.. Is the build still under construction? I saw that there is an untested bootable sd card version. What about firmware version?
Is there a guide about how to build CHDK for cameras? Is it so difficult? I want to learn about it.
Title: Re: Powershot A3100 - Porting thread
Post by: nafraf on 13 / December / 2012, 17:42:27
Hi.. What about the 100b version of A3100? I have that one.. Is the build still under construction? I saw that there is an untested bootable sd card version. What about firmware version?
casrap (http://chdk.setepontos.com/index.php?action=profile;u=24266) ported 100b, but it was not tested. Check reply 64 (http://chdk.setepontos.com/index.php?topic=5560.msg93164#msg93164) of this thread.  Source is available in svn repository.

Quote
Is there a guide about how to build CHDK for cameras? Is it so difficult? I want to learn about it.
For_Developers (http://chdk.wikia.com/wiki/For_Developers)
Compiling the CHDK under GNU/Linux (http://chdk.wikia.com/wiki/Compiling_CHDK_under_Linux)
Compiling the CHDK under Mac OS X (http://chdk.wikia.com/wiki/Compiling_CHDK_under_Mac_OS_X)
Compiling the CHDK under Windows (http://chdk.wikia.com/wiki/Compiling_CHDK_under_Windows)
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 13 / December / 2012, 20:23:48
So the 100b firmware really exists :D
Can you let us know if the port works or not?
Title: Re: Powershot A3100 - Porting thread
Post by: Nonatoka on 04 / January / 2013, 14:04:00
Hi! It's really nice to see that you people are working at the A3100, sadly CHDK doesn't work with my precious cam, as it has a firmware 1.00A.
I beg the masters of bits and bytes to check if you can port CHDK also to this firmware.
I've dumped the 1.00A-firmware to: DUMP_FF810000_A3100_1.00A.BIN.7z - 1.7 Mb (http://www2.zshare.ma/japb1dseesc7)
Thanks and Greetz!
Title: Re: Powershot A3100 - Porting thread
Post by: fe50 on 05 / January / 2013, 05:54:11
Hello & welcome, Nonatoka !

Thanks for the dump...
Added the
  • A3100 1.00A
full 8MB dump (dumped with cBasic udumper) by Nonatoka from  this forum post (http://chdk.setepontos.com/index.php?topic=5560.msg95263#msg95263) to the  CHDK P&S FW dumps (http://tinyurl.com/chdkfiles) repository.
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 05 / January / 2013, 10:32:01
CHDK ported to 100a, full package (use bootable sdcard method to install);
<links removed, see below>

Source (if working to be included in the trunk by some kind soul);
<links removed, see below>

Please remember to leave feedback!
Title: Re: Powershot A3100 - Porting thread
Post by: waterwingz on 05 / January / 2013, 10:52:38
Source (if working to be included in the trunk by some kind soul);
https://www.box.com/s/tmq2zq8kmi9dga6sn21u (https://www.box.com/s/tmq2zq8kmi9dga6sn21u)
Built a patch file for you from this. Submit it when you are ready.

Have you looked at using the svn tools for this (TortoiseSVN for window) ?
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 05 / January / 2013, 13:31:32
I tried tortoise, but i don't think its for me. I would only use it for chdk and i'm all out of unsupported camera's.. :P
+ i'm always busy working on other projects.
Title: Re: Powershot A3100 - Porting thread
Post by: Nonatoka on 05 / January / 2013, 16:13:59
Wow, you're are faster than light!
Thanks to fe50 and casrap for all the work!
But sadly the firmware doesn't work as intended...  :'(
I've used the "LICKS"-Java-programm to format (FAT16) and copy the data from the full package. I hope that I did everything right. - If you want to check; there is an image of the sdcard that I'm using here (http://www2.zshare.ma/iqzk0ih8wzl2) (756.0 Kb/2.0 Gb).
If the cam is started (lock to "on") there is a very short time of displaying build number, date and target "A3100 100a" - most times only partially - and then the cam just switches off, independent of pushing the buttons play or on. If I push "on" long time the lens starts to move but stops suddendly - next cycle I've got quite disturbing sounds from the motor/gears. I can also activate the clock by pressing func on start up - lasts about 2s before shut down, too.
Anyhow - If I put the lock to off, the cam starts normally.
Are there any special bits to activate some kind of "crash message"? I had understand that the "update firmware" method needs another build, could this show some additonal information? The DISKBOOT.BIN of 100a is quite smaller than 100d. Is this ok?
Thanks again and greetz!
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 05 / January / 2013, 16:38:52
I'll check the source once more in a few hours. I'll keep you updated.
..
..
I've found a missed copy&paste of a call to a subroutine in boot.c, try this updated package;
https://www.box.com/s/8f63cd7k09cct7n3675y (https://www.box.com/s/8f63cd7k09cct7n3675y)

(src: https://www.box.com/s/bjf1cr8ek22zqdlmo69v (https://www.box.com/s/bjf1cr8ek22zqdlmo69v))
Title: Re: Powershot A3100 - Porting thread
Post by: Nonatoka on 06 / January / 2013, 12:06:54
Thanks for this fast bugfixing!
I would say, we are almost there... Now I do see the CHDK-logo and the full build/version text ... but after that the cam switches off. I did a small movie (1.6 Mb) (http://www2.zshare.ma/6qo2zf057dce) to show the behaviour.
Do you want to check the sources again, or is there anything I can do from here?
Title: Re: Powershot A3100 - Porting thread
Post by: srsa_4c on 06 / January / 2013, 12:22:14
... or is there anything I can do from here?
You could try to get a romlog (http://chdk.wikia.com/wiki/Canon_Basic/Scripts/Romlog), there's a chance that it would help.
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 06 / January / 2013, 13:56:54
A romlog would help, but you will need to setup your sdcard for scripting. I'll do a re-port of the boot.c file, thats the only one where i kept the source for the 100d and only adjusted the function calls. I'll also disable some hooks so that it should boot as bare as possible, so we can add functionality after each confirmed working boot.
Title: Re: Powershot A3100 - Porting thread
Post by: Nonatoka on 06 / January / 2013, 14:22:30
Well, I have a spare sdcard to mess around with. ;)
This romlog is a nice script. I start the cam with CHDK pressing play, exchanged the sdcard with the script-card and here is the output:
Code: [Select]
Exception!! Vector 0x04
Occured Time  2013:01:06 21:17:19
Task ID: 12451866
Task name: SpyTask
Exc Registers:
0x00000001
0x000037BC
0x00148CE7
0x0014AE27
0x00169B2C
0x00169164
0x00148B09
0x00169B2C
0x19980218
0x19980218
0x19980218
0x19980218
0x80000000
0x00309F7C
0x00000B3D
0x00031ABC
0x20000013
StackDump:
0x002F2DEC
0x19980218
0x19980218
0x19980218
0xFF8170E0
0x19980218
0x19980218
0x00001008
00000050: *** Camera Log Start ***

00000060: UI:Button:0x000010B4:WriteEnableMedia

00000080: UI:_BeforeCBRForPlay

00000080: UI:_AfterCBRForPlay

00000080: UI:DSIC:55,0

00000080: UI:LogicalEvent:0x5003:adr:0,Para:0

00000080: UI:LogicalEvent:0x1165:adr:0,Para:0

00000080: UI:_SImage

00000080: UI:SetPanelBrightnessToLcdController

00000080: UI:SetDisplayType

00000080: UI:TurnOnDisplayForStartup

00000080: UI:LogicalEvent:0x5007:adr:0,Para:0

00000150: SS:S-Imag

00000170: UI:ScreenLock

00000170: UI:ScreenUnLock

00000200: UI:LogicalEvent:0x300a:adr:0,Para:0

00000200: UI:PB.Create

00000210: UI:DispSwCon_TurnOnBackLight

00000210: UI:TurnOnBackLight

00000220: UI:LogicalEvent:0x5001:adr:0,Para:0

00000270: UI:LogicalEvent:0x5006:adr:0,Para:0

00000290: UI:DispSwCon_MuteOffPhysicalScreen

00000290: UI:MuteOffPhysicalScreen

00000290: UI:LogicalEvent:0x3138:adr:0,Para:0

00000380: UI:LogicalEvent:0x112c:adr:0,Para:0

00000410: UI:ScreenLock

00000410: UI:ScreenUnLock

00000450: UI:PB.CreateE

00000450: UI:AC:StartPB

00000450: UI:DispSwCon_TurnOnDisplayDevice

00000450: UI:AC:EBtn

00000450: UI:PB.Start

00000450: UI:DSIC:47,0

00000450: UI:CC_CompFlhJpg

00000450: UI:_CompFlhJpg

00000450: UI:PB.Flash

00000450: UI:ScreenLock

00000460: UI:LogicalEvent:0x321f:adr:0,Para:0

00000460: UI:DSIC:47,0

00000460: UI:ScreenUnLock

00000510: UI:LogicalEvent:0x320a:adr:0,Para:0
I hope this helps.
Title: Re: Powershot A3100 - Porting thread
Post by: reyalp on 06 / January / 2013, 16:03:53
This is an undefined instruction in spytask. That suggests a bad code pointer or memory corruption.

edit:
If you have the main.dump associated with this build, the PC and stack should give you a very good idea of where to look.
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 06 / January / 2013, 16:06:08
Try this one;
https://www.box.com/s/6u692hzfs80p47l91gc9 (https://www.box.com/s/6u692hzfs80p47l91gc9)

(src: https://www.box.com/s/jxnvr8371eh94ildy8kr (https://www.box.com/s/jxnvr8371eh94ildy8kr))

If it still does not work i'll create a stripped version for you to try.

@reyalp;
i found another unpatched call in boot.c, i think thats what caused the exception. Once the boot.c is ok the rest should work (capt_seq & movie_rec are built from scratch, i copied and hand-patched boot.c)
Title: Re: Powershot A3100 - Porting thread
Post by: Nonatoka on 06 / January / 2013, 16:22:39
Hm, sadly not really better. If I start the cam I can see the logo slightly longer but nothing more.
Here the output of the script-card:
Code: [Select]
Exception!! Vector 0x04
Occured Time  2013:01:06 23:16:20
Task ID: 12451866
Task name: SpyTask
Exc Registers:
0x00000001
0x000037BC
0x00148CE7
0x0014ADEB
0x00169AF4
0x0016912C
0x00148B09
0x00169AF4
0x19980218
0x19980218
0x19980218
0x19980218
0x80000000
0x00309F7C
0x00000B3D
0x00031ABC
0x20000013
StackDump:
0x002F2DEC
0x19980218
0x19980218
0x19980218
0xFF8170E0
0x19980218
0x19980218
0x00001008
00000050: *** Camera Log Start ***

00000060: UI:Button:0x000010B4:WriteEnableMedia

00000080: UI:_BeforeCBRForPlay

00000080: UI:_AfterCBRForPlay

00000080: UI:DSIC:55,0

00000080: UI:LogicalEvent:0x5003:adr:0,Para:0

00000080: UI:LogicalEvent:0x1165:adr:0,Para:0

00000080: UI:_SImage

00000080: UI:SetPanelBrightnessToLcdController

00000080: UI:SetDisplayType

00000080: UI:TurnOnDisplayForStartup

00000080: UI:LogicalEvent:0x5007:adr:0,Para:0

00000150: SS:S-Imag

00000170: UI:ScreenLock

00000170: UI:ScreenUnLock

00000200: UI:LogicalEvent:0x300a:adr:0,Para:0

00000200: UI:PB.Create

00000210: UI:DispSwCon_TurnOnBackLight

00000210: UI:TurnOnBackLight

00000220: UI:LogicalEvent:0x5001:adr:0,Para:0

00000270: UI:LogicalEvent:0x5006:adr:0,Para:0

00000290: UI:DispSwCon_MuteOffPhysicalScreen

00000290: UI:MuteOffPhysicalScreen

00000290: UI:LogicalEvent:0x3138:adr:0,Para:0

00000380: UI:LogicalEvent:0x112c:adr:0,Para:0

00000410: UI:ScreenLock

00000410: UI:ScreenUnLock

00000450: UI:PB.CreateE

00000450: UI:AC:StartPB

00000450: UI:DispSwCon_TurnOnDisplayDevice

00000450: UI:AC:EBtn

00000450: UI:PB.Start

00000450: UI:DSIC:47,0

00000450: UI:CC_CompFlhJpg

00000450: UI:_CompFlhJpg

00000450: UI:PB.Flash

00000450: UI:ScreenLock

00000460: UI:LogicalEvent:0x321f:adr:0,Para:0

00000460: UI:DSIC:47,0

00000460: UI:ScreenUnLock

00000510: UI:LogicalEvent:0x320a:adr:0,Para:0
And thanks to all that are helping with this port! :)
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 06 / January / 2013, 16:43:43
Try this one next <links removed, see below>
The overrides do not work but the menu (if you can get there) should work.

Also try this one <links removed, see below>
My guess is the 2nd one will work (without overrides).
Title: Re: Powershot A3100 - Porting thread
Post by: Nonatoka on 06 / January / 2013, 17:45:08
No, sadly not. If I switch on I can use the cam for a short while (ca. 4s) then the CHDK-logo appears and the cam switches off.
I did the romlog again:
Code: [Select]
Exception!! Vector 0x04
Occured Time  2013:01:07 00:36:33
Task ID: 12451866
Task name: SpyTask
Exc Registers:
0x00000001
0x000037BC
0x00148CE7
0x0014ADEB
0x00169A4C
0x00169084
0x00148B09
0x00169A4C
0x19980218
0x19980218
0x19980218
0x19980218
0x80000000
0x00309F7C
0x00000B3D
0x00031ABC
0x20000013
StackDump:
0x002F2DEC
0x19980218
0x19980218
0x19980218
0xFF8170E0
0x19980218
0x19980218
0x00001008
00000050: *** Camera Log Start ***

00000060: UI:Button:0x000010B4:WriteEnableMedia

00000080: UI:_BeforeCBRForPlay

00000080: UI:_AfterCBRForPlay

00000080: UI:DSIC:55,0

00000080: UI:LogicalEvent:0x5003:adr:0,Para:0

00000080: UI:LogicalEvent:0x1165:adr:0,Para:0

00000080: UI:_SImage

00000080: UI:SetPanelBrightnessToLcdController

00000080: UI:SetDisplayType

00000080: UI:TurnOnDisplayForStartup

00000080: UI:LogicalEvent:0x5007:adr:0,Para:0

00000150: SS:S-Imag

00000170: UI:ScreenLock

00000170: UI:ScreenUnLock

00000200: UI:LogicalEvent:0x300a:adr:0,Para:0

00000200: UI:PB.Create

00000210: UI:DispSwCon_TurnOnBackLight

00000210: UI:TurnOnBackLight

00000220: UI:LogicalEvent:0x5001:adr:0,Para:0

00000270: UI:LogicalEvent:0x5006:adr:0,Para:0

00000290: UI:DispSwCon_MuteOffPhysicalScreen

00000290: UI:MuteOffPhysicalScreen

00000290: UI:LogicalEvent:0x3138:adr:0,Para:0

00000380: UI:LogicalEvent:0x112c:adr:0,Para:0

00000400: UI:ScreenLock

00000410: UI:ScreenUnLock

00000450: UI:PB.CreateE

00000450: UI:AC:StartPB

00000450: UI:DispSwCon_TurnOnDisplayDevice

00000450: UI:AC:EBtn

00000450: UI:PB.Start

00000450: UI:DSIC:47,0

00000450: UI:CC_CompFlhJpg

00000450: UI:_CompFlhJpg

00000450: UI:PB.Flash

00000450: UI:ScreenLock

00000450: UI:LogicalEvent:0x321f:adr:0,Para:0

00000460: UI:DSIC:47,0

00000460: UI:ScreenUnLock

00000490: UI:LogicalEvent:0x320a:adr:0,Para:0

00000990: UI:ScreenLock

00001000: UI:ScreenUnLock

00001030: UI:LogicalEvent:0x3201:adr:0,Para:0

00001030: UI:PB.StartE

00001040: UI:PB.CTG

00001040: UI:PB.DPOF

00001040: UI:DSIC:48,0

00001040: UI:DispSw: Unlock

00001040: UI:DispSwCon:Unlock

00001040: UI:DispSwCon_TurnOnBackLight

00001040: UI:DispSwCon_MuteOffPhysicalScreen

00001040: UI:MuteOffPhysicalScreen

00001040: UI:AC:EnryPB

00001040: UI:AP:ChkCnctUSB
Seems quite similar... Any clues?
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 06 / January / 2013, 18:40:13
Not yet, but the problem is most likely somewhere in the boot.c file as you cam doesn't even stay on without overrides. I'll go over it once more (will take some time this time).
Title: Re: Powershot A3100 - Porting thread
Post by: reyalp on 06 / January / 2013, 21:03:01
@reyalp;
i found another unpatched call in boot.c, i think thats what caused the exception. Once the boot.c is ok the rest should work (capt_seq & movie_rec are built from scratch, i copied and hand-patched boot.c)
The romlog tells you that the exception occurred in spytask. Spytask doesn't really have any code in boot.c though of course bugs in boot.c could corrupt something used by spytask.

The PC value will tell you exactly where the exception occurred. In the dumps above, this is 0x00031ABC

This seems like a low address for CHDK code, probably meaning a bad pointer earlier sent you there. The LR is 0x00000B3D which seems suspect too. The stack trace in the romlog might help you find out how you got there. 0x002F2DEC would be the obvious place to start.
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 06 / January / 2013, 21:31:46
I knew it was early in the boot process (0xff817xxxx in the stack dump). I have no clue where chdk loads in memory so 0x002F2DEC does not mean much to me :(
But i will find the fault as long as there is someone to test ;)
Title: Re: Powershot A3100 - Porting thread
Post by: Nonatoka on 06 / January / 2013, 22:08:08
...and I will test any new versions gladly.
So take your time; sometimes a nap helps a lot. ;)
Title: Re: Powershot A3100 - Porting thread
Post by: reyalp on 06 / January / 2013, 22:23:30
I knew it was early in the boot process (0xff817xxxx in the stack dump). I have no clue where chdk loads in memory so 0x002F2DEC does not mean much to me :(
CHDK loads at MEMISOSTART

When you build, the chdk build process creates a file called main.dump in the core directory. This is a disassembly of the chdk binary located at the appropriate address. If you are using chdkshell to build, main.dump may be moved to /bin/logs/dump-{cameraname}-{firmware}.txt

Using this, you can match addresses in the romlog to CHDK functions.
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 07 / January / 2013, 11:06:44
The dump only contains a dissasembly for the loader, the rest is
Code: [Select]
00001aac <blob_chdk_core_start>:
    1aac: e3a00002 .word 0xe3a00002
    1ab0: e3300002 .word 0xe3300002
    1ab4: e3a0dc19 .word 0xe3a0dc19
    1ab8: e3a0b000 .word 0xe3a0b000
    1abc: ea001e56 .word 0xea001e56
    1ac0: b081b510 .word 0xb081b510
    1ac4: f0192001 .word 0xf0192001
    1ac8: 4819f829 .word 0x4819f829

Without labels i can't do much with it. CHDK runs from MEMISOSTART + 0x1900?

A question for Nonatoka, did you unpack the entire archive to your SDcard? How many partitions are on it? How big is your card?

Title: Re: Powershot A3100 - Porting thread
Post by: Nonatoka on 07 / January / 2013, 11:37:33
Yes, I've copied all the files from the archive to the single partition (FAT16) on a 2GB Sandisk sdcard. The partition and the "magic words" are done with "LICKS".
Title: Re: Powershot A3100 - Porting thread
Post by: reyalp on 07 / January / 2013, 16:01:02
The dump only contains a dissasembly for the loader
You are looking at the wrong dump. The one you want is in core/main.dump, not loader main.dump
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 07 / January / 2013, 19:11:42
The dump i found (i'm using chdk shell) is dump-a3100-100a.txt from bin/logs, theres no dump in ../core

@Nonatoka
Ok, that narrows it down (to my port hehe). I've re-checked the code in boot.c and compared the source from the disassemblies from the 100d & 100a, and found nothing wrong so either i'm overlooking something or there is something wrong with a stub found by the sigfinder (=very unlikely).
Next i'll do a re-port from scratch for boot.c, that should take care of the overlooking side of things.
The 4 second delay is caused by a watchdog timeout i guess, so its hard to tie the shutting down from the exception to a place in the source where it goes wrong. Your cam only shows the startup logo of chdk, and not the live view?
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 07 / January / 2013, 19:45:07
Ok, new port of boot.c : <link removed, see updated link below>
If it throws the same exception i'll eat my hat.
ps: still stripped of functionality!

Dump file: https://www.box.com/s/9o1qtvtylxmbn6pi39tq (https://www.box.com/s/9o1qtvtylxmbn6pi39tq)

pps: i found a bug in my port of the 100d, and although it didn't hurt the 100d port it may well be responsible for your problem. The bug should also exist in the port of the a490 or a3200 (or whatever camera i used as a template for boot.c, i'll check and fix)
Title: Re: Powershot A3100 - Porting thread
Post by: Nonatoka on 07 / January / 2013, 20:10:45
Whooohaaa! We have a winner here!  :D
CHDK is starting! So far, I just did some simple adjustments, seems stable!
Many thanks, casrap! And what was the itchy bit?
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 07 / January / 2013, 20:15:30
I'll do a non-handicapped version so you can try the overrides.

The problem was a 'classical' chdk mistake (swapped loc_ and sub_) but with an intentional aspect :P
I'm going to see where i got the boot.c template from, the error must be in there too.

Version with overrides: https://www.box.com/s/fy30sqm81kxjux1aeml4 (https://www.box.com/s/fy30sqm81kxjux1aeml4)

(src: https://www.box.com/s/bajsl1dwab6p0hmqevij (https://www.box.com/s/bajsl1dwab6p0hmqevij))
Title: Re: Powershot A3100 - Porting thread
Post by: Nonatoka on 07 / January / 2013, 21:24:23
This version is working, too.
I'd play a little bit with the raw-mode, panorama and the HDR-script - working fine.
There are a lot of features now, the CHDK-menus is quite crowded. I'll check one point after the other and report any hick-ups. That will take some time. :)
Thanks for all the work! I think you can add this port to the gallery.  8)
Title: Re: Powershot A3100 - Porting thread
Post by: Nonatoka on 08 / January / 2013, 19:07:47
I've tested a lot and in conclusion I can say that the port feels really stable and functional.
Congratz, casrap! :)

At the moment I'm playing with all kinds of bracketing, with mixed results. Somehow I can't get my head around this even though the manual is very detailed.
But the additional features are really amazing. I had to recharge the batteries just of walking through the whole menus.

Here are some (minor) issues that I've found so far:
Code: [Select]
ASSERT!! AFScanDriver.c Line 1228
Occured Time  2013:01:08 22:34:50
Task ID: 21168173
Task name: AFTask
SP: 0x00318FA8
StackDump:
0x00000000
0xFF9DA1C4
0x000004CC
0x000A5B24
0x000A6144
0x00000000
0xFF9306F4
0x00000400
0x00000000
0x00000000
0x00000000
0xFF9DA5D0
0x00008004
0xFF9DFC9C
0x00001960
0x00066FCC
0x00000001
0x000040F0
0x0000014A
0x19980218
0x19980218
0x19980218
0x19980218
0xFF8C38D4
0x00066F94
0xFF8C386C
0x00066FCC
0x002F3428
0x19980218
0x19980218
0x19980218
0xFF8170E0
0x19980218
0x19980218
0x00001008
ShootConDump:
01 02 07 00 00 01 02 0f 0f 0f
CameraConDump:
07 0a 02 0d 09 01 0f 0f 0f 0f
00006920: UI:No Change Capture Mode
00006920: UI:DSIC:c4,0
00006920: UI:ScreenLock
00006940: UI:ScreenUnLock
00006940: UI:LogiEvnt_NotPowerType:0x09a4:adr:0,Para:0
00006940: UI:LogiEvnt_NotPowerType:0x09a2:adr:0,Para:0
00010110: UI:DSIC:58,0
00012740: UI:ScreenLock
00012740: UI:DispSwCon_TurnOnDisplayDevice
00012760: UI:ScreenUnLock
00012960: UI:ScreenLock
00012960: UI:ScreenUnLock
00016260: UI:LogicalEvent:0x1163:adr:0,Para:0
00017170: UI:ScreenLock
00017170: UI:ScreenUnLock
00023550: UI:ScreenLock
00023550: UI:ScreenUnLock
00026450: UI:ScreenLock
00026450: UI:ScreenUnLock
00029180: UI:Button:0x000009A1:PressSwOne
00029180: SS:PreBuf
00029180: SS:BitR
00029190: UI:ShootState:0x1
00029190: UI:ShtCon_Activate
00029190: UI:DispSw: Lock
00029190: UI:ShtCon_PrepareCapture
00029190: UI:DSIC:61,0
00029190: UI:ScreenLock
00029190: UI:ScreenUnLock
00029230: UI:ScreenLock
00029230: UI:ScreenUnLock
00029240: UI:LogicalEvent:0x3135:adr:0,Para:0
00029240: SS:LoadTest:10
00029240: SS:PreCapt
00029270: UI:ShootState:0x2
00029270: UI:ClearEventComp
00029810: UI:ShootSeqToUI:0x2006:adr:0x45,Para:69
00029810: UI:ShtCon_SetPreCapt
00029810: UI:DSIC:62,0
00029810: UI:ScreenLock
00029830: SS:StartFcsChk
00029890: UI:ScreenUnLock
00029930: UI:_ResetShootingMode
00029940: UI:_EntryPrepareShoot
00029940: UI:ShootState:0x7
00030660: UI:Button:0x0000085C:PressWideButton
00033700: UI:Button:0x000009A2:UnpressSwOne
00033700: UI:_ExitSequence
00033700: UI:Sht_CancelStrobeChargeTimer
00033700: UI:DSIC:4c,0
00033700: SS:StopFcsChk
00033730: SS:CancelPre
00033980: SS:ChargeComplete
00033980: UI:DispSwCon_MuteOffPhysicalScreen
00033980: UI:MuteOffPhysicalScreen
00033980: UI:ShootState:0x0
00033980: UI:ShtCon_Deactivate
00033980: UI:DSIC:14,0
00033980: UI:DSIC:60,0
00033980: UI:DispSwCon_TurnOnDisplayDevice
00033980: UI:ScreenLock
00034140: UI:ScreenUnLock
00034220: UI:DispSw: Unlock
00034220: UI:DispSwCon:Unlock
00034220: UI:TerminateDeliverToZoomController
00034230: UI:Button:0x000009A1:PressSwOne
00034230: UI:ScreenLock
00034250: UI:ScreenUnLock
00034320: UI:OPTICAL_ZOOM_POS
00034320: UI:PRESS_WIDE_BUTTON
00034320: UI:_EntryIdleShoot
00034320: UI:ShootState:0x0
00034330: SS:PreBuf
00034340: UI:ShootState:0x1
00034350: UI:ShtCon_Activate
00034350: UI:DispSw: Lock
00034350: UI:ShtCon_PrepareCapture
00034350: UI:DSIC:61,0
00034350: UI:ScreenLock
00034350: UI:ScreenUnLock
00034410: UI:ScreenLock
00034410: UI:ScreenUnLock
00034410: UI:LogicalEvent:0x3135:adr:0,Para:0
00034410: SS:LoadTest:10
00034430: SS:PreCapt
00034460: UI:ShootState:0x2
00034460: UI:ClearEventComp
In fact if the fix would be in removing this entry from the menu, at least I wouldn't miss it. ;)
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 09 / January / 2013, 06:25:24
I'll look at the error.
The rest of your points ar not really linked to this firmware/cam version but more general chdk remarks?
(AFAIK there is no camera identification string in the .crw)
Title: Re: Powershot A3100 - Porting thread
Post by: Nonatoka on 09 / January / 2013, 07:11:14
Interesting, so I would guess that UFRaw just estimates that this is a SX20, because of the type of raw format.
Well, the point of shortcut-raw on/off is not that important to me, it's just a little bit confusing. I can switch raw by the CHDK menu easily.
Title: Re: Powershot A3100 - Porting thread
Post by: waterwingz on 09 / January / 2013, 08:49:10
Interesting, so I would guess that UFRaw just estimates that this is a SX20, because of the type of raw format.
Many (most?) image programs that support RAW do so using the dcraw (http://en.wikipedia.org/wiki/Dcraw) libraries.  For CHDK raw images,  new camera are only supported when somebody submits a representative raw image (with color calibration data) from that camera.   As CHDK RAW images contain no format or camera information, its assumed that dcraw looks at the exact file size to identify which camera produced the image.  The file size depends on the sensor format and on how much of the sensor information (# of rows & # of columns) the person doing the port includes in the raw file so the exact size is usually unique to a camera (at least so far).
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 09 / January / 2013, 09:43:33
Nonatoka,
Can you test the zoom function in movie mode?

btw: thanks for the rigorous testing so far  :)

I've checked the source for the a3000 (where i got my boot.c template from), and the error is not in there, so it was my own f*ckup that caused all problems. I'll correct the error in the 100d and 100b firmware version too.
Title: Re: Powershot A3100 - Porting thread
Post by: Nonatoka on 09 / January / 2013, 15:18:13
Yes, the zoom in video recording is working fine. :)
...as well as grid, games, panorama, bracketing (Tv, Ev, Iso incl. series with custom timer), zebra, histogram, raw/dng, custom Iso/Tv, super-fine jpg and the scripts incl. motion detection. And all the other stuff I can't remember right now.

It's my pleasure/for my own good to test. ;)
And from zero to hero in just three rc's is quite smooth in my opinion.

Hopefully someone will test the 100b...

Btw. but maybe also more a CHDK-thing: If I delete a file by the file-browser (pushing disp.), sometimes the directory isn't updated afterwards.
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 09 / January / 2013, 17:45:08
Great, the 100a is as good as the 100d now  :)
The directory (on screen?) not updating must be a chdk feature.
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 10 / January / 2013, 09:25:03
nafraf created a patch with the new loader from Philmoz (http://chdk.setepontos.com/index.php?topic=9027.msg93857#msg93857 (http://chdk.setepontos.com/index.php?topic=9027.msg93857#msg93857)) made by whim. I've tested it and it works (both power up to rec mode and to play mode).
Title: Re: Powershot A3100 - Porting thread
Post by: casrap on 10 / January / 2013, 09:45:09
I've corrected the bug in boot.c for fw 100a,100b and 100d. The link to the source: https://www.box.com/s/k2ef8wyl4kh054pmzpmr (https://www.box.com/s/k2ef8wyl4kh054pmzpmr)

My latest compiled package for the 100a: https://www.box.com/s/qeki6aqss2bswe6k99fz (https://www.box.com/s/qeki6aqss2bswe6k99fz) (unchanged  since previous posting, tested working by Nonatoka).
Title: Re: Powershot A3100 - Porting thread
Post by: cheddar66 on 21 / April / 2013, 20:23:20
I have the a3100 1.00b firmware and would like to test the 1.00b version.  Thanks!
Title: Re: Powershot A3100 - Porting thread
Post by: srsa_4c on 21 / April / 2013, 21:24:11
I have the a3100 1.00b firmware and would like to test the 1.00b version.  Thanks!
Current CHDK 1.1 build attached (use the bootable SD card (http://chdk.wikia.com/wiki/Bootable_SD_card#Bootable_SD_Card_Method) method).
If possible, please test stability (try all possible "extra photo overrides", video overrides, zebra, histogram, ...), and report it. See also http://chdk.wikia.com/wiki/Testing (http://chdk.wikia.com/wiki/Testing)

edit: buggy build removed
Title: Re: Powershot A3100 - Porting thread
Post by: cheddar66 on 21 / April / 2013, 23:55:30
The zebra, histogram, osd, edge overlay, scripts seem to work fine so far. the fast ev switching seems to work okay.

However, I can't get most of the overrides such as shutter speed, nd filter, iso  to work.  It's been a couple years since I used chdk so it could be user error but I don't think so.  The TV value displays the normal value upon half press of the shutter instead of the override.  I don't know if that's normal behavior.  Raw enabled also didn't output any files.

Will keep testing tomorrow.
Title: Re: Powershot A3100 - Porting thread
Post by: srsa_4c on 22 / April / 2013, 13:07:51
However, I can't get most of the overrides such as shutter speed, nd filter, iso  to work.  It's been a couple years since I used chdk so it could be user error but I don't think so.  The TV value displays the normal value upon half press of the shutter instead of the override.  I don't know if that's normal behavior.  Raw enabled also didn't output any files.
Not user error, there was a bug which made CHDK lose control over RAW and the photo overrides (for devs: loc <-> sub issue in capt_seq.c). New build attached.

edit:
There's one more thing to test: do the overrides work if you shoot by quickly fully pressing the shutter button (i.e. you shoot before the AF scan completes)?

edit2:
attachment removed
Title: Re: Powershot A3100 - Porting thread
Post by: cheddar66 on 23 / April / 2013, 23:22:57
No, that doesn't work, but it seems like it still gets some AF action in there even if I press as fast as possible.

Actually I'm not sure if you posted another build and meant for me to try it on that one (I tried it on the first one).  I only just saw your post.
Title: Re: Powershot A3100 - Porting thread
Post by: srsa_4c on 24 / April / 2013, 01:28:13
Actually I'm not sure if you posted another build and meant for me to try it on that one (I tried it on the first one).  I only just saw your post.
Yes, there was a newer build attached to that post. I've reuploaded it to http://www.sendspace.com/file/gh2l9j (http://www.sendspace.com/file/gh2l9j) .
Title: Re: Powershot A3100 - Porting thread
Post by: cheddar66 on 24 / April / 2013, 17:17:45
The overrides work if I wait for the AF to finish but they don't work if I shoot quickly.
Title: Re: Powershot A3100 - Porting thread
Post by: srsa_4c on 26 / April / 2013, 13:51:34
The overrides work if I wait for the AF to finish
Thanks.
Quote
but they don't work if I shoot quickly.
The attached build should take care of this issue. Please report if you find a problem with it.

If you're interested in a somewhat faster motion detection, and willing to test, let me know.
Title: Re: Powershot A3100 - Porting thread
Post by: cheddar66 on 27 / April / 2013, 19:11:48
The attached build should take care of this issue. Please report if you find a problem with it.
It seems like the overrides still do not work on quick shutter release.

Quote
If you're interested in a somewhat faster motion detection, and willing to test, let me know.
I would try it, but outside of testing your build I have never used it.

Also, is it normal for the camera to report iso values other than what I specify?  ie iso 100 displays iso 160 in the info, 200 shows 320.
Title: Re: Powershot A3100 - Porting thread
Post by: waterwingz on 27 / April / 2013, 19:25:48
Also, is it normal for the camera to report iso values other than what I specify?  ie iso 100 displays iso 160 in the info, 200 shows 320.
See the first "note" here :

http://chdk.wikia.com/wiki/CHDK_User_Manual#Override_ISO_value (http://chdk.wikia.com/wiki/CHDK_User_Manual#Override_ISO_value)

Title: Re: Powershot A3100 - Porting thread
Post by: waterwingz on 27 / April / 2013, 19:27:02
If you're interested in a somewhat faster motion detection, and willing to test, let me know.
@srsa_4c :  having played with MD a bit,  I'm curious.  What have you got?
Title: Re: Powershot A3100 - Porting thread
Post by: srsa_4c on 27 / April / 2013, 21:10:04
The attached build should take care of this issue. Please report if you find a problem with it.
It seems like the overrides still do not work on quick shutter release.
That means the "magic potion" (a piece of code that is supposed to help with this issue) doesn't work. I'll leave it like it is then.

Quote
Quote
If you're interested in a somewhat faster motion detection, and willing to test, let me know.
I would try it, but outside of testing your build I have never used it.
You can test this by simply watching the live histogram or zebra, no need for a motion detection script.

@srsa_4c :  having played with MD a bit,  I'm curious.  What have you got?
... I should have said "Would you like to test a vid_get_viewport_live_fb() implementation based on values found by the sigfinder?"   :-[
Seriously, I don't want to blindly implement it, because I may get the number of buffers wrong (this camera seems to have 3, not 4).
Title: Re: Powershot A3100 - Porting thread
Post by: cheddar66 on 28 / April / 2013, 15:54:33
Quote
You can test this by simply watching the live histogram or zebra, no need for a motion detection script.
Sure, I'll test it.
Title: Re: Powershot A3100 - Porting thread
Post by: srsa_4c on 28 / April / 2013, 16:39:46
@cheddar66

Attached is a build with that motion detection related change. Unfortunately proper testing would be a bit tedious (unlike I said earlier), so I'm only asking you to enable zebra and report whether the zebra display is working correctly. Since zebra is slow, you probably won't find a difference compared to the previous builds.

Also, I have disabled that fast shutter press related hack, since you have reported it to be ineffective.
Title: Re: Powershot A3100 - Porting thread
Post by: cheddar66 on 28 / April / 2013, 17:36:42
Yes it works correctly.  Like you said, I can't see a difference.
Title: Re: Powershot A3100 - Porting thread
Post by: philmoz on 30 / April / 2013, 08:28:23
Does the 'Dark Frame subtraction' control (RAW Settings) work at the moment?

There are some problems with other cameras with the 'nrflag' values found by finsig_dryos.

I've updated the code and the new value found for the A3100 is:
Code: [Select]
static long *nrflag = (long*)(0x5cd8+0x08);

I would appreciate if someone can test this and let me know which value works (if any).

Phil.
Title: Re: Powershot A3100 - Porting thread
Post by: mahins on 02 / July / 2015, 04:24:10
hi can you help me to insatll chdk on my canon a3100 is d?
i installed it using the file here mighty-hoernsche.de
it insalled,but there is no significant difference...no zebra,no raw nothing .except the battery counter.
Title: Re: Powershot A3100 - Porting thread
Post by: waterwingz on 02 / July / 2015, 05:35:30
hi can you help me to insatll chdk on my canon a3100 is d?
i installed it using the file here mighty-hoernsche.de
it insalled,but there is no significant difference...no zebra,no raw nothing .except the battery counter.
Do you see the red CHDK logo when your camera starts?

(https://chdk.setepontos.com/proxy.php?request=http%3A%2F%2Fvignette3.wikia.nocookie.net%2Fchdk%2Fimages%2Fc%2Fc9%2FLogo.png%2Frevision%2Flatest%3Fcb%3D20130627011401&hash=c2b9e3031ced54dfd9c491efd033fe31)

Have you tried quicky pressing the CHDK <ALT> key?  For he A3100,  the key to press is  labelled "Review Photos" in this picture :
(https://chdk.setepontos.com/proxy.php?request=http%3A%2F%2Fwww.cameras.co.uk%2Fcameraimages%2Fcanon-powershot-A3100-IS-back.jpg&hash=063f2ad01cbc1e5c3b34141daec978dc)
Title: Re: Powershot A3100 - Porting thread
Post by: dvarkin on 24 / June / 2016, 03:40:23
Hello! Thanks for developing :) Is it possible to change video resolution to 1280x720 (or so) on this camera?
Title: Re: Powershot A3100 - Porting thread
Post by: waterwingz on 25 / June / 2016, 10:43:20
Hello! Thanks for developing :) Is it possible to change video resolution to 1280x720 (or so) on this camera?
CHDK cannot change video resolutions.  Sorry.