A580 porting - minor progress - page 3 - General Discussion and Assistance - CHDK Forum
supplierdeeply

A580 porting - minor progress

  • 125 Replies
  • 53949 Views
*

Offline fe50

  • ******
  • 3139
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: A580 porting - minor progress
« Reply #20 on: 22 / January / 2009, 07:17:01 »
Advertisements
Didn't know that, thanks for the tip. I guess i have to use NEED_ENCODED_DISKBOOT=very_yes according to wiki.

It's stuff like this that pisses me off... how am I supposed to know I need to use that option somewhere to make it work... it's only referenced once in the wiki and nowhere in the forum for another camera... there's also very little documentation about findsig/gensig, what they actually do, so I have to look around in a hundred places just to debug a compile error as the one in the screen dump below.  Oh well...
CHDK Wikia: signature finder ;)

About the encryption: hmm - the forum is full about that, e.g. look at the Ixus 80 porting thread...there are not much cameras yet with this new encryption method ported...

About compiling:--> always do a make clean, should help...

*

Offline reyalp

  • ******
  • 13791
Re: A580 porting - minor progress
« Reply #21 on: 22 / January / 2009, 16:54:19 »
Didn't know that, thanks for the tip. I guess i have to use NEED_ENCODED_DISKBOOT=very_yes according to wiki.
It doesn't matter what the value is, it just needs to be defined. Support for cameras that require an encoded diskboot is a recent addition. I've added a mention of it to http://chdk.wikia.com/wiki/Adding_support_of_a_new_camera#Basics

Quote
It's stuff like this that pisses me off... how am I supposed to know I need to use that option somewhere to make it work... it's only referenced once in the wiki and nowhere in the forum for another camera... there's also very little documentation about findsig/gensig, what they actually do, so I have to look around in a hundred places just to debug a compile error as the one in the screen dump below.  Oh well...
Yes, porting CHDK requires work. It's complicated and poorly documented. Feel free to help change that ;)
Don't forget what the H stands for.

Re: A580 porting - minor progress
« Reply #22 on: 24 / January / 2009, 12:49:12 »
Ok...

There's one thing I don't understand about the signature finder tool.

Every time I attempt to compile it gives me the following message:

gensig.o -> gensig.exe
-> signatures_dryos.h
CAUTION! 'signatures_dryos.h' is not updated due to 'sig_ref_dryos_1.bin` is emp
ty!

I've read the wiki and what I think it says is that I have to copy the firmware of the A580 camera in the tools folder and rename it to sig_ref_dryos_1.bin so that the program can look for signatures in it. Am i supposed to copy there the original A720 firmware?

As far as I understand, this shouldn't stop me from at least trying to boot the camera..

I've verified the loader code and the code in the a580 firmware is identical to the a720 firmware (if anyone is interested the copy and restart code is located at 0xFFC196D4 in my 101b firmware).

However, if I compile  and copy it on the card and try to run it, nothing happens, the camera remains powered off. This makes me believe that either addresses for the leds are wrong or maybe the encoding is not done right?

How do you the determine the LED addresses?

I've found this function in the firmware, is this the right one?

Code: [Select]
ROM:FFCC5A6C sub_FFCC5A6C                            ; CODE XREF: taskcreate_LEDCon+54p
ROM:FFCC5A6C                 LDR     R2, =0xC02200CC
ROM:FFCC5A70                 MOV     R1, #0
ROM:FFCC5A74                 STRB    R1, [R0]
ROM:FFCC5A78                 STR     R2, [R0,#4]
ROM:FFCC5A7C                 SUB     R2, R2, #4
ROM:FFCC5A80                 STRB    R1, [R0,#0x40]
ROM:FFCC5A84                 STR     R2, [R0,#0x44]
ROM:FFCC5A88                 LDR     R2, =0xC02200D0
ROM:FFCC5A8C                 STRB    R1, [R0,#0x80]
ROM:FFCC5A90                 STR     R2, [R0,#0x84]
ROM:FFCC5A94                 STRB    R1, [R0,#0x200]
ROM:FFCC5A98                 SUB     R1, R2, #0xC
ROM:FFCC5A9C                 STR     R1, [R0,#0x204]
ROM:FFCC5AA0                 MOV     R1, #1
ROM:FFCC5AA4                 SUB     R2, R2, #0x10
ROM:FFCC5AA8                 STRB    R1, [R0,#0x240]
ROM:FFCC5AAC                 STR     R2, [R0,#0x244]
ROM:FFCC5AB0                 STRB    R1, [R0,#0x280]
ROM:FFCC5AB4                 STRB    R1, [R0,#0x2C0]
ROM:FFCC5AB8                 B       sub_FFDAF0CC

From this code, my guess is that C02200D0 is one of the leds, but the loader uses C02200C4, where is this address deducted from?

*

Offline fe50

  • ******
  • 3139
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: A580 porting - minor progress
« Reply #23 on: 24 / January / 2009, 14:01:12 »
@mariush

Quote
I've read the wiki and what I think it says is that I have to copy the firmware of the A580 camera in the tools folder and rename it to sig_ref_dryos_1.bin so that the program can look for signatures in it. Am i supposed to copy there the original A720 firmware?
The signature finder needs the fw dumps listed in the readme.txt from the \tools dir as reference. Place these reference firmwares with the corresponding filenames there - not the A580 fw.
Place your A580 dump in the \platform\sub\xxx\ directory, the signature finder then generates the stubs_entry.S file with the functions found in your dump.

Quote
How do you the determine the LED addresses?
Use the blinker method (Porting_the_CHDK), download should be here, modify it for your needs & test it with your address.

The camera only loads a firmware, when the encryption (with dancingbits) is done - otherwise it starts as 'normal' & brings the 'Card locked !' message...

When the camera crashes with your code, you know that your code is loaded...place LED blink sequences in your code to check where you are...


*

Offline reyalp

  • ******
  • 13791
Re: A580 porting - minor progress
« Reply #24 on: 24 / January / 2009, 16:38:13 »
Quote from: mariush
I've read the wiki and what I think it says is that I have to copy the firmware of the A580 camera in the tools folder and rename it to sig_ref_dryos_1.bin so that the program can look for signatures in it.
Read more carefully, that's not what it says.
Don't forget what the H stands for.

Re: A580 porting - minor progress
« Reply #25 on: 24 / January / 2009, 18:15:24 »
So I got the 720 100c firmware and renamed in to sig_ref_dryos_1.bin and copied it in tools.

If I understand correctly, I now have to look in my firmware and find each function listed in sig_ref_dryos_1.txt and I must edit this txt file and change the hex offsets to match where the functions in my firmware are...

After I do this, I do a build and look in the stubs_entry.S that was generated and see if there are functions that are not 100% detected.
If there are some functions not 100% detected, I should search for them in my firmware and add the function name and hex offset in stubs_entry_2.S.

Am I right?


*

Offline reyalp

  • ******
  • 13791
Re: A580 porting - minor progress
« Reply #26 on: 24 / January / 2009, 19:46:59 »
So I got the 720 100c firmware and renamed in to sig_ref_dryos_1.bin and copied it in tools.

If I understand correctly, I now have to look in my firmware and find each function listed in sig_ref_dryos_1.txt and I must edit this txt file and change the hex offsets to match where the functions in my firmware are...
No. You should not change the sig_ref*.txt unless you are adding a new entry point for use by all CHDK cameras.
finsig is used to automatically generate the correct entry points in stubs_entry_2.S stubs_entry.S, by comparing your cameras primary bin with code extracted from the reference firmwares (gensig does the latter part, using the reference .bin and .txt files to generate the .h file, which is compiled into finsig)

Please read the makefiles and code for these tools until you understand them.
« Last Edit: 25 / January / 2009, 17:38:41 by reyalp »
Don't forget what the H stands for.

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: A580 porting - minor progress
« Reply #27 on: 25 / January / 2009, 15:15:14 »
finsig is used to automatically generate the correct entry points in stubs_entry_2.S

Almost.... finsig writes stubs_entry.S, and when it fails to find something (or when it finds incorrect addresses), you must find the entry points yourself and write them to stubs_entry_2.S (which overrides values in stubs_entry.S; the difference of NSTUB and NHSTUB can be found in stubs_asm.h: one is .weak, one isn't).



*

Offline reyalp

  • ******
  • 13791
Re: A580 porting - minor progress
« Reply #28 on: 25 / January / 2009, 17:41:58 »
Gah quite right. I should proof read when I'm berating people for not reading ;)
Don't forget what the H stands for.

*

Offline whim

  • ******
  • 2044
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: A580 porting - minor progress
« Reply #29 on: 25 / January / 2009, 18:24:08 »
@reyalp

well, you could always say it was because of all the code you went through while slimming down CHDK -
big thanks for that, as for all your other code cleanup actions !

BTW take a look at the stats below to see how hard you guys work

wim
« Last Edit: 25 / January / 2009, 18:37:15 by whim »

 

Related Topics