File-size causing camera crash - General Discussion and Assistance - CHDK Forum

File-size causing camera crash

  • 4 Replies
  • 3962 Views
File-size causing camera crash
« on: 01 / March / 2008, 06:10:10 »
Advertisements
An A560 user recently tried running SDM.

After the splash-screen and brief flash of the blue LED, the camera would crash.

SDM and another build that worked were compared and the platform and loader code was identical.

Absolutely no coding errors were detected.

Basically, the working other build was stripped-down to the minimum functions and then the SDM code added.

It continued to work until the very last source-file was replaced with the SDM version.

That file is raw.c.

The only addition to the 'standard' raw.c is code to save csv and xml files.

Those functions are ONLY called from within raw.c so they were commented-out.

The camera still crashed !

Removing the code for saving csv files allowed the camera to work if you press the ON button very quickly.

Then, also removing the code for saving xml files allowed the camera to work normally.

There is more than enough memory allocated and no other camera has this problem.

For now, the code for those two functions is not compiled for the A560, they are empty functions.

Very strange  ................



David

*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: File-size causing camera crash
« Reply #1 on: 01 / March / 2008, 06:53:06 »
Looked into sources (eventually found them)...
It seems you forgot to increment reserved memory (I see you tried increasing memory size to 0x32000 in 'makefile.inc') in the 'platform\a560\sub\100a\boot.c':

   "LDR    R2, =0xD6090\n" //0xA6090+0x30000
CHDK Developer.

Re: File-size causing camera crash
« Reply #2 on: 01 / March / 2008, 07:07:15 »
Looked into sources (eventually found them)...
It seems you forgot to increment reserved memory (I see you tried increasing memory size to 0x32000 in 'makefile.inc') in the 'platform\a560\sub\100a\boot.c':

   "LDR    R2, =0xD6090\n" //0xA6090+0x30000



I was actually testing with the next working-version of SDM and have  :-

"LDR     R2, =0xD8C30\n"   // 0xA6C30 + 0x32000


I will have to check why original address is 0xA6090 in one version and 0xA6C30 in another.



*

Offline GrAnd

  • ****
  • 916
  • [A610, S3IS]
    • CHDK
Re: File-size causing camera crash
« Reply #3 on: 01 / March / 2008, 07:17:29 »
It seems you modified the value in the commented out section...

Code: (c) [Select]
void  h_usrKernelInit()
{
    /*asm volatile (
"STMFD   SP!, {R4,LR}\n"
"SUB     SP, SP, #8\n"
"BL      sub_FFCD3C1C\n"
"BL      sub_FFCE3D48\n"
"LDR     R3, =0x4FD8\n"
"LDR     R2, =0xA3B40\n"
"LDR     R1, [R3]\n"
"LDR     R0, =0xA4690\n"
"MOV     R3, #0x100\n"
"BL      sub_FFCDF938\n"
"LDR     R3, =0x4F98\n"
"LDR     R0, =0x5338\n"
"LDR     R1, [R3]\n"
"BL      sub_FFCDF938\n"
"LDR     R3, =0x5054\n"
"LDR     R0, =0xA4664\n"
"LDR     R1, [R3]\n"
"BL      sub_FFCDF938\n"
"BL      sub_FFCE8104\n"
"BL      sub_FFC012AC\n"
"MOV     R4, #0\n"
"MOV     R3, R0\n"
"MOV     R12, #0x800\n"
"LDR     R0, =h_usrRoot\n"
"MOV     R1, #0x4000\n"
"LDR     R2, =0xD8C30\n" // 0xA6C30 + 0x32000
"STR     R12, [SP]\n"
"STR     R4, [SP,#4]\n"
"BL      sub_FFCE0F88\n"
"ADD     SP, SP, #8\n"
"LDMFD   SP!, {R4,PC}\n"
    );*/
   
    asm volatile (
"STMFD SP!, {R4,LR}\n"
"SUB SP, SP, #8\n"
"BL sub_FFCCB79C\n" //classLibInit
"BL sub_FFCDB8C8\n" //taskLibInit
"LDR R3, =0x4F28\n"
"LDR R2, =0xA3200\n"
"LDR R1, [R3]\n"
"LDR R0, =0xA3D50\n"
"MOV R3, #0x100\n"
"BL sub_FFCD74B8\n" //qInit
"LDR R3, =0x4EE8\n"
"LDR R0, =0x5288\n"
"LDR R1, [R3]\n"
"BL sub_FFCD74B8\n" //qInit
"LDR R3, =0x4FA4\n"
"LDR R0, =0xA3D24\n"
"LDR R1, [R3]\n"
"BL sub_FFCD74B8\n" //QInit
"BL sub_FFCDFC84\n" //workQInit
"BL sub_FFC012AC\n"
"MOV R4, #0\n"
"MOV R3, R0\n"
"MOV R12, #0x800\n"
"LDR R0, =h_usrRoot\n" //sub_FFC01A5C
"MOV R1, #0x4000\n"
"LDR R2, =0xD6090\n" //0xA6090+0x30000
"STR R12, [SP]\n"
"STR R4, [SP,#4]\n"
"BL sub_FFCD8B08\n" //kernelInit
"ADD SP, SP, #8\n"
"LDMFD SP!, {R4,PC}\n"
    );
}

Heh... Syntax highlighting sometimes can be very useful...
CHDK Developer.

Re: File-size causing camera crash
« Reply #4 on: 01 / March / 2008, 07:21:49 »
It seems you modified the value in the commented out section...



Aaaaahhhhhhhhhhh     :-)

OK.

Syntax highlighting for me !

I guess it HAD to be a memory allocation problem (even though file-size reported by compiler was fine).

I shall change that.


David

 

Related Topics


SimplePortal © 2008-2014, SimplePortal