A800 Porting Thread - page 3 - DryOS Development - CHDK Forum

A800 Porting Thread

  • 277 Replies
  • 115007 Views
Re: A800 Porting Thread
« Reply #20 on: 22 / January / 2012, 07:56:17 »
Advertisements
OPT_CHD_IN_EXMEM,  OPT_EXMEM_MALLOC
Were you able to verify that you actually needed to put CHDK in extended memory.  The A800 has a small ROM,  perhaps it is short of RAM too ?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: A800 Porting Thread
« Reply #21 on: 22 / January / 2012, 13:00:00 »
EXMEM_BUFFER_SIZE
  I have followed the procedure explained in the mentioned page and it seems to work fine. The Ok was always displayed when taking pictures with best quality and when recording video. So I defined EXMEM_HEAP_SKIP as zero. chdk with everything compiled occupies about 250 Kb. So 640 Kb would be more than enough. On the other I don't know how much memory it may allocate to execute its tasks. As the reference port of a more "robust" camera uses it I did the same. By the way, "Free memory info" displays just the status of the free memory managed by chdk ?

OSD printf format: when I was monitoring the bits of physw_status, at least in A800 the format used %#8x displays the memory in a way that shrinks and moves right or left in screen. Sometimes the screen gets dirt and shows something that is not even true. I used %08x that presents a fixed size dw on the screen making easier to identify the bits.

Menu,up,down,left 1pressed states - I used the OSD to display physw_status (I have recheked it now) and that is happening. At least since the A490(A495) the code mentions it. What I think is that the it doesn't seems to solve the problem (if is there really a problem and the code gets called with these keys)

Necessity of EXMEM. No, I don't have any problem with the code in lower memory. I have just enabled it because the code has already support for it and the instructions were fine. So I made the tests indicated and gets confused just about the best size to be configured.

Just something I am curious about: I have not dealed with this processor assembly. I have seen near the end of the starting code of the firmware of 3 cameras (A800, A495 and ixus220) the same sequence thar it seems strange:
ffc00114:    e3a01001    mov   r1, #1
ffc00118:    e59f2060    ldr   r2, [pc, #96]   ; ffc00180: (c0243100)
ffc0011c:    e5812000    str   r2, [r1]
The last instruction was not supposed to be
STR   R1,[R2]
or is there any trick ?

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: A800 Porting Thread
« Reply #22 on: 22 / January / 2012, 14:10:56 »

Menu,up,down,left 1pressed states - I used the OSD to display physw_status (I have recheked it now) and that is happening. At least since the A490(A495) the code mentions it. What I think is that the it doesn't seems to solve the problem (if is there really a problem and the code gets called with these keys)


Thanks for that - the key state is interesting given Canon seem to do it the other way in other cameras (you learn something new every day).

There is a patch posted for the A495 key problem here - http://chdk.setepontos.com/index.php?topic=650.msg80363#msg80363

This may help with yours as well.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: A800 Porting Thread
« Reply #23 on: 22 / January / 2012, 15:56:39 »
Thanks for that - the key state is interesting given Canon seem to do it the other way in other cameras (you learn something new every day).
Hopefully the USB power status bit is not inverted as well..
Ported :   A1200    SD940   G10    Powershot N    G16

Re: A800 Porting Thread
« Reply #24 on: 22 / January / 2012, 19:00:35 »
I am testing the usb remote shooting. As the only thing I have here is a usb power source, I am using it.]
I configure it
  usb remote
  One push
  Normal and Video
Concerning usb remote connection 

I have observed the following behavior both starting directly in shooting(or recording) or in review mode and then switching to shooting(or recording):
  When after power on I connect the usb cable the camera switches to review mode and the keys are blocked (except the mode key, because it is not under chdk control, so just the keys are locked)
  If I use Alt Menu first (just scrolling, not configuring anything) and then return to camera controls and then connect the usb cable everything works as expected.
   shooting: connect -> beep and small red camera blinking -> disconnect -> shoot.
   recording: connect -> start recording -> disconnect -> connect -> stop recording

If I haveidentified correctly, the variable virtual_remote_state cicles 1->2->3 in both situations (is there any way to generate variables mapping?)

Re: A800 Porting Thread
« Reply #25 on: 22 / January / 2012, 19:27:54 »
If I use Alt Menu first (just scrolling, not configuring anything) and then return to camera controls and then connect the usb cable everything works as expected.
I noticed something similar during the development of the new version of the USB remote code.  I pretty much decided it was something that did not get initialized until after <ALT> mode had been entered for the first time.  The problem when away went I added initialization to these three lines  in kdb.c  :

Code: [Select]
long kbd_new_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
static long kbd_prev_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
static long kbd_mod_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };

Seems like all the recent conversation about key active states for the A490, A496 and A800 suggests these values might need to be different for those cameras?

Quote
If I have identified correctly, the variable virtual_remote_state cicles 1->2->3 in both situations (is there any way to generate variables mapping?)
Those states correspond to "remote release", "remote half-press" and "remote full-press".   There is a little documentation here http://chdk.wikia.com/wiki/User:Waterwingz/USB_Remote_V2 - the code has only been released a few days and I have more work to do on it.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: A800 Porting Thread
« Reply #26 on: 22 / January / 2012, 20:36:17 »
According to your suggestion I have initialized the variables, but a little differently:
#define KEYS_MASK0 (0x00020000)
#define KEYS_MASK1 (0x00000000)
#define KEYS_MASK2 (0x2E0003f0)
#define KEYS_MASK2_INV 0xD1ffffff//higher  1=pressed (MENU,UP,DOWN,LEFT) =>INTRODUCED

static long kbd_new_state[3] = {KEYS_MASK0, KEYS_MASK1, (KEYS_MASK2 & KEYS_MASK2_INV)};
static long kbd_prev_state[3] = {KEYS_MASK0, KEYS_MASK1, (KEYS_MASK2 & KEYS_MASK2_INV)};
static long kbd_mod_state[3] = {KEYS_MASK0, KEYS_MASK1, (KEYS_MASK2 & KEYS_MASK2_INV)};

The variable that are 0 state pressed are set to zero and the inverted to 1
And is functioning normally after power On
.
I have also made modifications to the procedures kbd_is_key_clicked(long key) and kbd_get_clicked_key() besides the other 3 so that they consider the transition direction. The code is attached.

Re: A800 Porting Thread
« Reply #27 on: 22 / January / 2012, 22:09:34 »
A correction
The variables that are 0 state pressed are set to ONE and the inverted to ZERO (all released).

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: A800 Porting Thread
« Reply #28 on: 22 / January / 2012, 22:22:05 »
According to your suggestion I have initialized the variables, but a little differently:
#define KEYS_MASK0 (0x00020000)
#define KEYS_MASK1 (0x00000000)
#define KEYS_MASK2 (0x2E0003f0)
#define KEYS_MASK2_INV 0xD1ffffff//higher  1=pressed (MENU,UP,DOWN,LEFT) =>INTRODUCED

static long kbd_new_state[3] = {KEYS_MASK0, KEYS_MASK1, (KEYS_MASK2 & KEYS_MASK2_INV)};
static long kbd_prev_state[3] = {KEYS_MASK0, KEYS_MASK1, (KEYS_MASK2 & KEYS_MASK2_INV)};
static long kbd_mod_state[3] = {KEYS_MASK0, KEYS_MASK1, (KEYS_MASK2 & KEYS_MASK2_INV)};

The variable that are 0 state pressed are set to zero and the inverted to 1
And is functioning normally after power On
.
I have also made modifications to the procedures kbd_is_key_clicked(long key) and kbd_get_clicked_key() besides the other 3 so that they consider the transition direction. The code is attached.


The solution posted by srsc_4a is probably simpler - it just inverts the bits as the come out of (or go into) the physw_status variable. Then the rest of the code can work the same as it does for other cameras, rather than have special case tests in all the functions.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: A800 Porting Thread
« Reply #29 on: 22 / January / 2012, 23:33:15 »
It is much simpler and is working fine.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal