Re: concerns about filewrite 'skip-dir' and 'skip-flush' code sections.. I believe I can now insert logging statements and compile with success.
//mod start" LDR R3, =ignore_current_write\n" // !!" LDR R3, [R3]\n"" CMP R3, #0\n"" BNE loc_A\n" // skip creating directory//mod end" BL sub_FF027628 \n"" MOV R1, #0 \n"" MOV R0, #0x48 \n"" BL sub_FF0CA2F0 \n"" ADD R0, R4, #0x58 \n"" BL sub_FF030DA4 \n"" LDR R1, [R5, #0x1C] \n"" BL sub_FF02EC74 \n""loc_A:\n"" LDR R1, [R5, #0x14] \n"" CMP R1, #0 \n"" BEQ loc_FF3AF220 \n"" LDR R0, [R4, #0x10] \n"" B loc_FF3AF40C \n"
Note up front that I do not have calls to debug-log everywhere I'd like. Seems as though the call to debug-log can only be in one place, or the camera crashes..
#include "asmsafe.h"... asm volatile (".... asm code..."ASM_SAFE("bl my_log\n")".... more asm code..."
With the call to debug-logging in its current location, the camera runs almost all the tests without error, and logs some debug info as well..
void log_r7(int val) { _LogCameraEvent(0x60,"fw r7 %08x",val);}..." BL sub_FF02D9F0 \n""loc_B:\n"" MOV R7, R0 \n""bl log_r7\n"" ADD R0, R4, #0x58 \n"
_LogCameraEvent(0x60,"fw *0x107BC %08x",*(int *)(0x107BC));
00035970: UI:fw A/CacheFlush00035970: UI:fw u 00000000 09200000 00000000 00000000 00000000 001a531000036000: UI:ScreenLock00036000: UI:ScreenUnLock00036000: UI:fw cb:0xff1d77ec 153092096
Almost?
On elph130, the callback is called in normal operation. It releases some semaphores and does various other stuff. I'd expect sx530 does as well.I've attached the code I used as an example. Here's a snippet of the logCode: [Select]00035970: UI:fw A/CacheFlush00035970: UI:fw u 00000000 09200000 00000000 00000000 00000000 001a531000036000: UI:ScreenLock00036000: UI:ScreenUnLock00036000: UI:fw cb:0xff1d77ec 153092096The second number is the parameter passed to the callback function (=0x9200000 in this case), which is probably related to the values controlled by R7 on sx530
43 test runs so far. Two tests errored and failed.I think SCN mode fails in same way as CREATIVE. M, LIVE, AUTO, AUTO-Hybrid, FISHEYE, and MOVIE modes were ok - no crashes. Sometimes no image, sometimes no logging, but no crashes. I did not test Tv, Av shooting modes yet.
#1 is almost certainly yes, based on the elph130 result.#2 is yes for existing working ports, since they call the callback even in the case file writing is skipped.#3 is unknown, but I'd probably ignore it for now.#4 is unknown, but from elph130 it looks complicated enough that there isn't an obvious value to use in the case where file writing is skippedNew questions:Following on #2, is what happens if the callback is skipped when the write is skipped? If it turns out to be OK, this is an easy solution.If it's not OK, then we need to understand then we have to figure out what value to use for the R7 value. Observing this might provide a simple solution anyway.
4) I am not sure I captured R7 correctly.
NewQ) If I understand what 'skip the write' means,
All tests that make use of chdk filewritetask seem to behave ok.
" LDR R3, =ignore_current_write\n" // mod start" LDR R3, [R3]\n"" CMP R3, #0\n"" MOVNE R0,#1\n //fake return value of skipped sub_FF02D9F0 call" BNE loc_B\n" // skip flushing the cache
You need to ensure that a known OK value is set when ignore_current_write is used, something likeCode: [Select]" LDR R3, =ignore_current_write\n" // mod start" LDR R3, [R3]\n"" CMP R3, #0\n"" MOVNE R0,#1\n //fake return value of skipped sub_FF02D9F0 call" BNE loc_B\n" // skip flushing the cacheBut it's unknown whether just setting the value to 1 is OK or not.The code that uses the value only checks whether it's equal to 1 or not. Maybe either case is OK, but we should use specific value.
Started by gvandyk CHDK Releases
Started by Jez General Help and Assistance on using CHDK stable releases
Started by ProfHankD « 1 2 » Feature Requests
Started by eaglesong General Chat
Started by duenyas General Discussion and Assistance