my first chdk port attempt - need some help (ixus 40) - page 2 - General Discussion and Assistance - CHDK Forum supplierdeeply

my first chdk port attempt - need some help (ixus 40)

  • 23 Replies
  • 14256 Views
Re: my first chdk port attempt - need some help (ixus 40)
« Reply #10 on: 28 / July / 2008, 04:03:14 »
Advertisements
new day - new bugs/problems:

i just figured out that whenerver the camera is in <ALT> mode the
filesystem access is not working!
for example
a) fselect gui accessed by selecting menitem (=in alt mode) -> 0 files
b) calling fselect by a manual timer in gui_redraw & cam manually put in alt mode -> 0 files
c) calling fselect by a manual timer in gui_redraw & cam manually put in normal mode -> WORKING
d) calling fselect by a manual timer in gui_redraw & toggeling between alt/normal before script launch & setting in NON ALT mode before start -> WORKING

so there is something wrong while in alt mode >:(

Re: my first chdk port attempt - need some help (ixus 40) -- heeelp
« Reply #11 on: 28 / July / 2008, 12:22:06 »
I dont make any progress :(

Theres not much missing: once this file io issue is gone and doing some debugging in the captseq code
the port would be done...
but i just dont find the bug.

if i change gui_kbd_process to:

void gui_kbd_process()
{
   if (kbd_is_key_clicked(KEY_MENU))
         bla=1;
   return;
}

and then in the gui draw function:
if (bla) gui_draw_fselect(0);

the fselect is working...

If i do a

void gui_kbd_process()
{
   if (kbd_is_key_clicked(KEY_MENU))
         gui_draw_fselect(0);
   return;
}

the file access is broken.
I have no idea what goes wrong/what causes this issue


Re: my first chdk port attempt - need some help (ixus 40)
« Reply #12 on: 28 / July / 2008, 18:24:50 »
i got so bored understanding others asm code that i just started to write my own kbd task :-X

i use a while loop, some code fragments and a task sleep command.

so far only chdk gets the key inputs (i forgot the save to the canon gui mem locations somewhere)
BUT: the chdk gui is working fine. file browser, benchmark etc ...
its all working :)

Now i need to find the correct way to pass the data to the canon gui

*

Offline waldo

  • ***
  • 238
Re: my first chdk port attempt - need some help (ixus 40)
« Reply #13 on: 28 / July / 2008, 18:34:26 »
Thanks for the progress updates.  I've tried running the SD300/I40 code posted a few months ago with no luck so I'm glad someone has picked this up.

BTW, the SD300 is the third most popular SD camera on Flickr, so I'm sure there are many others waiting for this as well.
Flickr: Camera Finder: Canon


Re: my first chdk port attempt - need some help (ixus 40)
« Reply #14 on: 29 / July / 2008, 04:52:44 »
Hi!

My try with my own task didnt bring me any further.
I cant get the camera code to "see" the button presses when i use my own code.

i *think* this camera os version is a very old one where they still did the kbd processing
in an intterrupt.
That would explain why one int enable bit is set in spsr during kbd processing and
might be the cause of the problems while running gui_*() code of chdk

I will now try to create a second thread that just waits for kbd presses from the main kbd thread and then do gui stuff.

Re: my first chdk port attempt - need some help (ixus 40)
« Reply #15 on: 29 / July / 2008, 05:17:44 »
i had a better idea 8)
i modified the gui core that gui_kbd_process just sets a flag and then the kdb processing
is done in the gui main loop.

that works! ok the gui is missing some keypresses  but the filebrowser works etc!

now the question is how to fix that in the right way :-\

The problem as far as i understood:
- on the sd300 the kbd "task" seems to be running during an interrupt or something strange
- long action/file access etc in this kbd task is not possible
- kbd code calls gui_kbd_process() which also does some gui drawing/etc !
===> there it explodes/behaves wrong. i cant do that in the kbd task

So my idea is just to set a flag and do the gui stuff in the gui task (which would be a cleaner way anyway, right ?)
That will lead to some  changes in core/gui :(

Re: my first chdk port attempt - need some help (ixus 40)
« Reply #16 on: 29 / July / 2008, 06:58:09 »
Hi,

some days ago i started to have a look at the SD200 Code.
The Stubs are found...

I think the SD300 and the SD200 have the same Firmware Binary and so it should be possible to have the same Port of CHDK

So could you please send me your Code so that I test it at the SD200 and maybe I'm able to improve it?

regards
John

Re: my first chdk port attempt - need some help (ixus 40)
« Reply #17 on: 29 / July / 2008, 08:07:43 »
success: first raw image decoded !
ImageShack - Hosting :: firstrawixus40uu0.jpg

in order to convert them with dcraw a small patch is needed:
 diff dcraw.c dcraw.orig
6485d6484
<     {  5298000, "Canon",    "Ixus 40", 0},
6736,6744c6735
<   } else if (!strcmp(model,"Ixus 40")) {
<     height = 1720;
<     width  = 2312;
<     raw_height = 1728;
<     raw_width  = 2400;
<     top_margin  = 6;
<     left_margin = 12;
<     load_raw = &CLASS canon_a5_load_raw;
<    } else if (!strcmp(model,"PowerShot A460")) {
---
>   } else if (!strcmp(model,"PowerShot A460")) {

Note: this diff might need some tuning, the right values were found by try'n'error ;)

I will prepare a svn diff/package of the chdk code later today ;)


*

Offline pixeldoc2000

  • ****
  • 356
  • IXUS900Ti 1.00C, IXUS300HS 1.00D
    • pixel::doc homebase
Re: my first chdk port attempt - need some help (ixus 40)
« Reply #18 on: 29 / July / 2008, 11:16:54 »
If i put led blink code in loade/.../main.c in my_restart()
i can see it blinking. but the the cam locks/black screen.

What is the next code that is beeing executed ?
Can i find documentation about the initilization/startup phase anywhere ?

ok i figured out some more info:

afterwards
platform/.../main.c -> startup() is called

i can see that
    // sanity check
    if ((long)&link_bss_end > (MEMISOSTART + MEMISOSIZE)) {

is true and so the camera enters shutdown. but i have no idea why this fails...

ok forget about it. i figured it out.

now i can see the chdk logo while booting

camera works normally until i press the ALT button, then it crashes/hangs :(
How did you fixed this? Would be great to get some infos... I'm working on port to IXUS900Ti (VxWorks 5.5), but currently only led and jeff666 boot loop works. Can't get chdk to boot, just blank screen here...
Code: [Select]
if ((long)&link_bss_end > (MEMISOSTART + MEMISOSIZE)) should be correct in my port...

Is your Firmware VxWorks or DryOs?

Maybe you could have a look at my ixus900 posts to answer one or two questions you may have resolved alread in your port? That would be really nice !!!! (this would probably safe me hours / days / weeks to get around by myself sometime...it's not about being lazy, but just don't know how to get past this...). Maybe we can help out each other (if am able to)? Thanks in advance!
« Last Edit: 29 / July / 2008, 11:23:38 by pixeldoc2000 »

Re: my first chdk port attempt - need some help (ixus 40)
« Reply #19 on: 29 / July / 2008, 12:43:37 »
Hi!

The memisosize issue: former versions used 0x3000, chanegd it to 0x4000 like in current chdk trunk code.
Firmware is vxworks. Sorry i think i cant help you much right now. Your cam is very different :-\

sd300 status:

working:
- keyboard
- keyboard/gui hack to prevent kbd task from calling gui functions (i miss 3 of 10 keypresses so its a bit buggy)
- filebrowser
- memorydump (some very high locations cause cam resets)
- capt_seq storing raw files
- develop raw files by filbrowser
- getProperty seem to work for most properties (like distance etc)

open issues (adresses should be ok):
- getProperty() for ..._SHOOTING not supported -> i tried several values :(
- get_parameter_data() returns (always?) zero -> especially bad for last file number :(
what is get_parameter_data intended to return ? always zero except for last file ?

open issues in general:
- when switching to rec while in alt mode the script starts executing (just apeared after my kbd fix so its propably my fault)

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal