supplierdeeply

port for A3300IS / what reference port to use?

  • 288 Replies
  • 23698 Views
Re: port for A3300IS / what reference port to use?
« Reply #170 on: 08 / January / 2012, 11:28:13 »
Advertisements
Hey just wondering if you can explain the _my patches.

In the Cap_seq the only way I can keep cam from shutting down with and work correctly is if I comment out 1 _my patch in cap function and 1 in exp function.

With them commented out and just the regular address without _my at the end used, the cam works fine.

I have full control of shutter, iso, nd filter, subject distance, all work fine.

Is there a reason the patch goes at a certain address, should I leave them out or move them around?

Re: port for A3300IS / what reference port to use?
« Reply #171 on: 08 / January / 2012, 11:56:26 »
Hey just wondering if you can explain the _my patches.
The use of the "_my" patches is an informal coding convention used to indicate that a branch, jump or subroutine call goes to code in the current file and not back to the camera's ROM code.   Once you jump back to the camera's code,  you have left CHDK and the ability to modify the action of the camera further along in the code.  Calling functions in the camera ROM code is okay as the code returns to the CHDK routine - although you obviously cannot modify what that code does.

Quote
In the Cap_seq the only way I can keep cam from shutting down with and work correctly is if I comment out 1 _my patch in cap function and 1 in exp function. With them commented out and just the regular address without _my at the end used, the cam works fine.
I have full control of shutter, iso, nd filter, subject distance, all work fine.
So what you are doing it getting far enough in the hacked Canon code to enable some function but not all.   You will usually find the last thing that needs to be hacked at the end of each file (or linked code modules).  Once that's done,  everything goes back to ROM - nobody wants to do any more work than necessary.

Quote
Is there a reason the patch goes at a certain address, should I leave them out or move them around?
The patch goes until it "hook" whatever it needs to modify to get the correct Canon functionality.  If you leave it out,  you don't get the functionality.  If you can live with that its fine - several incomplete ports like that exist.  People will complain on the forum if you try to release it and its something they believe that they really need.  I would not advise "moving them around".  You should assume the code needs to function in the order it was written.

Re: port for A3300IS / what reference port to use?
« Reply #172 on: 09 / January / 2012, 04:52:23 »
If anyone wants to help me figure this out, maybe you can lead me in the right direction with this romlog?

*

Offline philmoz

  • *****
  • 2936
    • Photos
Re: port for A3300IS / what reference port to use?
« Reply #173 on: 09 / January / 2012, 05:21:10 »
If anyone wants to help me figure this out, maybe you can lead me in the right direction with this romlog?

When you build CHDK it creates a main.dump file in the core directory.
This is an assembly listing of the CHDK code.

You can use the StackDump addresses from the romlog to see where in the firmware or CHDK code it crashed.

If you want help analysing this then you'll need to post:
- the main.dump file that matches the build that crashed
- the source code would also help since the camera is not in SVN yet
- which firmware version and a link to the firmware primary.bin file

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)


Re: port for A3300IS / what reference port to use?
« Reply #174 on: 09 / January / 2012, 05:48:55 »
If anyone wants to help me figure this out, maybe you can lead me in the right direction with this romlog?

When you build CHDK it creates a main.dump file in the core directory.
This is an assembly listing of the CHDK code.

You can use the StackDump addresses from the romlog to see where in the firmware or CHDK code it crashed.

If you want help analysing this then you'll need to post:
- the main.dump file that matches the build that crashed
- the source code would also help since the camera is not in SVN yet
- which firmware version and a link to the firmware primary.bin file

Phil.

Cool, that would be great, I read up on what to do with the dump but just could not figure out how to search for the addresses, not that advanced yet.

Here is the link to my zip file with my whole trunk I use ,my platform is a3300is 100a. Everything is in there, I even compiled without gmake clean so all the files you said you needed should be ready to go. 8]

http://www.mediafire.com/file/h63n614grf3n7c6/trunk1509.zip

*

Offline philmoz

  • *****
  • 2936
    • Photos
Re: port for A3300IS / what reference port to use?
« Reply #175 on: 09 / January / 2012, 07:43:41 »
Cool, that would be great, I read up on what to do with the dump but just could not figure out how to search for the addresses, not that advanced yet.

Here is the link to my zip file with my whole trunk I use ,my platform is a3300is 100a. Everything is in there, I even compiled without gmake clean so all the files you said you needed should be ready to go. 8]

http://www.mediafire.com/file/h63n614grf3n7c6/trunk1509.zip

The romlog shows that is is failing in the 'CaptSeqTask' task (task name at the top).
This is a task we replace with the CHDK code in capt_seq.c.
In the stack dump, 6 lines down, is the address 0x03CB8E1C which is in the capt_seq_task() function in main.dump.

Chances are there is something wrong with the capt_seq_task() code that has been copied into capt_seq.c from the firmware.

First test is to comment out the line that hooks the task (in the taskHook() function in boot.c).
If that stops the crash then you need to carefully examine the code in capt_seq.c and compare it to the firmware to see if there are any mistakes. Start by making it identical to the firmware (don't call any _my functions). Then you can gradually add the calls to the _my override functions to try and narrow it down.

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)

Re: port for A3300IS / what reference port to use?
« Reply #176 on: 09 / January / 2012, 10:55:59 »
Cool, that would be great, I read up on what to do with the dump but just could not figure out how to search for the addresses, not that advanced yet.

Here is the link to my zip file with my whole trunk I use ,my platform is a3300is 100a. Everything is in there, I even compiled without gmake clean so all the files you said you needed should be ready to go. 8]

http://www.mediafire.com/file/h63n614grf3n7c6/trunk1509.zip

The romlog shows that is is failing in the 'CaptSeqTask' task (task name at the top).
This is a task we replace with the CHDK code in capt_seq.c.
In the stack dump, 6 lines down, is the address 0x03CB8E1C which is in the capt_seq_task() function in main.dump.

Chances are there is something wrong with the capt_seq_task() code that has been copied into capt_seq.c from the firmware.

First test is to comment out the line that hooks the task (in the taskHook() function in boot.c).
If that stops the crash then you need to carefully examine the code in capt_seq.c and compare it to the firmware to see if there are any mistakes. Start by making it identical to the firmware (don't call any _my functions). Then you can gradually add the calls to the _my override functions to try and narrow it down.

Phil.

Ok, have already done that and yes it stops the crash if I comment the task hook out in boot.c.

And have commented out anything added in cap_seq and also the _my patches.

It does not crash if its exactly like the firmware.

It does not crash if all the add ins are added.

It only crashes if I use the _my patches.

*

Offline philmoz

  • *****
  • 2936
    • Photos
Re: port for A3300IS / what reference port to use?
« Reply #177 on: 09 / January / 2012, 13:57:20 »
It only crashes if I use the _my patches.

Each of the _my functions is also a copy of a routine in the firmware.
You have to do the same process for each of them in turn to track down where the problem is.
Carefully compare the code in each of the _my functions to the firmware, fix any problems, enable the function to be called and re-test.

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)


Re: port for A3300IS / what reference port to use?
« Reply #178 on: 09 / January / 2012, 18:45:16 »
It only crashes if I use the _my patches.

Each of the _my functions is also a copy of a routine in the firmware.
You have to do the same process for each of them in turn to track down where the problem is.
Carefully compare the code in each of the _my functions to the firmware, fix any problems, enable the function to be called and re-test.

Phil.

Yeah, I kinda realized what they did after looking super hard for something typed wrong, I saw when clicking on the sub address in the firmware for the _my string address,  it jumps me to the next routine thats in cap_seq file, and all jumped me to the right spot.

I manually typed in every address from the firmware, so frustrating, its probably something I am looking right at but keep missing it.

Everything is the same, all the R, codes, all the loc and subs, there were 3 locret and 1 ADRNE that was changed to LDRNE because that is how it was in the Ref port I used which was sx230. But thats all I see.

Guess I just need to keep looking, like you said, it has to be in there somewhere.

Just dont understand why the cam works fine with the _my address commented out and just using the address without _my added, I dont leave out the address I just get rid of the _my to make it look like the firmware.

If I get rid of the _my in the 3 lines its on, and enable all the added chdk lines, I can control the cam fine with chdk, my expsure goes from factory 15 sec to 75sec long, I get full control of aperture, I cant control the NR feature but by default it seems to turn it off cause I dont have to wait at all anymore after taking long exposures, my iso is controllable.

I could stop right now and use it, but it just bugs me that it must not be right if it wont work when I add _my at the end of the addreses in the 3 lines they were added to.


Re: port for A3300IS / what reference port to use?
« Reply #179 on: 09 / January / 2012, 19:48:40 »
Just dont understand why the cam works fine with the _my address commented out and just using the address without _my added, I dont leave out the address I just get rid of the _my to make it look like the firmware.
It works fine because when you change the _my addresses to the firmware addresses, capt_seq_task() & exp_drv_task() never execute most of the code in capt_seq.c - they just run the code in the original firmware.  So you don't get several of the features enabled by the CHDK hooks that way, like exposure times longer than 75 seconds and switchable NR settings and USB remote sync modes.

 

Related Topics