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

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

  • 23 Replies
  • 14641 Views
my first chdk port attempt - need some help (ixus 40)
« on: 26 / July / 2008, 01:42:44 »
Advertisements
Hi!

I am trying to port chdk to the ixus40. If i use the code posted here on the forum it works partially
but i want to use the newest chdk source from trunk.
So i started to merge trunk and the code posted  in the sd300 thread.

The short version: it doesnt boot/work.

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 ?

Thanks!

Simon
« Last Edit: 26 / July / 2008, 13:02:50 by PhyrePhoX »

Re: my first chdk port attempt - need some help
« Reply #1 on: 26 / July / 2008, 02:34:36 »
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...

Re: my first chdk port attempt - need some help
« Reply #2 on: 26 / July / 2008, 04:04:15 »
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 :(

Re: my first chdk port attempt - need some help
« Reply #3 on: 26 / July / 2008, 12:41:01 »
nice, can you post your code, better the wohle files. i also tried to run the code out of the thread. but without success...

ben

Hi!

Its not working 100% yet...
I have fixed the major issues i guess.

news:
- keyboard input
- captseq adresses/code found (took me a while using only objdump&co :( )
- captseq asm/c mix coded, calls raw save routines -> 5mb garbage file on sd (isnt there a header in a raw file ?)
- some entry stubs fixed

bugs:
UnlockMainPower leads to lock up -> commented out
detecting if image taking is in progress buggy since the raw add

my biggest problem:
the filesys access seems to be broken somehow:
1) write a file using open/write in main.c/core_spytask() ==> working!
2) open dir/read files in main.c/core_spytask()  ==> working
3) try the same in gui_fselect.c anywhere => open and opendir are _failing_ !!!!!

Any ideas ?

wasted 2 days so far >:(

Re: my first chdk port attempt - need some help (ixus 40)
« Reply #5 on: 27 / July / 2008, 13:31:08 »
just found out that the problem is caused by the fact in which thread the fs access takes place.

if i move the fselect gui call from gui_kbd_process() <--- called by kbd thread (?)
to gui_redraw() <---called by gui thread
 the filebrowser is working.

So there seems to be an issue in which thread the fs access is done..
Strange >:(


*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: my first chdk port attempt - need some help (ixus 40)
« Reply #6 on: 27 / July / 2008, 14:54:10 »
Could it have something to do with this (reply #14 by GrAnd) ?

Quote
Quote from: jeff666 on 01 / January / 2008, 18:38:24
I moved task_blinker to core/main.c as well to see if it stops working, and it did. So references between platform and core seem to be broken. Do you have any Idea what to look for?
I have a guess. Thumb mode?
ARM processor has two modes of code execution: native (32bits instructions) and thumb (16bits instructions). They can't work together directly. To make a call of procedure from one type of code to another, a special interwork mechanism is used.
The original firmware has native ARM format.
But in the CHDK, only platform dependent code is compiled in native mode. The 'core' and 'libs' are compiled in thumb. It was done for reducing size of code. The functions from wrappers.c are used for interwork communications.
To determine, which file compiled in which mode, look into makefiles (see CTHUMB flag).

PS. Generally speaking, I'm not an expert in ARM at all. All this information I got from the founder of CHDK, Vitaly.


(found it here: DryOS - some success)

wim

Re: my first chdk port attempt - need some help (ixus 40)
« Reply #7 on: 27 / July / 2008, 15:12:24 »
hmm interesting. but i dont think thats my problem.

the code i use is from "trunk". I really hope the filesystem browser etc work
in there. At least thats what i assume.

So there should be no problem at all with the file open/write etc as its used like that in the trunk code.

any other ideas ?

in the meantime i played a bit around with the raw data. i patched dcraw to accept the file (just by tricking the file detection)
but it looks totally random to me :-\


Re: my first chdk port attempt - need some help (ixus 40)
« Reply #8 on: 27 / July / 2008, 17:03:30 »
there more i investigate i just find more problems :(

I figured out that while the gui_bench is running get_tick_count() always
returns the same value (i did a printf to the screen and while the screenwrite
runs i can see that the time freezes :-\)
Seems like the bench task is blocking the system task ?!
really strange...

Re: my first chdk port attempt - need some help (ixus 40)
« Reply #9 on: 27 / July / 2008, 17:08:18 »
just figured out that the osd clock is running way too slow anyway :-X

 

Related Topics


SimplePortal © 2008-2014, SimplePortal