500d development - page 35 - DSLR Hack development - CHDK Forum

500d development

  • 2487 Replies
  • 901250 Views
*

Offline Coutts

  • *****
  • 538
  • www.flickr.com/couttsphotog
    • Flickr
Re: 500d development
« Reply #340 on: 25 / February / 2011, 08:15:43 »
Advertisements
I've saved a few dm log files too but I'm not sure how to decipher those either. Here's a small clip from me pressing shutter button halfway repeatedly:



(click image for bigger size).
« Last Edit: 25 / February / 2011, 08:27:08 by Coutts »
Canon 5d
Canon 50mm f/1.8
Sigma 24mm f/1.8

Flickr

*

Offline a1ex

  • *****
  • 671
  • ML dev
Re: 500d development
« Reply #341 on: 25 / February / 2011, 08:21:21 »
You can add the memory addresses to consts-500d.110.h. Most of the time you would like to do something like this:

Code: [Select]
#define BATTERY_BLINKING (*(int*)0x19e9c)

A second method (which should be a bit more elegant) is to add them to the stubs file:

Code: [Select]
NSTUB( 0x3787c, LV_EX_X)

and then declare them as extern int wherever you want to use them:

Code: [Select]
extern int LV_EX_X;

Make sure the address stays the same between camera restarts; some addresses may be malloc'ed.

To decipher logs, look for the strings in the firmware dump (and this helps you figure out which functions were executed). See also http://magiclantern.wikia.com/wiki/Debugging_Magic_Lantern
« Last Edit: 25 / February / 2011, 08:31:19 by a1ex »

*

Offline Coutts

  • *****
  • 538
  • www.flickr.com/couttsphotog
    • Flickr
Re: 500d development
« Reply #342 on: 25 / February / 2011, 08:33:50 »
You can add the memory addresses to consts-500d.110.h. Most of the time you would like to do something like this:

Code: [Select]
#define BATTERY_BLINKING (*(int*)0x19e9c)

A second method (which should be a bit more elegant) is to add them to the stubs file:

Code: [Select]
NSTUB( 0x3787c, LV_EX_X)

and then declare them as extern int wherever you want to use them:

Code: [Select]
extern int LV_EX_X;

To decipher logs, look for the strings in the firmware dump (and this helps you figure out which functions were executed). See also http://magiclantern.wikia.com/wiki/Debugging_Magic_Lantern



thanks for the speedy reply. well, looking at the already existing code, all of the memory addresses in there look like:
Quote

NSTUB(0xFF1BCAA0, GUI_SetBeep);                              //!< End address: 0xFF1BCAD4; Flags: 0x0

and don't seem like the values I'm finding.. are any of these even adjusted for the 500d yet? One more thing: there's a few stubs files in there (two for the 500d), any idea which one is the main one that should be edited?


Oh and I looked at your lens.h file, it didn't look much different from the one I have right now, but I just went ahead and filled in the missing values (it was like filling in a value between 58 and 60, obviously 59 fits, etc). It should be fine. I couldn't see any errors using 1/2 stops instead of 1/3 stops (custom function to adjust that setting, right?).

todays gonna be a long day LOL.
Canon 5d
Canon 50mm f/1.8
Sigma 24mm f/1.8

Flickr

*

Offline a1ex

  • *****
  • 671
  • ML dev
Re: 500d development
« Reply #343 on: 25 / February / 2011, 08:58:56 »
You should edit the one mentioned in the Makefile: stubs-500d.110.S. The other one can be deleted. Values like 0xFFxxxxxx are from ROM and are usually function addresses.


*

Offline Coutts

  • *****
  • 538
  • www.flickr.com/couttsphotog
    • Flickr
Re: 500d development
« Reply #344 on: 25 / February / 2011, 09:12:45 »
You should edit the one mentioned in the Makefile: stubs-500d.110.S. The other one can be deleted. Values like 0xFFxxxxxx are from ROM and are usually function addresses.
alright. Well, I'm wondering how they found those addresses in the first place I guess. Just trying to make sense of it all. also does anyone knows what memory values have been found yet? I'm assuming the main buttons at least have to be right since we can use the menu and navigate fine.. hmm.
« Last Edit: 25 / February / 2011, 09:25:31 by Coutts »
Canon 5d
Canon 50mm f/1.8
Sigma 24mm f/1.8

Flickr

*

alins

Re: 500d development
« Reply #345 on: 25 / February / 2011, 10:31:28 »
Guys should the next build be deemed pre beta ? Would just add to the excitement :) And the project has progressed quiet alot.


Hmmm, its up to the developers to deem if the build is stable enough to reach Beta Status haha
man its only been a month since things picked up and there has been soo much progress


i was actually having the same thought yesterday...great minds think alike :)

i totally agree that the build is stable enough, next build that we release should be moved to a beta status.

Re: 500d development
« Reply #346 on: 25 / February / 2011, 10:37:28 »
Guys should the next build be deemed pre beta ? Would just add to the excitement :) And the project has progressed quiet alot.


i was actually having the same thought yesterday...great minds think alike :)

i totally agree that the build is stable enough, next build that we release should be moved to a beta status.



Exactly :D
Keep up the great work you guys !
Canon EOS 500D/T1i - What a  DSLR.

*

alins

Re: 500d development
« Reply #347 on: 25 / February / 2011, 11:10:18 »
and don't seem like the values I'm finding.. are any of these even adjusted for the 500d yet? One more thing: there's a few stubs files in there (two for the 500d), any idea which one is the main one that should be edited?


coutts: where a quick primer in stubs.

as alex pointed out the stubs file that is used is this one: stubs-500d.110.S where 110 is the firmware number. If canon where to release a 1.2.0 firmware for 500d we will have to generate a new stubs file that most likely will be named stubs-500d.120.S.

where's this file coming from? well, somebody generate it..i would guess either chuchin or arm.indy generated the one that we use. you can generate stubs using various tools: finsig/gensig tools from CHDK http://chdk.wikia.com/wiki/Signature_finder or http://magiclantern.wikia.com/wiki/GPL_Tools/match.py are the top two that comes in mind. I haven't tried finsig/gensig myself, the setup is a little bit confusing and complex and i just didn't spend the time to figure it out. I did try match.py but on my setup is crashing with bus error which is a shame since it could really help me figure out the sound meters.

in 500d codebase you will also find a stubs file named something like: stubs500d<don't remember what follows>. This file looks to be a raw generated stub using one of the above tools and is there for reference. sometimes i look into this file to see if it has some address that's not present in the main stubs-500d.110.S.

now, what memory values have been found:
- i will guess most of them are valid. I personally added a few values and/or fix some of them based either on my iDA Pro database or using the stubs500* file that i mentioned or simply trying different values until it works. I was focused on the main features, like making sure the sound device memory address is correct or (with a lot of help from RoaldFre) figure out where the VRAM segment is and how is built (as a result of this we now have zebras support and i'm hoping soon focus peaking).

things that you mentioned (focus confirmation...and all) i haven't checked if the values are correct. If you find that the values are wrong please update the stubs file. I would also like if you don't mind to start adding comments in the stub file for values that we change to specify what the value is used for. I'm hoping this is gonna help the next developer.

about ida pro: here's a starting point for ida pro just to give you an idea: http://chdk.wikia.com/wiki/Loading_dump_to_IDA. using ida pro _is_ the best way to understand the firmware with couple of issues: the tool is commercial and is not cheap (don't ask me how i got my copy) and second is really really complex (it has to be considering what it does). i personally understand maybe < 5% of what i see in ida pro, usually i just use names or string search, look at xrefs and see if i can figure out whatever i need at the moment. now from ida pro you can generate these IDC files ((think of them like a database of the disassembled firmware in an open format) which can then be queried used open source tools. alex i believe wrote  arm console (search for it in ml wikia) to automate firmware analysis using IDC files (this tool also crashes on my setup with bus error).

one last thing about IDC/ida pro: when you first load the firmware in ida pro, the output that you see is not very "clean". ida pro does it's best to figure out the dump but is not perfect. there are scripts to help cleaning up the output which can help some and there's a LOT of manual work to actually get a "clean" or at least "cleaner" disassemble. arm.indy told me that he spend days manually cleaning stuff.

i hope all these helps



*

Offline Coutts

  • *****
  • 538
  • www.flickr.com/couttsphotog
    • Flickr
Re: 500d development
« Reply #348 on: 25 / February / 2011, 11:17:40 »
Hey I just noticed the shutter count works :) The only way to get it to show up is to be in movie mode and start to twist your lens off, it will show the screen saying "are you sure there's still a lens attached?" and in the bottom left corner it prints the shutter count (seems accurate too, I'm at 32492, it increments with pictures accurately too).

Another thing I noticed in memspy, de-attaching/attaching the lens triggers the same value as when you flip the auto focus / manual focus switch on the lens, same corresponding values too.

14c7c
202 when switched to AF / lens attached
203 when switched to MF / lens de-attached


i still don't understand what to do with these values. I just keep writing them down.



another thing:
when in live view / movie mode, holding the shutter half down for about 2 or 3 seconds will clear the whole screen (while clearpreview is enabled). is this how it's supposed to act?
Canon 5d
Canon 50mm f/1.8
Sigma 24mm f/1.8

Flickr

*

alins

Re: 500d development
« Reply #349 on: 25 / February / 2011, 11:25:00 »
you can also get the shutter counter if you crash the camera (like trying to change the aperture/shutter speed while recording a movie) :)

 

Related Topics