Author Topic: Ixus 200IS/SD980 1.01c porting thread  (Read 11685 times)

Offline fe50

  • Guru Member
  • ******
  • Posts: 2608
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #15 on: 05 / August / 2010, 10:17:31 »
FWIW - there's also sila's CHDK-Shell-like GUI solution for Linux (Python):

--> http://www.wirklemms.de/chdk/forum/viewtopic.php?t=1829

Offline azulgranas

  • Rookie
  • *
  • Posts: 8
Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #16 on: 12 / August / 2010, 17:45:16 »
been waiting for it for a soooooo long time :(

Offline openuas

  • Rookie
  • *
  • Posts: 44
  • OpenUAS
    • OpenUAS
Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #17 on: 15 / August / 2010, 18:33:22 »
Toolchain works!  :haha

Next hurdle need also old GCC 3.4  with other ARM type for other project thus being busy with letting it work side by side, some issues there. For sure it will work also soon. Being busy can only work on on and off this week :(

Progressing the sets setup, as I also have my USB cable in to trigger camera via PPM signals now.

Offline dhavalhirdhav

  • Rookie
  • *
  • Posts: 30
Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #18 on: 24 / August / 2010, 08:06:12 »
Hello,

I am new to this forum and new to CHDK as well.. but I am good with ASM and C/C++, and I belive that I can contribute my little to help port CHDK on IXUS 200 IS.

I tried to use Source code and compiled it.. I managed to boot it up.. but as soon as it boots up.. it turns off camera.. its not able to do anything else.

I tried changing few things in code.. but I failed to see changes when I loaded up modified firmware in SD Card.. it still behaves like previous one.. I tried to flash LED light.. but failed to do that..

if you can give me a little more pointer towards how it works.. I can take it forward from there.. I will just need 2-3 stat points.

what I also tried was to comment following code in entry.S file n loader/ixus200_sd980

B   my_restart

just to see whether its loading or restarting camera or not.. but I dont see any changes happening..  I Copmiled code using following command
gmake fir
gmake PLATFORM=ixus200_sd980 PLATFORMSUB=101C

also one more thing.. when I goto Update Firware in camera.. it shows me you want to update from 1.0.1.0 to 1.0.0.0

Offline reyalp

  • Guru Member
  • ******
  • Posts: 4490
Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #19 on: 24 / August / 2010, 09:48:14 »
what I also tried was to comment following code in entry.S file n loader/ixus200_sd980

B   my_restart

just to see whether its loading or restarting camera or not.. but I dont see any changes happening.. 
Not sure what you expected to happen, but if you do that, it will just wander off into what ever garbage is next in memory, which will also cause the camera to crash.

I would suggest turning on an LED instead, followed by an infinite loop. If the LED doesn't light, then there's something wrong with your build process. The earliest point you can do this is in loader/entry.S

To turn the LED on, you must store 0x46 to that address. Use 0x44 to turn it off.

Some things that can cause crash on startup
- incorrectly encoded diskboot.bin  ( only if you are using diskboot, not Firm update. PS.FI2 will be rejected if it is not the right encoding).
- incorrectly configured toolchain. Using one of the pre-built toolchains linked from the wiki will avoid this.
- binary built for the wrong firmware version or camera. However, this should happen quite late, so blinking an LED early in the process should still work.

The version listed in the firm update menu is irrelevant.
Don't forget what the H stands for.

Offline dhavalhirdhav

  • Rookie
  • *
  • Posts: 30
Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #20 on: 24 / August / 2010, 11:08:17 »
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

  • Guru Member
  • ******
  • Posts: 4490
Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #21 on: 24 / August / 2010, 11: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.

Offline dhavalhirdhav

  • Rookie
  • *
  • Posts: 30
Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #22 on: 24 / August / 2010, 12: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

  • Hero Member
  • *****
  • Posts: 841
Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #23 on: 24 / August / 2010, 12: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?

CHDK Forum

Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #23 on: 24 / August / 2010, 12:57:27 »

Offline dhavalhirdhav

  • Rookie
  • *
  • Posts: 30
Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #24 on: 24 / August / 2010, 13: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

  • Hero Member
  • *****
  • Posts: 841
Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #25 on: 24 / August / 2010, 13: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

  • Hero Member
  • *****
  • Posts: 841
Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #26 on: 24 / August / 2010, 13: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.

Offline azulgranas

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

Offline dhavalhirdhav

  • Rookie
  • *
  • Posts: 30
Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #28 on: 24 / August / 2010, 16: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.

Offline dhavalhirdhav

  • Rookie
  • *
  • Posts: 30
Re: Ixus 200IS/SD980 1.01c porting thread
« Reply #29 on: 24 / August / 2010, 18: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!

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal