s80 anybody? - page 10 - General Discussion and Assistance - CHDK Forum
supplierdeeply

s80 anybody?

  • 205 Replies
  • 95260 Views
Re: s80 anybody?
« Reply #90 on: 02 / November / 2009, 22:30:29 »
Advertisements
I could be wrong, but could it be that the camera is reading certain status information (including SD card lock) from another address? I did a simple test where I simply set
physw_status[1] = 0x7f7f7f7f;
in my_kbd_read_keys() function. It does the right thing: so the camera does not respond to any key I press. But with physw_status[2], even if I do
physw_status[2] = 0xf;
it still reports card lock. In addition, I noticed that when I open or close the camera, physw_status[2] has certain bits that change correspondingly. But forcing physw_status[2] to a certain value does not seem to affect the way the camera works. So I am wondering if the camera may be looking at some other address.

Note that s80 has a lens cover that you slide open to turn on the camera. This may be different from a lot of other cameras. I think this may be unique among all the cameras currently supported by CHDK.

Re: s80 anybody?
« Reply #91 on: 02 / November / 2009, 22:46:00 »
Apparently some bits in physw_status[2] do matter: for example, the last bit indicates whether the battery door is open. If I force it to be zero, the camera will turn on and then turn off immediately.

Re: s80 anybody?
« Reply #92 on: 02 / November / 2009, 23:23:37 »
Also found: the fourth bit (from the right) of physw_status[2] apparently controls switching between playback and capture mode. So leaving it to 1 keeps the camera in capture mode, while clearing it to zero simulates a press on the playback button.

Re: s80 anybody?
« Reply #93 on: 02 / November / 2009, 23:58:28 »
Ok, this is really frustrating. I manually set physw_status[2] to 0x820059 so that the camera will function like normal except when I open the battery door and take out the SD card, it will continue to be on. Now, I take out the SD card, flip the write protection, and insert it back in, it doesn't make any different, still reports card locked!! This is physically turning off write protection! Two things I can think of: 1) maybe the sd readonly status is read and stored somewhere else right in the beginning, so that the flag stored in physw_status[2] is simply ignored (after all, when do you expect the write protection to change while the camera is on?)  2) it is somehow correlated with the fact that the firmware update method does not work. This is really driving me nuts...


*

Offline reyalp

  • ******
  • 14082
Re: s80 anybody?
« Reply #94 on: 03 / November / 2009, 00:02:00 »
Just to be sure, if you boot without CHDK, your camera doesn't show card locked ? The switches have been known to get stuck.

As I suggested before, you can look in the diskboot loading code to find out how the canon firmware determines if the card is locked or not.

edit: I would guess that sub_FFADDE64 does this.
« Last Edit: 03 / November / 2009, 00:17:04 by reyalp »
Don't forget what the H stands for.

Re: s80 anybody?
« Reply #95 on: 03 / November / 2009, 00:50:34 »
Yup, if I don't load CHDK I can take pictures beautifully. I checked this earlier to make sure I am not crazy.

I will look into sub_FFADDE64 tomorrow. Thanks for the advice.

Re: s80 anybody?
« Reply #96 on: 03 / November / 2009, 17:46:10 »
Ah, thank god, I finally got the diskboot working and the camera no longer reports "card locked". The reason turns out to be that... I did not enable the init_file_modules_hook. Is that kidding? After all the trouble I went through... I actually think I did enable that hook in the beginning but it crashed. Perhaps during the searching for a solution of the card lock problem, I fixed some issue that was causing init_file_modules_hook to crash.

Firmware update still doesn't work. But I accidentally found that it does run at least to mykbd_task_proceed (I had some LED blinking code there in the loop and I found the LED did blink a few times before the camera crashes). This is contradictory to my earlier belief that the execution didn't even pass the boot() function.

Now that the diskboot works, I can finally continue where I left off...

Re: s80 anybody?
« Reply #97 on: 03 / November / 2009, 18:13:17 »
Verified that I can successfully write RAW files.


Re: s80 anybody?
« Reply #98 on: 03 / November / 2009, 19:59:51 »
Edge overlay is working. Found the following two addresses:
void *vid_get_viewport_fb()      
{
    return (void*) 0x105F2C4C;
}

void *vid_get_viewport_fb_d()
{
    return (void*)(*(int*)0x72FDC);
}

Re: s80 anybody?
« Reply #99 on: 04 / November / 2009, 19:54:10 »
After fixing some more problems, I am ready to release the current version for testing. I've attached here the DISKBOOT.BIN file.

Current status:
The basic functions work, such as saving raw files, edge overlay, histogram, zebra, running scripts etc. Before I started, I upgraded my firmware to 1.00g. If you have firmware 1.00f, it may still work but I haven't tested.

- firmware update does not work; must use bootable disk method
- Movie shooting does not work (movie_rec.c is implemented, but the camera crashes after a few seconds of turning to movie mode. Haven't found the reason)
- shooting.c is copied from a620, which seems to work, but need testing.
- A few items in stubs_min.S and stubs_entry_2.S need to be fixed
- fl_tbl[] needs to be fixed.

As for the source code, shall I attach a patch or shall I check in to svn? Please advise.


 

Related Topics