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

rebooting/loading CHDK binaries from lua or canon basic

  • 60 Replies
  • 30750 Views
*

Offline whoever

  • ****
  • 280
  • IXUS950
Re: rebooting/loading CHDK binaries from lua or canon basic
« Reply #40 on: 21 / September / 2010, 07:27:51 »
Advertisements
the WdtReset task that sleeps 2s in a loop, then resets the timer
So, how does that allow us to keep the USB remote switch pressed for up to ten seconds, pausing the capture task ?
If you know it's the watchdog that intervenes, then just feed it (some would say kick it) every now and then, say once every 100 ms, by writing AA55 to its feed register. I didn't check if it's done the same way in other, in particular recent cameras, so one needs to examine their WdtReset code. Which one has to do anyway, to find the feed register.

I suppose one can also find and read the timer value register (didn't try though), and periodically do something like "if value<threshold then reset".

*

Offline reyalp

  • ******
  • 14128
Re: rebooting/loading CHDK binaries from lua or canon basic
« Reply #41 on: 21 / September / 2010, 12:46:16 »
@reyalp
How did you work-out the CBasic syntax (as used in your loader for example) ?
With difficulty ;) Basically, trail, error, guessing based on what other basic flavors do.

If you mean for the watchdog functions, I noticed that the firmware update code stopped the watchdog before booting the fi2 file, and saw a watchdog message in the romlog when my diskboot took a long time too boot (after I turned the caches off, my LED blinking code went much slower...)
Don't forget what the H stands for.

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: rebooting/loading CHDK binaries from lua or canon basic
« Reply #42 on: 21 / September / 2010, 14:55:02 »
Someone with a G9 was testing some code that execute a fixed number of exposures with a timelapse script and then reset the camera every minute.

It worked for three hours and then stopped in ALT mode without running the script.

Sometimes it would stop far sooner.

Never could find the reason for that so I just forced another restart under such conditions.

Was the camera always rebooted after switching to play mode?

Re: rebooting/loading CHDK binaries from lua or canon basic
« Reply #43 on: 21 / September / 2010, 18:29:17 »

Was the camera always rebooted after switching to play mode?

Yes, after a delay of two seconds.

*

Offline hwntw

  • ***
  • 162
Re: rebooting/loading CHDK binaries from lua or canon basic
« Reply #44 on: 28 / September / 2010, 11:33:55 »
Hello,
Reboot.bas script works on Ixus 95 in both record & play modes (Canon firmware only, tested).
How does the Canon Basic version work? Or is this stuff over my head (answer: yes)?

Colin
Ixus 95 IS Ixus 30 izoom Powershot S80 S100 S200


Windows 10

Re: rebooting/loading CHDK binaries from lua or canon basic
« Reply #45 on: 23 / October / 2010, 12:17:53 »
If you know it's the watchdog that intervenes, then just feed it (some would say kick it) every now and then, say once every 100 ms, by writing AA55 to its feed register.

Just a quick report regarding my A620.

I have just delayed switch release for 20 minutes and it works fine.



Incidentally, I used :-

 volatile short *p = 0xC0410004;
 p[0]=0xAA55;


For other functions, how would I know if short, int or long was the required storage type ?

« Last Edit: 23 / October / 2010, 13:20:58 by Microfunguy »

*

Offline whoever

  • ****
  • 280
  • IXUS950
Re: rebooting/loading CHDK binaries from lua or canon basic
« Reply #46 on: 23 / October / 2010, 13:34:40 »
I have just delayed switch release for 20 minutes and it works fine.
Incidentally, I used :-
 volatile short *p = 0xC0410004;
 p[0]=0xAA55;
For other functions, how would I know if short, int or long was the required storage type ?
In the context of ARM code, int = long = 32 bits, short = 16 bits. Now notice that feeding the dog should be done in a single processor instruction, such as "STR Rx [Ry]", which is a 32-bit operation. If the dog is misfed, it will probably trigger immediately. In that sense, *(short*)p=0xAA55 looks somewhat suspicious. I'd suggest to examine, if possible, the generated ARM code. To be completely sure, use inline asm.

Re: rebooting/loading CHDK binaries from lua or canon basic
« Reply #47 on: 24 / October / 2010, 05:36:18 »
To be completely sure, use inline asm.


I have done that, works fine.

*

Offline hwntw

  • ***
  • 162
Re: rebooting/loading CHDK binaries from lua or canon basic
« Reply #48 on: 15 / May / 2011, 18:19:30 »
Hello,
How do I boot SDM from within CHDK, using a script?
I have read this thread and the WIki on the subject, but so far I can only do a reboot of CHDK.
What should the file name be and what arguments does the script need?

Best,

Colin
Ixus 95 IS Ixus 30 izoom Powershot S80 S100 S200


Windows 10

*

Offline reyalp

  • ******
  • 14128
Re: rebooting/loading CHDK binaries from lua or canon basic
« Reply #49 on: 15 / May / 2011, 18:59:30 »
Hello,
How do I boot SDM from within CHDK, using a script?
I have read this thread and the WIki on the subject, but so far I can only do a reboot of CHDK.
What should the file name be and what arguments does the script need?
SDM doesn't appear to include PS.FI2 files, which makes this more difficult for dryos cameras.

If you build an FI2 file, you can just put it on your SD card, named something like SDM.FI2, and then call reboot("A/SDM.FI2")

Without an FI2 file, you must have an *unencoded* diskboot. This means you can't use the DISKBOOT.BIN from dryos cameras. Instead, you must build sdm, and save loader/<camera>/main.bin*  onto your SD card. Then use
reboot("A/MAIN.BIN")
You can rename it to anything you like, as long as the extension doesn't start with .FI

For cameras that don't use an encoded diskboot (vxworks) you can just use diskboot.bin instead of main.bin.

* I'm assuming the SDM build process creates this like CHDK, haven't checked.

edit:
It occurs to me that the Canon "firm update" menu may get confused if there are multiple .FI2 files in the root directory. If this is a problem, you can probably avoid it by calling the file *.FIX or putting it in a sub directory.
« Last Edit: 15 / May / 2011, 19:08:35 by reyalp »
Don't forget what the H stands for.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal