SX720 Porting thread - page 5 - DryOS Development - CHDK Forum supplierdeeply

SX720 Porting thread

  • 158 Replies
  • 41405 Views
*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SX720 Porting thread
« Reply #40 on: 29 / March / 2016, 13:43:27 »
Advertisements

Thanks, copied from gx7 it was commented too there, it should not?


Here are the build errors with CMD
make rebuild-stubs PLATFORM=sx720hs PLATFORMSUB=100e
make fir PLATFORM=sx720hs PLATFORMSUB=100e
Take a look at your platform/sx720hs/sub/100e/Makefile . You have left most of it commented out.

*

Offline srsa_4c

  • ******
  • 4057
Re: SX720 Porting thread
« Reply #41 on: 29 / March / 2016, 13:52:46 »

Thanks, copied from gx7 it was commented too there, it should not?
Don't know what source you're looking at. This is the file from g7x: https://www.assembla.com/spaces/chdk/subversion/source/HEAD/trunk/platform/g7x/sub/100d/Makefile

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SX720 Porting thread
« Reply #42 on: 29 / March / 2016, 15:47:58 »

Thanks srsa_4c my mistake I am using trunk-4577 think it is the same, will try to build again


EDIT1:  now it builds, attached new sources with the final check
EDIT2: First Test the cam screen stays black but the green led on back stays on all time, need to remove battery, but not broken the cam yet!


Still need help with


-shooting.c  >  MODES
-platform_kbd.h  > KEYS_MASKs and some other things
-platform_camera.h  >  Probably Propset and maybe Display size and some other tunnings
-main.c > Need to locate Focus length table in firmware > values are wrong  NUM_FL CF_EFL .....
-lib.c > Probably LED_PR
-also did not find yet this buffer >  return (char *)0x46f04300;  //this one is from g7x
kbd.c > Add keys, check jogdial stuff


stubs_entry_2.S  > Looks OK need build to verify
stubs_min.S  > PTE > DEF(focus_len_table,0xfdf2deb4)   //this one is from g7x
bin_comp_fix.h  > Looks OK
boot.c > Looks OK > neeeds test
capt_seq.c > looks OK but different
« Last Edit: 29 / March / 2016, 16:40:54 by asm1989 »

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SX720 Porting thread
« Reply #43 on: 30 / March / 2016, 06:18:28 »
Any guess on what is the best way to debug what is wrong if the led stays on all time?


*

Offline reyalp

  • ******
  • 12214
Re: SX720 Porting thread
« Reply #44 on: 30 / March / 2016, 13:28:45 »
Any guess on what is the best way to debug what is wrong if the led stays on all time?
My usual approach is to start with a minimal build and enabling things in stages, like
1) Just loader, blink LED in infinite loop
2) To somewhere early in boot.c, blink LED in infinite loop
3) Boot without any task hooks enabled, with just the canon diskboot code commented out to prevent a boot loop. Camera should boot normally and show card locked
4) Minimal kbd_task (don't need all the keyboard bits found, jogdial stuff etc)
5) spytask. Display stuff (like current bitmap/opacity buffer etc) can faked, but you need to know at least one address so drawing doesn't trash random memory

Once you have kbd_task and spytask running, ptp should work (assuming the stubs for it are OK), which lets you read memory etc without having a fully working display.
Don't forget what the H stands for.

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SX720 Porting thread
« Reply #45 on: 30 / March / 2016, 16:47:14 »
Thanks Reyalp will try, for now with this code just trying to emulate the normal boot of sx720 it hangs also with first with a blinking led instead of staying green all time
Code: [Select]



void __attribute__((naked,noinline)) boot() {
//sx720
    asm volatile ( // 0xfc02000c
"    movw    r0, #0x4000\n"
"    movt    r0, #0\n"
"    mov     sp, r0\n"
"    bl      sub_fc02007e\n"
"    ldr     r2, =0xc0242010\n"
"    ldr     r1, [r2]\n"
"    orr     r1, r1, #1\n"
"    str     r1, [r2]\n"
"    ldr     r0, =0xfcd3b79c\n"  // code copied from ROM
"    ldr     r1, =0x010e1000\n"   // to ram
"    ldr     r3, =0x010fce10\n"
"loc_fc02002a:\n"
"    cmp     r1, r3\n"
"    itt     lo\n"
"    ldrlo   r2, [r0], #4\n"
"    strlo   r2, [r1], #4\n"
"    blo     loc_fc02002a\n"
   // Install CreateTask patch
   //     "adr     r0, patch_CreateTask\n"    // Patch data
   //     "ldm     r0, {r1,r2}\n"             // Get two patch instructions
   //     "ldr     r0, =hook_CreateTask\n"    // Address to patch (hook_ has thumb bit off)
   //     "stm     r0, {r1,r2}\n"             // Store patch instructions


"    ldr     r0, =0x010e1000\n"
"    ldr     r1, =0x0001be10\n"
"    bl      sub_fc13d49a\n"     // cache stuff, function used in loader
"    ldr     r0, =0xfcd575ac\n"  // DATA copied
"    ldr     r1, =0xbfe10800\n"  // to RAM
"    ldr     r3, =0xbfe1751d\n"


"loc_fc020046:\n"
"    cmp     r1, r3\n"
"    itt     lo\n"
"    ldrlo   r2, [r0], #4\n"
"    strlo   r2, [r1], #4\n"
"    blo     loc_fc020046\n"
"    ldr     r0, =0xfcd1088c\n"
"    ldr     r1, =0x00008000\n"
"    ldr     r3, =0x00032f10\n"


"loc_fc02005a:\n"
"    cmp     r1, r3\n"
"    itt     lo\n"
"    ldrlo   r2, [r0], #4\n"
"    strlo   r2, [r1], #4\n"
"    blo     loc_fc02005a\n"
"    ldr     r3, =0x00032f10\n"
"    ldr     r1, =0x00395364\n" //  *"dS9"
"    mov.w   r2, #0\n"


"loc_fc020070:\n"         // some extra in SX720 vs d7x
"    cmp     r3, r1\n"
"    it      lo\n"
"    strlo   r2, [r3], #4\n"
"    blo     loc_fc020070\n"
"    b.w     sub_fc05b1f8\n"  //

*

Offline reyalp

  • ******
  • 12214
Re: SX720 Porting thread
« Reply #46 on: 30 / March / 2016, 17:02:10 »
Thanks Reyalp will try, for now with this code just trying to emulate the normal boot of sx720 it hangs also with first with a blinking led instead of staying green all time
From the quoted code, it's not clear what you are doing in the rest of the boot process. If you autoboot without the diskboot stuff disable, the camera will end up in a boot loop. If FI2 loading is working, you could avoid this by booting FI2 instead, with the card unlocked or diskboot not present. You also probably need the heap start / MEMISOSTART mod to successfully boot.

However, I would still start by confirming that you can blink an LED in the loader, and then move incrementally through the rest of the process.
Don't forget what the H stands for.

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SX720 Porting thread
« Reply #47 on: 31 / March / 2016, 02:37:09 »
FI2 says firmware update error, without diskboot and card unlocked


*

Offline reyalp

  • ******
  • 12214
Re: SX720 Porting thread
« Reply #48 on: 31 / March / 2016, 13:09:24 »
FI2 says firmware update error, without diskboot and card unlocked
This usually means the key or IV is wrong, although it is also possible Canon has changed the format again.
Don't forget what the H stands for.

*

Offline asm1989

  • *****
  • 527
  • SX720, SX260, SX210 & SX200
Re: SX720 Porting thread
« Reply #49 on: 01 / April / 2016, 03:24:51 »
Thanks reyalp,

Maybe it is a format thing, Keys looks right, maybe you could double check

FI2 >  FC63.....4DCD
IV > F7C1.....8398
Dancing bits { 1,3,7,4,5,6,0,2 }


EDIT: I also make the blinker going with this at my_restart, so the the led address are right  :D


Code: [Select]
while(1) {
        int i;
        *(volatile int*)0xd20b0994 = 0x4d0002;
        for(i=0;i<1000000;i++) {
            asm volatile(
            "nop\n"
            );
        }
        *(volatile int*)0xd20b0994 = 0x4c0003;
        for(i=0;i<1000000;i++) {
            asm volatile(
            "nop\n"
            );
        }
« Last Edit: 01 / April / 2016, 10:59:06 by asm1989 »

 

Related Topics