port for A3300IS / what reference port to use? - page 4 - General Discussion and Assistance - CHDK Forum

port for A3300IS / what reference port to use?

  • 289 Replies
  • 105855 Views
Re: port for A3300IS / what reference port to use?
« Reply #30 on: 29 / December / 2011, 11:19:19 »
Advertisements
Now, is there anyway I can use extend.m to make it easier to pinpoint the led address so once i find it i can bring it to main.c to test with the diskboot.bin to test if I have everything correct, its all compiling fine just no boot or nothing at all, I corrected everything I got from the Stubs_entry file, I have not worked on the boot.c file yet, from what I have read, I am guessing I can get the leds to light with the compiled BIN just by adding code to main.c or entry.s even without working on the other files in platform, I just wanted to make sure the bootbin would work before I went and corrected all those addresses in the platform folder files, but I will if thats a must????

Re: port for A3300IS / what reference port to use?
« Reply #31 on: 29 / December / 2011, 11:45:15 »
@mk11174 :   You are making my head spin around and my brain hurt with your long extended single sentence posts.   Can you break things up into sentences or bullet points please ?

Now, is there anyway I can use extend.m to make it easier to pinpoint the led address
When I was playing with my first port,  I seem to recall that I used the poke statement to try out different addresses.  In hind sight, that was VERY dangerous as I could easily have "bricked" my camera.

Quote
from what I have read, I am guessing I can get the leds to light with the compiled BIN just by adding code to main.c or entry.s
Yes
 

Ported :   A1200    SD940   G10    Powershot N    G16

Re: port for A3300IS / what reference port to use?
« Reply #32 on: 29 / December / 2011, 12:13:16 »
@mk11174 :   You are making my head spin around and my brain hurt with your long extended single sentence posts.   Can you break things up into sentences or bullet points please ?

Now, is there anyway I can use extend.m to make it easier to pinpoint the led address
When I was playing with my first port,  I seem to recall that I used the poke statement to try out different addresses.  In hind sight, that was VERY dangerous as I could easily have "bricked" my camera.

Quote
from what I have read, I am guessing I can get the leds to light with the compiled BIN just by adding code to main.c or entry.s
Yes
 


I am sorry, I will try to break things up better.

So is there a certain range I should just try 1 at a time?

Is it safer to just change address, compile and try every number till I get a light?

Does it matter if the MEMISOSTART address is wrong for this to work for finding the right LED address, this is the only address in makefile.inc I am unsure of.

I am pretty sure the other are right they seem to be common in other ports?
MEMBASEADDR=0x1900
RESTARTSTART=0x50000
ROMBASEADDR=0xFF810000
MAXRAMADDR=0x07FFFFFF
MEMISOSTART=0x79089e0

Re: port for A3300IS / what reference port to use?
« Reply #33 on: 29 / December / 2011, 12:32:44 »
I am sorry, I will try to break things up better.
Thanks !

Quote
So is there a certain range I should just try 1 at a time?
You could try the values from recent ports released the same time as your camera I guess ?

Quote
Is it safer to just change address, compile and try every number till I get a light?
There is some risk and it could take a long time.

Quote
Does it matter if the MEMISOSTART address is wrong for this to work for finding the right LED address, this is the only address in makefile.inc I am unsure of.
From the wiki : http://chdk.wikia.com/wiki/Adding_support_for_a_new_camera

MEMISOSTART: points to the start of the memory pool used by the firmware (you can find this address at the end of the first piece of code in the firmware for DryOS).
Ported :   A1200    SD940   G10    Powershot N    G16

Re: port for A3300IS / what reference port to use?
« Reply #34 on: 29 / December / 2011, 13:50:27 »
Ok, I think I narrowed it down using a code for poking mem addresses for leds, I kept only search small areas of 100's and I got all lights to come on at addresess 0xC0220099 to 0xC0220100  the power light comes, then AF light, then a flash after a few seconds.

Am I on the right track?

How can I test just one of the addresses?

I tried putting just one address instead of to another and nothing happened with either address?

Re: port for A3300IS / what reference port to use?
« Reply #35 on: 29 / December / 2011, 14:03:54 »
Ok, I think I narrowed it down using a code for poking mem addresses for leds, I kept only search small areas of 100's and I got all lights to come on at addresess 0xC0220099 to 0xC0220100  the power light comes, then AF light, then a flash after a few seconds. Am I on the right track?
Yes

Quote
How can I test just one of the addresses? I tried putting just one address instead of to another and nothing happened with either address?
I'd need to see the code you are using to answer that question. Post it here?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: port for A3300IS / what reference port to use?
« Reply #36 on: 29 / December / 2011, 14:06:27 »
Code: [Select]
private sub ledPoke()
  a = LCDMsg_Create()

  LCDMsg_Move(a,42,35)

  LCDMsg_ChangeColor(a, 6)

  LCDMsg_SetStr(a,"Search memory for LED's")

  Wait(1000)  ' Give time to draw

  BeepDrive(4)
  Wait(1000)
  ' Start poking here

  for c = 0xC0220099 to 0xC0220100
    Poke8(c, 0x46)
    'Wait(1000)
  next


  ' Stop poking here
  BeepDrive(4)
  Wait(1000)
end sub

private sub Initialize()
  UI.CreatePublic()
  System.Create()
  Driver.Create()

  ledPoke()
end sub

private sub Terminate()

end sub
« Last Edit: 29 / December / 2011, 14:09:39 by mk11174 »

Re: port for A3300IS / what reference port to use?
« Reply #37 on: 29 / December / 2011, 14:24:30 »
On the road right now so can't test it but you get the idea I hope :
Code: [Select]
DIM msgstr=0

private sub ledPoke()
  a = LCDMsg_Create()

  LCDMsg_Move(a,42,35)

  LCDMsg_ChangeColor(a,6)

  LCDMsg_SetStr(a,"Search memory for LED's")

  Wait(1000)  ' Give time to draw

  BeepDrive(4)
  Wait(1000)
  ' Start poking here

  for c = 0xC0220099 to 0xC0220100
    Poke8(c, 0x46)
sprintf(msgstr,"LED address = %0X",c)
LCDMsg_SetStr(a,msgstr)
    Wait(1000)
  next


  ' Stop poking here
  BeepDrive(4)
  Wait(1000)
end sub

private sub Initialize()
  UI.CreatePublic()
  System.Create()
  Driver.Create()
 
  msgstr = AllocateMemory(80)
 
  ledPoke()
 
  FreeMemory(msgstr)
end sub

private sub Terminate()

end sub

Update : removed space in LCDMsg_ChangeColor per mk11174's post below
« Last Edit: 29 / December / 2011, 16:12:50 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: port for A3300IS / what reference port to use?
« Reply #38 on: 29 / December / 2011, 14:47:33 »
On the road right now so can't test it but you get the idea I hope :
Code: [Select]
DIM msgstr=0

private sub ledPoke()
  a = LCDMsg_Create()

  LCDMsg_Move(a,42,35)

  LCDMsg_ChangeColor(a, 6)

  LCDMsg_SetStr(a,"Search memory for LED's")

  Wait(1000)  ' Give time to draw

  BeepDrive(4)
  Wait(1000)
  ' Start poking here

  for c = 0xC0220099 to 0xC0220100
    Poke8(c, 0x46)
sprintf(msgstr,"LED address = %0X",c)
LCDMsg_SetStr(a,msgstr)
    Wait(1000)
  next


  ' Stop poking here
  BeepDrive(4)
  Wait(1000)
end sub

private sub Initialize()
  UI.CreatePublic()
  System.Create()
  Driver.Create()
 
  msgstr = AllocateMemory(80)
 
  ledPoke()
 
  FreeMemory(msgstr)
end sub

private sub Terminate()

end sub
Ok, at first it just froze cam, but after examining it, i saw there was a space after the comma for change color, i fixed that and it seemed to work, very cool, once i saw sprintf, i was like cool, this is going to show me the addresses, i didnt realize how many addresses were in between 99 and 100, thanks.

Update: the code was fine, it just seems to freeze cam up every once in awhile resetting battery fixes it regardless of the space after the , for the change color line.
« Last Edit: 29 / December / 2011, 15:10:13 by mk11174 »

Re: port for A3300IS / what reference port to use?
« Reply #39 on: 29 / December / 2011, 14:54:25 »
Green Power = 0xC02200F0
AF Led = 0xC02200F4
Flash = 0xC02200D4
« Last Edit: 29 / December / 2011, 15:04:08 by mk11174 »

 

Related Topics


SimplePortal © 2008-2014, SimplePortal