I am calling that with a BL but not sure which registers are trashed, will use better ASM_SAFE("BL...
int turn_on_led(int x) { *(volatile int*)0xd20b0994 = 0x4d0002; return x;}
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"" 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" /// task hook here due to dual ram sugested by reyalp // 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
I am still stuck in boot, blink works ok, but seems to hang here "ldr r0, =hook_CreateTask\n" before that I can blink ok, any clue?
Thanks srsa_4c, attached dump, and the full sources with the last build are here http://filebin.net/j8v0njj83iwithout the 4 hook lines in boot it gets to a few lines bellow in boot but fails too
int blinkout(int x){ *(volatile int*)0xd20b0994 = 0x4c0003; return x;}int blinkin(int x){ *(volatile int*)0xd20b0994 = 0x4d0002; return x;}
I am using this twoCode: [Select]int blinkout(int x){ *(volatile int*)0xd20b0994 = 0x4c0003; return x;}int blinkin(int x){ *(volatile int*)0xd20b0994 = 0x4d0002; return x;}
00395564 <blinkout>: 395564: 4a01 ldr r2, [pc, #4] ; (39556c <blinkout+0x8>) 395566: 4b02 ldr r3, [pc, #8] ; (395570 <blinkout+0xc>) 395568: 601a str r2, [r3, #0] 39556a: 4770 bx lr 39556c: 004c0003 .word 0x004c0003 395570: d20b0994 .word 0xd20b099400395574 <blinkin>: 395574: 4a01 ldr r2, [pc, #4] ; (39557c <blinkin+0x8>) 395576: 4b02 ldr r3, [pc, #8] ; (395580 <blinkin+0xc>) 395578: 601a str r2, [r3, #0] 39557a: 4770 bx lr 39557c: 004d0002 .word 0x004d0002 395580: d20b0994 .word 0xd20b0994
void __attribute__((naked,noinline)) blinkin() { asm volatile (" push {r0, r1} \n"" ldr r0, =0xd20b0994 \n"" ldr r1, =0x4d0002 \n"" str r1, [r0] \n"" pop {r0, r1} \n"" bx lr \n" );}void __attribute__((naked,noinline)) blinkout() { asm volatile (" push {r0, r1} \n"" ldr r0, =0xd20b0994 \n"" ldr r1, =0x4c0003 \n"" str r1, [r0] \n"" pop {r0, r1} \n"" bx lr \n" );}
Thanks srsa_4c using these two get the crash in the same places
Started by waterwingz « 1 2 ... 54 55 » DryOS Development
Started by Qanthelas « 1 2 ... 27 28 » DryOS Development
Started by reyalp « 1 2 ... 16 17 » DryOS Development
Started by tim dif « 1 2 » CHDK Releases
Started by sekx17 CHDK Releases