Fandom

CHDK Wiki

Canon Basic/Scripts/Romlog

< Canon Basic

598pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Portable romlog scriptEdit

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 pixeldocEdit

  • script does save (last) Error in Camera ROM log to romlog.txt.
  • sucessfully tested on:
SD4000IS (pixeldoc), SD1400IS / IXUS 130 (emlyn), SD940, D10 (reyalp) SD4500 /Ixus1000HS(Bernd R), A2100IS (ac.n1bs)
  • 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

Also on Fandom

Random Wiki