Ixus 200IS/SD980 1.01c porting thread - page 3 - General Discussion and Assistance - CHDK Forum

Ixus 200IS/SD980 1.01c porting thread

  • 108 Replies
  • 53289 Views
Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #20 on: 24 / August / 2010, 02:08:17 »
Advertisements
Hello,

thank you for reply.. I am just trying to see whethr my build process is correct or not.. it generates DISKBOOT.BIN file, but according to my code changes I dont see any expected changes.. maybe I am making changes in wrong file.. but anyways thanks for your reply.. I will try to make changes according to your guidelines. I had tried LED turn on and off earlier.. but it did not work.. so just to try from scratch..I wanted to disable restarting camera, etc..and then move to next parts step by step.

*

Offline reyalp

  • ******
  • 14126
Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #21 on: 24 / August / 2010, 02:55:59 »
so just to try from scratch..I wanted to disable restarting camera, etc..and then move to next parts step by step.
Diskboot is loaded into RAM that contains variables for the OS. Once the loading is complete, the previous OS is trashed. There is no way to continue running it.

If you can't light an LED using asm code in entry.S, then chances are your diskboot encoding is wrong (see NEED_ENCODED_DISKBOOT flag in platform/<camera>/sub/<version>/makefile.inc)
Don't forget what the H stands for.

Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #22 on: 24 / August / 2010, 03:45:05 »
I am using existing code which was attached in this thread..

NEED_ENCODED_DISKBOOT is set to 3

entry.s is calling my_restart in main.c and in my_restart method.. before it starts starts doing anything.. I am trying to blink the LED..

LED is at address = 0xC0220060 which is defined as LED_PR I also used another address which I found in wiki .. which is LED_AF = 0xC0223030

http://chdk.wikia.com/wiki/Ixus_200

but I dont see LED Flashing :( I do get BIN file generated as well... and it starts CHDK.. I get splash screen.. but then camera turns off.. but LED should flash if I can see splash screen.. so it means its able to load CHDK in memory. and LED turning on code is before CHDK splash screen. I am not very much sure about it.

so with my modified code.. when I build.. I get BIN file generated.. size changed.. but when I load it..  I dont see LED Flashing.. but I still see CHDK Splash and then camera turns off.

*

Offline RaduP

  • *****
  • 926
Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #23 on: 24 / August / 2010, 03:57:27 »
If you get the splash screen, that's great, it means your toolchain is configured properly and you can execute code in the camera.
Now, where exactly did you put the LED blinking code, and how does it look like?

Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #24 on: 24 / August / 2010, 04:05:52 »
I have written code in main.c

\loader\<camera>\main.c

in that there is a method called my_restart()

and code looks like following:

#define LED_PR 0xC0220060
void __attribute__((noreturn)) my_restart()
{
volatile long *p=(void*)LED_PR;
p[0] = 0x46;
      for(i=0;i<0x200000;i++){
         asm volatile ("nop\n");
         asm volatile ("nop\n");
      }

      for(i=0;i<0x200000;i++){
         asm ("nop\n");
         asm ("nop\n");
      }
}

and I have similar loop for another LED.. which is LED_AF at address = 0xC0223030


*

Offline RaduP

  • *****
  • 926
Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #25 on: 24 / August / 2010, 04:20:03 »
Try this:

         *((volatile int *) 0xc0223030) = 0x46;
         for (g=0; g<6000000; g++) // Wait a while
            {
                asm volatile ( "nop\n" );
            }
            *((volatile int *) 0xc0223030) = 0x44; // Turn off LED
         for (g=0; g<6000000; g++) // Wait a while
            {
                asm volatile ( "nop\n" );
            }

And make sure to look at the autofocus led, just in case you are missing the blink.

*

Offline RaduP

  • *****
  • 926
Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #26 on: 24 / August / 2010, 04:24:57 »
If that doesn't work, make sure to do a make clean before compiling, sometimes some files are not recompiled if the .o is still there. So make sure the .o is up to date after you compile the code.

Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #27 on: 24 / August / 2010, 05:17:21 »
i respectfully appreciate your work!

Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #28 on: 24 / August / 2010, 07:53:47 »
@RaduP : thanks for the tip.. I will recompile and try it after sometime.. today we have Rakshabandhar function going on in India.. so guests coming and going.. busy with that :) will try that out in couple hours. Thanks for that.

Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #29 on: 24 / August / 2010, 09:18:03 »
just tried.. but it still doesnt work :( maybe LED Address is wrong? I tried both address.. none works... is there any other way to check the working? like for example I can stop CHDK splash from displaying?

do I need to update .FI2 file as well? because so far what I understood is that DISKBOOT.BIN and PS.FI2 both contains same infromation.. just in different format.

2nd thing when I compile code.. I get following warning.. is this reason?

-> signatures_dryos.h
CAUTION! 'signatures_dryos.h' is not updated due to 'sig_ref_dryos_1.bin` is empty!

 

Related Topics


SimplePortal © 2008-2014, SimplePortal