CHDK corrupted after starting camera with clock - page 2 - General Help and Assistance on using CHDK stable releases - CHDK Forum
supplierdeeply

CHDK corrupted after starting camera with clock

  • 21 Replies
  • 9796 Views
*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: CHDK corrupted after starting camera with clock
« Reply #10 on: 17 / June / 2013, 05:33:47 »
Advertisements
On the G12 (1.00c) the crash happens in this code:
Code: [Select]
ROM:FF874DAC                 LDR     R4, =0x2BBC
ROM:FF874DB0                 LDR     R0, [R4,#8]
ROM:FF874DB4                 CMP     R0, #0
ROM:FF874DB8                 MOVEQ   R1, #139
ROM:FF874DBC                 ADREQ   R0, aFilesem_c  ; "FileSem.c"
ROM:FF874DC0                 BLEQ    DebugAssert

So the value at 0x2BBC + 8 is a flag that the file system has been initialised.

The previous function to this one in the firmware sets the flag to 1.

I've added detection of this address to finsig_dryos.c along with a change to camera.h & main.c to enable checking this value instead of 'spytask_can_start'. Will post the update to the trunk version soon.

On my cameras this avoids the crash problem and stops the CHDK spytask from continuing until the clock display is closed.

This has an added advantage for cameras that don't need partitioning - the init_file_modules_task hook can be removed since it doesn't need to set 'spytask_can_start'.

The same thing works for VxWorks cams; but the address has to be found manually.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK corrupted after starting camera with clock
« Reply #11 on: 17 / June / 2013, 16:04:47 »
@MotCan10

If you're still interested, please try this test build, and report whether it works correctly. CHDK should no longer show up (and crash the camera) when you start it in that clock mode.

http://www.sendspace.com/file/wt2dvz

(This is a CHDK 1.2 "development" build, you'll have to extract all files and directories to the card.) Sendspace is supposedly pretty nasty - unless you're blocking ads and most scripts on that site...

Re: CHDK corrupted after starting camera with clock
« Reply #12 on: 17 / June / 2013, 19:41:51 »
@MotCan10

If you're still interested, please try this test build, and report whether it works correctly. CHDK should no longer show up (and crash the camera) when you start it in that clock mode.

http://www.sendspace.com/file/wt2dvz

(This is a CHDK 1.2 "development" build, you'll have to extract all files and directories to the card.) Sendspace is supposedly pretty nasty - unless you're blocking ads and most scripts on that site...

Am using Mozilla Firefox with NoScript, so the site was benign.  Yes, I am certainly interested, will give the build a try, and provide a report soon.  I've been watching the "tech talk", and while I don't know much about the CHDK infrastructure, the few lines of ARM ASM code were easy enough to follow :D.

Re: CHDK corrupted after starting camera with clock
« Reply #13 on: 17 / June / 2013, 20:14:55 »
With the test build on the boot partition of an 8GB SDHC card, I couldn't cause the camera to crash when starting the camera in clock mode.  So far so good.

However, when trying to fully upgrade to the new version (on both partitions of the dual-partition SDHC card), it appears that the "PS.FI2" file is missing from the build, so the "Firmware Update" item doesn't appear in the Canon menus.  Perhaps I should simply wait and download the autobuild tomorrow?  "PS.FI2" from CHDK 1.1.0 seems much different than the PS.FI2 in the current "test" version of CHDK

P.S. You might want to look into Ubuntu One (https://one.ubuntu.com/) for file sharing.  It doesn't have nefarious stuff on it, and "download links" point to a direct download.
« Last Edit: 17 / June / 2013, 20:53:46 by MotCan10 »


Re: CHDK corrupted after starting camera with clock
« Reply #14 on: 18 / June / 2013, 16:32:36 »
OK, got things sorted out.  The "PS.FI2" from CHDK 1.1.0 seems to start CHDK 1.1.0, but after getting the partitions corrected with 1.1.0, then CHDK 1.2.0 boots.  With everything sorted out (I hope!), there is no crash when starting the camera in clock mode (or any mode, AFAIK.)  Thanks...and I really like the layout improvements of the development build!

By the way (did I read about this in the posts above?), when CHDK is enabled, there is a delay of approximately 3 seconds after exiting the clock.  The card access light blinks constantly until CHDK starts.

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK corrupted after starting camera with clock
« Reply #15 on: 18 / June / 2013, 16:57:59 »
To other devs who are reading this: I have only added the new
Code: [Select]
#define CAM_WAIT_FOR_FILESYSTEM         1define to platform_camera.h. If this build is working correctly, then this change can go into trunk, I guess.

@MotCan10
CHDK 1.1 and 1.2 are not compatible and can't really coexist on one card due to the different kind of modules they're using. PS.FI2 is only needed if you only want to start CHDK with the "Firm update" menu item. It's not needed for the "SD card lock" start method. It's missing from my test build because of a forum convention.
I have no idea about the blinking LED, this change should not be its cause.

*

Offline reyalp

  • ******
  • 14080
Re: CHDK corrupted after starting camera with clock
« Reply #16 on: 18 / June / 2013, 17:14:18 »
By the way (did I read about this in the posts above?), when CHDK is enabled, there is a delay of approximately 3 seconds after exiting the clock.  The card access light blinks constantly until CHDK starts.
If there are images on the card, the light may blink for a while as the camera indexes (?) them. The change to fix the clock may have also affected when CHDK loads in relation to this.
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: CHDK corrupted after starting camera with clock
« Reply #17 on: 18 / June / 2013, 18:32:39 »
To other devs who are reading this: I have only added the new
Code: [Select]
#define CAM_WAIT_FOR_FILESYSTEM         1define to platform_camera.h. If this build is working correctly, then this change can go into trunk, I guess.

@MotCan10
CHDK 1.1 and 1.2 are not compatible and can't really coexist on one card due to the different kind of modules they're using. PS.FI2 is only needed if you only want to start CHDK with the "Firm update" menu item. It's not needed for the "SD card lock" start method. It's missing from my test build because of a forum convention.
I have no idea about the blinking LED, this change should not be its cause.

I just realised the current CAM_WAIT_FILESYSTEM fix will break for partitioned cards - these still need to also wait for 'spytask_can_start' (to give the init_file_modules_task time to switch partitions).

Will post a patch soon.

Not sure why CAM_WAIT_FILESYSTEM would cause a startup delay - will do more testing on my cameras in case.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)


Re: CHDK corrupted after starting camera with clock
« Reply #18 on: 18 / June / 2013, 19:11:37 »
@MotCan10
CHDK 1.1 and 1.2 are not compatible and can't really coexist on one card due to the different kind of modules they're using. PS.FI2 is only needed if you only want to start CHDK with the "Firm update" menu item. It's not needed for the "SD card lock" start method. It's missing from my test build because of a forum convention.
I have no idea about the blinking LED, this change should not be its cause.

Yes, I figured that out pretty quickly!  Actually, as I've mentioned before, I have to use a dual-partition setup with CHDK on both partitions.  The small "boot" partition was easy to update, but to update the other partition, the partitions had to be swapped with CHDK.  The problem is that it takes CHDK to swap the partitions back so the camera will auto-start CHDK with a locked card.  And as you noted, with PS.FI2 missing, there's no Firmware Update to re-start CHDK and swap the partitions.  The 1.1.0 release FI2 worked fine to get CHDK started, although it loaded CHDK 1.1.0 (with the 1.2.0 DISKBOOT.BIN on both partitions).  After restarting the camera, CHDK 1.2.0 loaded, and the clock-startup tests passed.

If there are images on the card, the light may blink for a while as the camera indexes (?) them. The change to fix the clock may have also affected when CHDK loads in relation to this.

Yes, that's expected, but if the card is unlocked (=CHDK disabled), the delay is typically less than second with no media on the card.  With the card locked (CHDK enabled), the delay is ~3 seconds with no media on the card.  It isn't crashing, though :).

Re: CHDK corrupted after starting camera with clock
« Reply #19 on: 18 / June / 2013, 20:57:18 »
The problem is that it takes CHDK to swap the partitions back so the camera will auto-start CHDK with a locked card. 
You can also use the SDMinste.exe program to swap partitions on your PC.
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics