This functions are camera specific:
void __attribute__((naked,noinline)) sd_debug_printf_0() {
asm volatile(
"push {r0-r3}\n"
"push.w {r4-r9,lr}\n"
"push {r1-r7}\n"
// "sub sp, sp, #0x44\n"
"mov r7, lr\n"
"ldr r2, =0x845C\n" // Current time
"ldr r2, [r2]\n"
"ldr r6, =0x003A0010\n" // Pointer in my debug buffer
"ldr r0, [r6]\n"
"ldr r1, =sstri\n"
"mov r5, r0\n"
"bl sprintf\n"
"add r5, r0, r5\n"
"ldr r2, =0x803C\n" //Current task name
"ldr r2, [r2]\n"
"ldr r2, [r2, #0x24]\n"
"mov r3, r7\n"
"ldr r1, =sstri2\n"
"mov r0, r5\n"
"bl sprintf\n"
"add r0, r0, r5\n"
"str r0, [r6]\n"
"pop {r1-r7}\n"
"bl sprintf\n"
"ldr r6, =0x003A0010\n"
"ldr r5, [r6]\n"
"add r0, r0, r5\n"
"str r0, [r6]\n"
"pop.w {r4-r9,lr}\n"
"pop {r0-r3}\n"
"bx lr\n"
// "ldr pc,=0x010f3fb5\n"
"sstri:\n"
".asciz \"\n%05d: \"\n"
".ltorg\n"
"sstri2:\n"
".asciz \"%s:0x%08x: \"\n"
".ltorg\n"
);
}
void __attribute__((naked,noinline)) sd_debug_cmd() {
asm volatile(
// "mov r5, r0\n"
// "lsls r0, r1, #0x1a\n"
// "lsrs r1, r2, #0x18\n"
// "lsrs r0, r0, #0x12\n"
// "ldr.w pc,=0x010f1a65\n"
"push {r0-r3}\n"
"push.w {r4-r9,lr}\n"
"mov r8, r1\n"
"mov r9, r2\n"
"mov r7, lr\n"
"ldr r2, =0x845C\n" // Current time
"ldr r2, [r2]\n"
"ldr r6, =0x003A0010\n"
"ldr r0, [r6]\n"
"str r1, [r6, #0x18]\n"
"ldr r1, =csstri\n"
"mov r5, r0\n"
"bl sprintf\n"
"add r5, r0, r5\n"
"ldr r2, =0x803C\n" //Current task name
"ldr r2, [r2]\n"
"ldr r2, [r2, #0x24]\n"
"mov r3, r7\n"
"ldr r1, =csstri2\n"
"mov r0, r5\n"
"bl sprintf\n"
"add r5, r0, r5\n"
"mov r2, r8\n" //Current CMD
"mov r3, r9\n" //Current CMD argument
"ldr r1, =csstri3\n"
"mov r0, r5\n"
"bl sprintf\n"
"add r0, r0, r5\n"
"str r0, [r6]\n"
"pop.w {r4-r9,lr}\n"
"pop {r0-r3}\n"
// "bx lr\n"
"mov r5, r0\n" // Original code
"lsls r0, r1, #0x1a\n"
"lsrs r1, r2, #0x18\n"
"lsrs r0, r0, #0x12\n"
"ldr pc,=0x010f1a65\n"
"csstri:\n"
".asciz \"\n%05d: \"\n"
".ltorg\n"
"csstri2:\n"
".asciz \"%s:0x%08x: \"\n"
".ltorg\n"
"csstri3:\n"
".asciz \"[CMD%d]=0x%08x\"\n"
".ltorg\n"
);
}
I wonder why you didn't it by yourself...