rebooting/loading CHDK binaries from lua or canon basic - page 2 - General Discussion and Assistance - CHDK Forum

rebooting/loading CHDK binaries from lua or canon basic

  • 60 Replies
  • 30165 Views
*

Offline reyalp

  • ******
  • 14125
Re: rebooting/loading CHDK binaries from lua or canon basic
« Reply #10 on: 13 / September / 2010, 12:28:57 »
Advertisements
Looks like the right address for restart.

Try calling FFD107E4 (DispCon_TurnOffDisplay) first. No parameters.

Well, I see the funny LCD fading but on reboot, after displaying splash screen, the camera hangs.
Not surprising if the hardware is in a confused state.
Don't forget what the H stands for.

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: rebooting/loading CHDK binaries from lua or canon basic
« Reply #11 on: 13 / September / 2010, 15:03:11 »
When I posted that earlier I just called it without arguments, I suppose r0 was either 0 or whatever it is by luck previously -- I didn't test it very much. Now that I've tried it a few times more, I experienced both post-reboot LCD stuff and failed reboots too. TurnOffDisplay appears to help. So, this lua script seems to work for a570 (for 100e and 101a both; it's so early in the fw that there's no offset between the two):

Code: [Select]
--[[
@description a570 reboot
--]]
call_event_proc("DispDev_EnableEventProc")
call_event_proc("DispCon_TurnOffDisplay")
sleep(1000)
call_func_ptr(0xffc0b748,0)

Apparently Canon fw saves many of the user settings at power-off, and that never gets done when rebooting this way. I didn't do extensive tests but my changes to WB mode and the digital telephoto feature setting were gone. I suppose all similar settings are forgotten (they revert back to the values prior to previous power-on).

*

Offline reyalp

  • ******
  • 14125
Re: rebooting/loading CHDK binaries from lua or canon basic
« Reply #12 on: 13 / September / 2010, 15:10:05 »
When I posted that earlier I just called it without arguments, I suppose r0 was either 0 or whatever it is by luck previously
Since 7 is the only value that doesn't reboot, the chances of hitting the reboot case with random values in R0 are quite good :)
Quote
Apparently Canon fw saves many of the user settings at power-off, and that never gets done when rebooting this way. I didn't do extensive tests but my changes to WB mode and the digital telephoto feature setting were gone. I suppose all similar settings are forgotten (they revert back to the values prior to previous power-on).
Yes ;)
Quote from: reyalp
It's important to remember that this does NOT do the normal camera shutdown sequence. This means
- hardware may not be in the state expected on restart. This could cause abnormal behavior or maybe even damage.
- recently changed camera settings might not be saved to flash (taskBye does some write to rom stuff)
- filesystem stuff may not synced to SD. However, you generally don't lose much in abnormal shutdowns (assert, exception etc) that aren't in the middle of actually writing something, so this should be OK, especially if you switch to play mode before doing the reboot. Switching to play recommended anyway, since I'd expect more of the hardware to be in an off or idle state.

For CHDK, it might be better to copy taskBye and replace the last bit with the load and restart code. Or hook it, and check a global to decide if a reboot or actual shutdown is requested.
Don't forget what the H stands for.

Re: rebooting/loading CHDK binaries from lua or canon basic
« Reply #13 on: 13 / September / 2010, 16:16:22 »
Try calling FFD107E4 (DispCon_TurnOffDisplay) first. No parameters.

I did and added a msleep(1000) after it.

Screen turned off, lens retracted, lens extended, Canon splash screen, camera hung.

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: rebooting/loading CHDK binaries from lua or canon basic
« Reply #14 on: 13 / September / 2010, 16:35:25 »
Screen turned off, lens retracted, lens extended, Canon splash screen, camera hung.

Disable Canon splash screen...I tried to enable it (never had it on before) and rec mode restarting got problematic again (LCD weirdness and lockups during lens drive at reboot)

*

Offline reyalp

  • ******
  • 14125
Re: rebooting/loading CHDK binaries from lua or canon basic
« Reply #15 on: 13 / September / 2010, 16:46:46 »
Try calling FFD107E4 (DispCon_TurnOffDisplay) first. No parameters.

I did and added a msleep(1000) after it.

Screen turned off, lens retracted, lens extended, Canon splash screen, camera hung.
Have you tried in play mode ? Or does the lens always extend on this camera ?
Don't forget what the H stands for.

Re: rebooting/loading CHDK binaries from lua or canon basic
« Reply #16 on: 13 / September / 2010, 17:00:31 »
Disabling the Canon splash screen made no difference in Record mode.

In Playback, running the script does restart the camera.
This works with or without the splash-screen enabled.
The lens does not extend , which is the normal behaviour in Playback mode.

So, how do we get it to restart in Record mode ?


*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: rebooting/loading CHDK binaries from lua or canon basic
« Reply #17 on: 13 / September / 2010, 17:28:01 »
So, how do we get it to restart in Record mode ?

Switch to play before calling restart? The camera will restart in rec if the rec/lever lever position is rec, won't it?

*

Offline reyalp

  • ******
  • 14125
Re: rebooting/loading CHDK binaries from lua or canon basic
« Reply #18 on: 13 / September / 2010, 17:28:43 »
So, how do we get it to restart in Record mode ?
Since this camera has a physical switch, you should be able to override to play mode, and when you reboot the over ride will still be in the rec position and the camera will go back to rec mode.

On cameras without a physical switch, you'd have to store a flag somewhere (a file on the SD card ? Conf option ? Data TCM like the 123456789 flag ?)

If this is being used in an auto start script (most likely case), just override to rec on startup if needed.

All assuming you have play/rec override.
Don't forget what the H stands for.

Re: rebooting/loading CHDK binaries from lua or canon basic
« Reply #19 on: 13 / September / 2010, 18:43:33 »
All assuming you have play/rec override.


Good suggestion !

It was very easy, this script works  :-

@title Reset test
line_1 "#Started"
sleep_for_seconds 2
beep
playback_mode
sleep_for_seconds 2
reset
end


(I guess the 'end' is not needed)

For the A620, playback_mode uses physical switch override.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal