How to do a "normal" boot using the CHDK? - General Discussion and Assistance - CHDK Forum supplierdeeply

How to do a "normal" boot using the CHDK?

  • 6 Replies
  • 3428 Views
How to do a "normal" boot using the CHDK?
« on: 17 / June / 2009, 10:28:55 »
Advertisements
Hi folks,

I'm currently trying to port the A430. In order to narrow potential sources of errors, I like to go in small steps. I figured my first step should be to do a normal boot, as if the card was not locked. I've already adapted the following functions in the platform directory based on my reference port (a450): boot(), h_usrInit(), h_usrKernelInit(), and h_usrRoot().

Everything up to h_usrKernelInit() seems to work fine, though the camera seems to reboot itself in circles. At least, when I place a LED blinking sequence inside h_usrKernelInit(), this sequence is executed over and over again.

However, when I move the blinking sequence inside h_usrRoot(), no blinking occures at all. So I suspect that instead of executing h_usrRoot(), the camera decides to reboot itself as it finds a locked card inside the slot.

If my assumption is right, I'd like to know how I could prevent the camera from rebooting. In any case am I open for suggestions on what is going on here...

Now I'm looking forward to your ideas...

Thanks for reading

*

Offline reyalp

  • ******
  • 14079
Re: How to do a "normal" boot using the CHDK?
« Reply #1 on: 17 / June / 2009, 14:42:05 »
If you put the .FIR file on the SD card and don't lock the card (or don't copy DISKBOOT.BIN) you should be able to load with "firm update", and not get a boot loop.
Don't forget what the H stands for.

Re: How to do a "normal" boot using the CHDK?
« Reply #2 on: 17 / June / 2009, 17:54:30 »
Yeah, that worked!

When I move the blinking sequence into h_usrKernelInit() now, the camera blinks and reboots normally. And when I put the blinking sequence into h_usrRoot(), I'd expect the camera to blink also, but it doesn't. What could go wrong here?

BTW, I had to comment out the sanity check in startup() for the camera to reboot at all. The constants are set to:
MEMISOSTART=0x9F7D0
MEMISOSIZE=0x40000
I have double checked that MEMISOSTART is the same as is required by the boot() function. But it fails. Any hints?

Thanks again

*

Offline reyalp

  • ******
  • 14079
Re: How to do a "normal" boot using the CHDK?
« Reply #3 on: 17 / June / 2009, 17:59:38 »
Yeah, that worked!

When I move the blinking sequence into h_usrKernelInit() now, the camera blinks and reboots normally. And when I put the blinking sequence into h_usrRoot(), I'd expect the camera to blink also, but it doesn't. What could go wrong here?
It's possible your blinking sequence itself is trashing something. Post the code.

Quote
MEMISOSTART=0x9F7D0
MEMISOSIZE=0x40000
I have double checked that MEMISOSTART is the same as is required by the boot() function. But it fails. Any hints?

Thanks again
MEMISOSIZE should not be needed at all, it's a leftover. MEMISOSTART should be obvious from canon boot sequence.

BTW, there's a few of us in IRC on irc.freenode.net, #CHDK if you want interactive help ;)
Don't forget what the H stands for.


Re: How to do a "normal" boot using the CHDK?
« Reply #4 on: 17 / June / 2009, 19:36:11 »
Alright, I've discussed with [NW]reyaIP on IRC but the problem with h_usrRoot() still remains. Maybe some more eyes could have a look. As I've said, the code is based on the A450. The only modifications I've done to it are:

boot.c: http://pastebin.com/m51f19ff3
makefile.inc: http://pastebin.com/m354683e4

Greetings

Re: How to do a "normal" boot using the CHDK?
« Reply #5 on: 17 / June / 2009, 19:44:23 »
Oh, BTW, don't mind the blink() statement inside h_usrKernelInit(), I've commented it out already but it still won't execute h_usrRoot(). I've also put a while(1) true as the first statement in h_usrRoot() but the still camera doesn't hang.

Re: How to do a "normal" boot using the CHDK?
« Reply #6 on: 18 / June / 2009, 06:43:32 »
I've walked through the whole asm code and found a wrong number and fixed it. Now the camera boots normally using h_usrRoot(). Sigh.

Thanks again to [NW]reyaIP for his patience. I still learned a lot from our discussion.

I'll now approach to get the main task to run...

 

Related Topics