(portable romlog script) |
|||
(8 intermediate revisions by 6 users not shown) | |||
Line 3: | Line 3: | ||
Save canon crash log (ROMLOG) to A/ROMLOG.TXT |
Save canon crash log (ROMLOG) to A/ROMLOG.TXT |
||
Compatible with vxworks and dryos. Some cameras may dump the log in a binary format, see http://chdk.setepontos.com/index.php/topic,5394.0.html |
Compatible with vxworks and dryos. Some cameras may dump the log in a binary format, see http://chdk.setepontos.com/index.php/topic,5394.0.html |
||
+ | |||
+ | If CHDK already runs on your camera, you can also use [[Lua/Scripts:Standard/Test/Romlog]] |
||
* sucessfully tested on: |
* sucessfully tested on: |
||
− | :: ''[[A540]] [[D10]] (reyalp) '' |
+ | :: ''[[A540]] [[D10]] (reyalp), [[SD1400IS|SD1400IS / IXUS 130]] (emlyn), [[A3000IS]] (ERR99)'' |
<source lang="thinbasic"> |
<source lang="thinbasic"> |
||
' get the camera log to file |
' get the camera log to file |
||
Line 65: | Line 67: | ||
* script does save (last) Error in Camera ROM log to romlog.txt. |
* script does save (last) Error in Camera ROM log to romlog.txt. |
||
* sucessfully tested on: |
* sucessfully tested on: |
||
− | :: ''[[SD4000IS]] (pixeldoc), [[SD1400IS|SD1400IS / IXUS 130]] (emlyn), [[SD940]], [[D10]] (reyalp) '' |
+ | :: ''[[SD4000IS]] (pixeldoc), [[SD1400IS|SD1400IS / IXUS 130]] (emlyn), [[SD940]], [[D10]] (reyalp) [[SD4500]] /Ixus1000HS(Bernd R), [[A2100IS]] (ac.n1bs)'' |
* failed on |
* failed on |
||
:: ''[[A540]]'' (reyalp) |
:: ''[[A540]]'' (reyalp) |
||
Line 81: | Line 83: | ||
end sub |
end sub |
||
</source> |
</source> |
||
+ | [[Category:CanonBasic]] |
||
+ | [[Category:Scripts]] |
||
+ | [[Category:Development]] |
||
+ | [[Category:DEBUG]] |
Latest revision as of 20:31, 22 January 2012
Portable romlog script
Save canon crash log (ROMLOG) to A/ROMLOG.TXT Compatible with vxworks and dryos. Some cameras may dump the log in a binary format, see http://chdk.setepontos.com/index.php/topic,5394.0.html
If CHDK already runs on your camera, you can also use Lua/Scripts:Standard/Test/Romlog
- sucessfully tested on:
- A540 D10 (reyalp), SD1400IS / IXUS 130 (emlyn), A3000IS (ERR99)
' get the camera log to file
' logs status to GETLOG.LOG
' on older (mostly vxworks) cameras, the log may be in a binary format
DIM lcdmsg=0
DIM msgstr=0
PRIVATE SUB RegisterProcs()
' Newest cams (Dryos rel 43 and later) only have System.Create()
' on older dryos cams SystemEventInit is an alias for System.Create()
' ExecuteEventProcedure does is not registered by default on vx,
' but calling an unregistered is not fatal
if System.Create() = -1 then
SystemEventInit()
end if
if ExecuteEventProcedure("UI_RegistDebugEventProc") = -1 then
ExecuteEventProcedure("UI.CreatePublic")
end if
END SUB
PRIVATE SUB InitMsg()
lcdmsg = ExecuteEventProcedure("LCDMsg_Create")
' not default black
if lcdmsg >= 0 then
LCDMsg_ChangeColor(lcdmsg,2)
LCDMsg_SetStr(lcdmsg,"started")
end if
msgstr = AllocateMemory(80)
' truncate log
msgfile = Fopen_Fut("A/GETLOG.LOG","w")
if msgfile <> 0 then
Fclose_Fut(msgfile)
end if
END SUB
PRIVATE SUB PutMsg(msg)
if lcdmsg >= 0 then
LCDMsg_SetStr(lcdmsg,msg)
end if
msgfile = Fopen_Fut("A/GETLOG.LOG","a")
if msgfile <> 0 then
Fwrite_Fut(msg,strlen(msg),1,msgfile)
Fwrite_Fut("\n",1,1,msgfile)
Fclose_Fut(msgfile)
end if
END SUB
PRIVATE SUB Initialize()
RegisterProcs()
InitMsg()
PutMsg("Getting log")
GetLogToFile("A/ROMLOG.TXT",1)
PutMsg("done")
END SUB
Original romlog script by pixeldoc
- script does save (last) Error in Camera ROM log to romlog.txt.
- sucessfully tested on:
- failed on
- A540 (reyalp)
Probably Dryos only.
private sub Initialize()
UI.CreatePublic()
a=LCDMsg_Create()
LCDMsg_SetStr(a,"Get ROM Log to file")
System.Create()
GetLogToFile("A/romlog.txt",1)
LCDMsg_SetStr(a,"done")
end sub