reyalp, ROMLOG header looks very strange to me...
Maybe different cameras uses different offsets.
Can someone else post ROMLOG example?
Here is the code from A540 disassembly:
ROM:FFECAAB0 LDR R1, [R4]
ROM:FFECAAB4 MOV R2, #0x190 <--- Size of data to add
ROM:FFECAAB8 MOV R0, R6
ROM:FFECAABC BL sub_FFECA2F0 <--- Add data to ROMLOG
ROM:FFECAAC0 LDR R3, [R5]
ROM:FFECAAC4 LDR R2, [R4]
ROM:FFECAAC8 STR R0, [R3,#0x54] <--- Save data size at offset 0x54
ROM:FFECAACC ADD LR, SP, #4
ROM:FFECAAD0 LDR R0, [R2,#0xD8]
ROM:FFECAAD4 MOV R1, R7
ROM:FFECAAD8 MOV R12, LR
ROM:FFECAADC
ROM:FFECAADC loc_FFECAADC ; CODE XREF: sub_FFECA8CC+224j
ROM:FFECAADC MOV R3, R1,LSL#2
ROM:FFECAAE0 LDR R2, [R0,R3]
ROM:FFECAAE4 ADD R1, R1, #1
ROM:FFECAAE8 CMP R1, #0xE
ROM:FFECAAEC STR R2, [R12,R3]
ROM:FFECAAF0 BLE loc_FFECAADC
ROM:FFECAAF4 LDR R3, =0x74344
ROM:FFECAAF8 LDR R2, [R3]
ROM:FFECAAFC LDR R1, [R2,#0xD8]
ROM:FFECAB00 LDR R3, [R1,#0x3C]
ROM:FFECAB04 STR R3, [SP,#0x40]
ROM:FFECAB08 LDR R12, [R1,#0x40]
ROM:FFECAB0C MOV R3, #0
ROM:FFECAB10 MOV R1, LR
ROM:FFECAB14 MOV R2, #0x48 <--- Size of data to add
ROM:FFECAB18 MOV R0, R6
ROM:FFECAB1C STR R3, [SP,#0x48]
ROM:FFECAB20 STR R12, [SP,#0x44]
ROM:FFECAB24 BL sub_FFECA2F0 <--- Add data to ROMLOG
ROM:FFECAB28 LDR R4, =0x7433C
ROM:FFECAB2C LDR R3, [R4]
ROM:FFECAB30 MOV R1, R8
ROM:FFECAB34 STR R0, [R3,#0x58] <--- Save data size at offset 0x58
ROM:FFECAB38 MOV R2, #0x80 <--- Size of data to add
ROM:FFECAB3C MOV R0, R6
ROM:FFECAB40 BL sub_FFECA2F0 <--- Add data to ROMLOG
ROM:FFECAB44 LDR R3, [R4]
ROM:FFECAB48 STR R0, [R3,#0x5C] <--- Save data size at offset 0x5C
ROM:FFECAB4C MOV R0, R6
ROM:FFECAB50 BL sub_FFECA348 <--- Add Camera Log messages to ROMLOG
ROM:FFECAB54 LDR R2, [R4]
ROM:FFECAB58 STR R0, [R2,#0x60] <--- Save data size at offset 0x60
So you should have in your dump:
data section starts at offset 0x74
dump_offset=0x54 - value 0x190 - size of task context, dumped to the data section
dump_offset=0x58 - value 0x48 - size of registers dump, dumped to the data section
dump_offset=0x5C - value 0x80 or less, !!divisible by 4 - dumped stack size, dumped to the data section
dump_offset=0x60 - any value, length of camera log messages, dumped to the data section
First four bytes of ROMLOG is the size of log itself.
So you should have:
SIZE(from first 4 bytes)=0x74(Header)+CONTEXT_SIZE+REGS_SIZE+STACK_DMP_SIZE+CAM_LOG_SIZE
With my log all this is true.
But everything wrong with yours.
Context size is Ok = 0x190.
Regs size is weird = 0x84, but should be 0x48
Stack dump size is weird = 0x0A, should be 0x80 or less, but should be divisible by 4!!
Camera log size is weird = 0x0A, while you could see plaintext log at the end of the file and it is much larger
And I don't know why...
Disassembler does not show any reasons...