shooting script using Canon basic ? - page 6 - General Discussion and Assistance - CHDK Forum supplierdeeply

shooting script using Canon basic ?

  • 55 Replies
  • 31685 Views
*

Offline srsa_4c

  • ******
  • 4426
Re: shooting script using Canon basic ?
« Reply #50 on: 15 / March / 2019, 15:19:03 »
Advertisements
I played something with the script today. It seems a timing problem. On the one hand I used a newer, faster SD card and put the camera on MF.
On the first run (only RAW), the camera took only three pictures :)
On the second and third runs the cam took 7 Pictures.
If I set the camera to only JPG, then the cam always make the 4 pictures (the first picture twice).
Have you tried only RAW?
I only made some test runs, nothing comprehensive.
It makes no sense trying the - obviously malfunctioning - script over and over again. It clearly needs to be changed or rewritten.

Quote
But basically, I still have problems starting scripts (like the firmware dump). I have the problem synonymous with the new SD card. Sometimes I have to start the camera 10 times. Is there a specific timing at power on?
I recall having problems starting scripts from time to time on various cameras. But unfortunately, I don't know what's behind that.

Quote
If there are threading problems like that maybe we can try to move some of the script's functionality to native code...
What does that mean?
The script relies on Canon Basic global variables that are written and read in different tasks. I have a feeling that this isn't working well enough, especially not on multiprocessor cameras.

The script has a main loop (mytask()) that runs in its own task.
The mycontroller() function is called from the firmware's CtrlSrv task, it is used for intercepting the keyboard.
The functions shoot_pre(), shoot_beforeexpo(), shoot_complete() are called from the firmware's shooting related tasks.

As a first try, global variables used in more than one task could be turned into pointers and they could point to a piece of memory that has no caching issues (uncached memory, for example).

If that's not enough, the functions listed above (those that run in firmware tasks) could be replaced with ARM code. But doing this is not trivial (loading code at runtime and making sure there are no caching and similar issues).

*

Offline reyalp

  • ******
  • 13353
Re: shooting script using Canon basic ?
« Reply #51 on: 15 / March / 2019, 16:01:15 »
As a first try, global variables used in more than one task could be turned into pointers and they could point to a piece of memory that has no caching issues (uncached memory, for example).
If this is the problem, the various semaphore etc functions are generally available as eventprocs. OTOH, if the script engine itself isn't thread safe that wouldn't help.
Don't forget what the H stands for.

*

Offline c_joerg

  • *****
  • 1128
Re: shooting script using Canon basic ?
« Reply #52 on: 29 / December / 2020, 12:48:17 »
I tried to start a script with a 64GB with FAT32. At first I thought it wouldn't work. It took me 6 tries to get it to work. With my old 1GB card I always needed significantly less attempts.
I guess that's a timing problem. The card will probably take longer to initialize.
M100 100a, M3 101a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

*

Offline c_joerg

  • *****
  • 1128
Re: shooting script using Canon basic ?
« Reply #53 on: 03 / September / 2021, 08:23:28 »
Can there be a problem if in addition to "SCIPT" there is also "BOOTDISK" on the SD card?
M100 100a, M3 101a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd


*

Offline srsa_4c

  • ******
  • 4426
Re: shooting script using Canon basic ?
« Reply #54 on: 03 / September / 2021, 15:10:04 »
Can there be a problem if in addition to "SCIPT" there is also "BOOTDISK" on the SD card?
The SCRIPT and BOOTDISK flags can coexist without a problem.
However, if you use CHDK on a card with an active Canon Basic script, you can get in trouble. If you forget about the script, you might find yourself wondering when you inadvertently start it with SET. Or, if the CHDK port is configured to use ARAM, the camera will crash when you press SET.
In short: make sure you don't use a Canon Basic script and CHDK at the same time.

*

Offline c_joerg

  • *****
  • 1128
Re: shooting script using Canon basic ?
« Reply #55 on: 03 / September / 2021, 15:44:28 »
In short: make sure you don't use a Canon Basic script and CHDK at the same time.

I don't do that either. I only saw that I have "SCRIPT" and "BOOTDISK" on some cards because I used them differently.
I'm still looking why the scripts don't always start for me ...
M100 100a, M3 101a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

 

Related Topics