s80 anybody? - page 7 - General Discussion and Assistance - CHDK Forum

s80 anybody?

  • 205 Replies
  • 77302 Views
Re: s80 anybody?
« Reply #60 on: 01 / November / 2009, 00:38:13 »
Advertisements
OK, I verified that the SD_READONLY_FLAG is indeed 0x20000. It's kind of lucky that once CHDK is running, as long as the battery is still in, I can open the battery door, flip the SD write protect, and reinsert it and check the code. So it must be some other part of the code that was broken by me. But I have no idea where to start looking.

Re: s80 anybody?
« Reply #61 on: 01 / November / 2009, 16:55:56 »
I did find one mistake, which is I've been using the stubs_min.S copied from A620 and forgot that I need to change some values there, especially physw_status. It's bizarre that the key codes I figured out previously are still correct (I wonder if it's because physw_status has more than one copies in memory). In any case, that did not solve the 'Card Locked' issue, although I can verify from osd that physw_status[2] has the SD_READONLY bit cleared all the time. The other issue is that I still can't do firmware update using unlocked card: the camera simply stops responding after I do that.

Re: s80 anybody?
« Reply #62 on: 01 / November / 2009, 18:08:04 »
After experimenting a bit more, I still cannot figure out the problem. physw_status is 0x11958 and I am fairly confident with it. However, 0x11540 (which is from a620) also seems to work as I get the same values from both. I am wondering if the way s80 detects card lock is different, if so, I would need to go into the assembly code to try to figure it out.

I would be able to put this issue aside and continue if I could get the firmware update method to work. I copied PS.FIR generated in the bin folder to my SD card, and performed an update. After I clicked on OK, the green LED above the playback button flashes, and the camera is then turned off. What could be causing this problem? Please help!

*

Offline reyalp

  • ******
  • 13392
Re: s80 anybody?
« Reply #63 on: 01 / November / 2009, 18:31:43 »
After experimenting a bit more, I still cannot figure out the problem. physw_status is 0x11958 and I am fairly confident with it. However, 0x11540 (which is from a620) also seems to work as I get the same values from both. I am wondering if the way s80 detects card lock is different, if so, I would need to go into the assembly code to try to figure it out.
Very unlikely that s80 detects the write lock differently. Both earlier and later cameras all do the same. It might be in a different bit or word within physw_status, but it's very unlikely that it uses a completely different method. As stated before, you should be able to see the write lock status bit in physw_status. Mask that bit, and the camera no longer knows it is locked. You may be able to sanity check this by looking at either the diskboot code (search for string DISKBOOT.BIN, BOOTDISK etc in the main firmware code, not the initial loader at 0xFFFF0000) or the code that displays the card locked message.
Quote
I would be able to put this issue aside and continue if I could get the firmware update method to work. I copied PS.FIR generated in the bin folder to my SD card, and performed an update. After I clicked on OK, the green LED above the playback button flashes, and the camera is then turned off. What could be causing this problem? Please help!
You've probably done something wrong with your build or boot code. Is the PLATFORMID in your platform/<camera>/sub/<version>/makefile.inc correct for your camera ? If it's the A620 value, the FIR file will be encoded incorrectly.

If you haven't made sure the asm in the loader code (particularly in resetcode/main.c) is adjusted for your camera, do that now.
Don't forget what the H stands for.


Re: s80 anybody?
« Reply #64 on: 01 / November / 2009, 19:08:49 »
I am pretty sure PLATFORMID is correct (otherwise the camera won't let me do fw update).

I've checked through every code in the loader folder and could not spot anything wrong. Basically here are all the changes I made:
entry.S:
LDR     R3, =0xC02200BC

main.c:
#define LED_PR 0xc0220084
shutdown() function:
volatile long *p = (void*)0xc02200dc;
ps: One thing I am not sure is whether I should *p = 0x46 or *p = 0x44. I've tried both though.

resetcode/main.c:
I've looked through the asm line by line with the s80 fw dump, and there is no change I need to make.

*

Offline reyalp

  • ******
  • 13392
Re: s80 anybody?
« Reply #65 on: 01 / November / 2009, 19:23:56 »
shutdown doesn't matter for this. The misleadingly named LED_PR should actually be an MMIO related to shutting the camera down, but this isn't related to your current problem.
Don't forget what the H stands for.

*

Offline RaduP

  • *****
  • 908
Re: s80 anybody?
« Reply #66 on: 01 / November / 2009, 19:39:06 »
You must blink the LED at various points in the start routine and see where it stops, then take it from there.

Re: s80 anybody?
« Reply #67 on: 01 / November / 2009, 21:16:22 »
Still no luck. I used the blinking LED method RaduP suggested, and after fw update, the code runs all the way to h_usrRoot() in platform/s80/sub/100g/boot.c: I verified that the LED blinks after the drv_self_hide() function. At this point, I assume it should be the same with the bootable disk method: if the bootable disk runs (which it does), then why would firmware update not? Any idea?


*

Offline reyalp

  • ******
  • 13392
Re: s80 anybody?
« Reply #68 on: 01 / November / 2009, 21:29:27 »
One possibility: Something is referring to uninitialized memory, in one method it happens to contain a value that doesn't causes a crash, in the other it doesn't.

I'd keep moving the blinking code farther down the line until it stops working, maybe that will give a hint. Or disable tasks one by one until it works again.
Don't forget what the H stands for.

*

Offline RaduP

  • *****
  • 908
Re: s80 anybody?
« Reply #69 on: 01 / November / 2009, 22:16:27 »
Yes, move it further in that function and see what happens.
I did that a lot and without doing it it would have been nearly impossible to figure it out.

 

Related Topics