SX260 HS Porting Thread - page 11 - DryOS Development - CHDK Forum  

SX260 HS Porting Thread

  • 642 Replies
  • 222963 Views
*

Online philmoz

  • *****
  • 3450
    • Photos
Re: SX260 HS Porting Thread
« Reply #100 on: 20 / April / 2012, 06:53:06 »
Advertisements

Code: [Select]
        "LDR     R0, =0xFF680924\n"
        "LDR     R1, =0x685000\n"
        "LDR     R3, =0x69544C\n"


0xFF680924 is the start of the firmware block copied to RAM
0x685000 is the address the block is copied to in RAM
0x69544C is the end address used to terminate the loop that copies the data - i.e. the amount of data copied is 0x69544C - 0x685000 = 66636 bytes.

What are the exact symptoms you are getting - from previous posts it seems you get the CHDK logo, is that correct?
Is the source from the earlier post still current?

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)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SX260 HS Porting Thread
« Reply #101 on: 20 / April / 2012, 11:06:42 »
philmoz, yes logo shows disappears and shuts down, code is the same

PD: I think there is a new task in this cams "AvsTask" and we need to hook and chage something?,

In sx260 starts at sub_FF049488
« Last Edit: 20 / April / 2012, 13:49:31 by asm1989 »

*

Online philmoz

  • *****
  • 3450
    • Photos
Re: SX260 HS Porting Thread
« Reply #102 on: 20 / April / 2012, 18:03:34 »
philmoz, yes logo shows disappears and shuts down, code is the same

PD: I think there is a new task in this cams "AvsTask" and we need to hook and chage something?,

In sx260 starts at sub_FF049488

There are many tasks that the camera runs that we don't hook - why would you need to hook this one.

The first thing I would do is disable all the tasks hooks, as a single mistake in any of the five override functions in your code could cause the behaviour you are seeing.

I also found that the taskHook function needed changing in the G1X so give the code below a try for you taskHook code.

Code: [Select]
void __attribute__((naked,noinline)) taskHook(context_t **context)
{
    asm volatile("STMFD   SP!, {R0-R12,LR}\n");     // G1X crashes without this
   
    task_t *tcb=(task_t*)((char*)context-offsetof(task_t, context));

    // Replace firmware task addresses with ours
    //if(tcb->entry == (void*)task_CaptSeq) tcb->entry = (void*)capt_seq_task;
    //if(tcb->entry == (void*)task_InitFileModules) tcb->entry = (void*)init_file_modules_task;
    //if(tcb->entry == (void*)task_RotaryEncoder) tcb->entry = (void*)JogDial_task_my;
    //if(tcb->entry == (void*)task_MovieRecord) tcb->entry = (void*)movie_record_task;
    //if(tcb->entry == (void*)task_ExpDrv) tcb->entry = (void*)exp_drv_task;
   
    asm volatile("LDMFD   SP!, {R0-R12,PC}\n");     // G1X crashes without this
}

It's generally better to get things running with out any of the task overrides in place first then enable them one at a time.

Doing them all at once is very hard - as I said a single mistake will crash the camera.

Congrats on getting it to boot and show the logo at least - that's a huge step, and it's a good feeling when you finally see something happening :)

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)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SX260 HS Porting Thread
« Reply #103 on: 21 / April / 2012, 03:43:18 »
@philmoz

yes seen the logo for almost two weeks  :'(

with the G1X the result & romlog is the same, and disabling all the tasks too
only the romlog is shorter but the final part is the same

thanks anyway any other tips will be welcome,

I think about the avstask because we may have to change something there.




*

Online philmoz

  • *****
  • 3450
    • Photos
Re: SX260 HS Porting Thread
« Reply #104 on: 21 / April / 2012, 04:28:11 »
@philmoz

yes seen the logo for almost two weeks  :'(

with the G1X the result & romlog is the same, and disabling all the tasks too
only the romlog is shorter but the final part is the same

thanks anyway any other tips will be welcome,

I think about the avstask because we may have to change something there.


What happens if you comment out the call to CreateTask_spytask in task_Startup_my and call sub_FF01F188 instead of taskcreatePhySw_my?

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)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SX260 HS Porting Thread
« Reply #105 on: 21 / April / 2012, 05:33:22 »
Quote
What happens if you comment out the call to CreateTask_spytask in task_Startup_my and call sub_FF01F188 instead of taskcreatePhySw_my?

Same crash & Romlog & Behaivour  but no chdk logo shown

That's why I thing is something new not related to the previous cams

*

Online philmoz

  • *****
  • 3450
    • Photos
Re: SX260 HS Porting Thread
« Reply #106 on: 21 / April / 2012, 06:18:01 »
In your boot.c you have this (lines 203-205)
Code: [Select]
        "LDR     R0, =0x3333330\n"
        "MCR     p15, 0, R0,c5,c0, 2\n"
        "LDR     R0, =0x3333330\n"

it should be:
Code: [Select]
        "LDR     R0, =0x33333330\n"
        "MCR     p15, 0, R0,c5,c0, 2\n"
        "LDR     R0, =0x33333330\n"

You're missing a 3 off each value loaded into R0.

Don't know if this will help or not; but it's worth checking.

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)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SX260 HS Porting Thread
« Reply #107 on: 21 / April / 2012, 06:51:43 »
TTTTT   H  H       A        N   N     K  K     Y   Y    OOO     U   U        PPP      H  H       I    L
   T       HHH      A  A     N N N     KK        Y       O   O     U  U         PPP      HHH      I     L
   T       H  H     A     A    N   N     K  K      Y       OOO     UUU         P          H  H      I     LLL

First no crash, don't know how I miss thiss,

now for the keyboard and the rest!


*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SX260 HS Porting Thread
« Reply #108 on: 21 / April / 2012, 12:12:52 »
So now I'm starting to setup all the keys,  the debug phys stuff works

But still not able to bring up the chdk menu.

chdk menu shows,

Two questions:

I'm using the video rec button for ALT, is there a way to disable the canon use for this button?

And about the led thing, Is there another way I can find the led address now that its stable and chdk loaded?
« Last Edit: 21 / April / 2012, 13:00:58 by asm1989 »

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SX260 HS Porting Thread
« Reply #109 on: 21 / April / 2012, 13:40:09 »
Ok,  Still a lot to do but, seems that ISO overrides are working & sup-fine quality too, RAW hangs for now dont try.

For now the chdk menu goes with the video-rec button (sorry it records video each time you go into chdk menu), and only loads with autoload method.

anyway use it at your own risk, included attached first working binaries chdk1812 compiled & the latest sources too.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal