Multipartition + Saved settings / other file access on startup? - General Help and Assistance on using CHDK stable releases - CHDK Forum

Multipartition + Saved settings / other file access on startup?

  • 6 Replies
  • 4038 Views
Multipartition + Saved settings / other file access on startup?
« on: 01 / September / 2009, 21:16:32 »
Advertisements
I'm having some problems with an 8GB SD card on A650IS. I'm using multipartition to boot CHDK from a small boot partition, with the rest of the card used as storage, and it refuses to remember any settings. I suspect that the settings file may be read before the point where multipartition is fully set up, and fails for this reason.

When CHDK starts up, the free space indicator is also at 0MB for a while, and then indicates the free space on the second partition. I've tried building from subversion and changing the delay in core/main.c, but this only seems to result in a shorter delay before the second partition becomes visible after CHDK startup, and does not affect the problem with loading settings. I also tried editing the default config to have things set up the way that I want, but this isn't great if what I want changes with use, and it also doesn't seem to work for the DNG RAW setting, since that's disabled if it can't read badpixels.bin. Turning this on manually later works fine, another reason that I suspect the problem is *when* the files are being accessed.

I couldn't find anything really helpful about problems with saved settings, except for a mention of changing the delay in core/main.c, and nothing that mentions multipartition specifically. Am I on the right track as to the cause? If so, would it be hard to make sure that multipartition setup is done before anything tries to use the filesystem? I am somewhat familiar with the sort of development environment CHDK uses, as I develop for Rockbox, and primarily work on ARM targets, but I don't know CHDK's codebase at all.
« Last Edit: 01 / September / 2009, 22:41:31 by MilitantlyUnhelpful »

*

Offline reyalp

  • ******
  • 14079
Re: Multipartition + Saved settings / other file access on st a whileartup?
« Reply #1 on: 01 / September / 2009, 22:46:05 »
If anything you'd want a longer delay.

The order thing are supposed to happen is
in boot.c
task_Startup_my starts spytask. Spytask waits for either 4 seconds or until spytask_can_start is true.
while the above is happening, sub_FFC60B38_my should start =task_InitFileModules_my, which sets up large partition support and then sets spytask_can_start
spytask turns on the blue LED, sleeps 50ms, turns the LED off, and then loads the cfg.

I can't vouch for all the inline ASM in boot.c being correct. If you look at newer dryos cams (e.g. SX10) you can see that we've since found a way of task hooking that avoids much of this. I'm pretty sure most of the dryos cams do not suffer from the problem you describe, I though I don't have one at the moment, so I can't verify.

I also noticed A650 doesn't have CAM_MULTIPART in camera.h but this shouldn't be the cause of your problem. See http://chdk.setepontos.com/index.php/topic,2798.msg31398.html#msg31398
Don't forget what the H stands for.

Re: Multipartition + Saved settings / other file access on startup?
« Reply #2 on: 03 / September / 2009, 00:29:16 »
Apparently I never made the delay *quite* long enough. This time it worked! I never even knew that the wiki/forum logo was also a boot logo. I now have the delay set at 20s though, which seems rather extreme, It certainly looks like sub_FFC3F960_my, which parses the partition table, is called before the spytask_can_start flag is set, but perhaps some results of this have not taken effect when the flag is set? Data is stored in various locations, so I really don't know if some other process needs to do something before it's "safe" to access the filesystem.

*

Offline reyalp

  • ******
  • 14079
Re: Multipartition + Saved settings / other file access on startup?
« Reply #3 on: 03 / September / 2009, 02:00:44 »
It certainly shouldn't take 20 seconds. Very strange.
Don't forget what the H stands for.


Re: Multipartition + Saved settings / other file access on startup?
« Reply #4 on: 03 / September / 2009, 07:59:37 »
I've not tried anything between 10 and 20 yet. I'll get to that eventually, but something is taking a *very* long time to settle, it appears.

Re: Multipartition + Saved settings / other file access on startup?
« Reply #5 on: 04 / September / 2009, 17:46:10 »
It fails reliably at 10s. Somewhere around 10.6s it starts working sometimes, and it seems to work pretty reliably at 11s. If we have a debug print buffer or something maybe I could dump some things to it and see what exactly the interaction between various processes is. I'd guess that the filesystem just needs a bit of time to "settle" once the partition table is read and the second partition set up as the primary storage.

Re: Multipartition + Saved settings / other file access on startup?
« Reply #6 on: 24 / May / 2010, 10:14:11 »
I have an interesting result now that boot via "firmware update" is supported - the same thing happens, it can't read any files on CHDK startup and my config/badpixels are not loaded, the splash logo does not display, etc. Should it really take 11-12s for the disk to be ready? Is there some other fix besides increasing the delay?

 

Related Topics