CHDK Forum

CHDK Development => General Discussion and Assistance => Topic started by: citizenx on 13 / June / 2010, 06:59:29

Title: Ixus 200IS/SD980 1.01c porting thread
Post by: citizenx on 13 / June / 2010, 06:59:29
I started a port for the fw v1.01C of the Ixus 200IS, based in part on the fw v1.00C source by RaduP
(http://chdk.setepontos.com/index.php/topic,4228.0.html (http://chdk.setepontos.com/index.php/topic,4228.0.html)). I updated the addresses and stubs wherever I could and the firmware now boots up to the splash screen (using the PS.FI2 and manual firmware update method). Pressing the ALT button displays the "ALT" label on screen, however pressing any further button (e.g. menu) causes the camera to turn off.

I am an absolute newbie at ASM coding and CHDK in general, so I'm hoping someone with more experience can take it from here to further complete the port...

The source code, rebased with the latest SVN trunk as of this writing is available here:
http://home.scarlet.be/~rh241040/chdk/sd980_101c.zip (http://home.scarlet.be/~rh241040/chdk/sd980_101c.zip)

I based the changes on the firmware dump by Valor:
http://rapidshare.com/files/320665256/sd980_v1.01C.bin (http://rapidshare.com/files/320665256/sd980_v1.01C.bin)

DISKBOOT.BIN and PS.FI2 can be found in the bin directory
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: titbb on 13 / June / 2010, 09:30:31
Nice effort, i wish i could help you though, but im a complete nitwit when it comes to this stuff :(

Lets hope someone can finish your work, i've been waiting for a 101c port for some time now.

Thanks for your effort!
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: Legion5 on 17 / June / 2010, 04:45:50
I hope you get it to work, the SD980 shoots incredible images for an ultracompact but it would always be nice to get more control over them.

If It's allowed I'll put up a $15 reward for anyone who gets this done.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: RaduP on 29 / June / 2010, 18:36:43
If you are still committed to do it, I can try to help a bit.
If you have questions, you can ask.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: maxbaron on 03 / July / 2010, 05:57:34
I would like to help to make this port ...but I'm totally new to this kind of devolpment.
Anybody can help me to discover how can I start? tools used? ...and other usefull things?
thanks in advance
Max
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: reyalp on 03 / July / 2010, 16:17:25
I would like to help to make this port ...but I'm totally new to this kind of devolpment.
Anybody can help me to discover how can I start? tools used? ...and other usefull things?
thanks in advance
Max
http://chdk.wikia.com/wiki/For_Developers (http://chdk.wikia.com/wiki/For_Developers)
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: RaduP on 03 / July / 2010, 17:43:52
How good are you with C? Do you know any assembly language?
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: azulgranas on 01 / August / 2010, 01:22:29
Are u still working with this port?
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 01 / August / 2010, 16:27:19
RaduP, yes I do know C and a wealth of other languages, also assembler for some processors, maybe a bit rusty... Also knowledge of cross compiling and ARM toolchain. However no experience with the Canon firmware YET. Do not even have the camera yet, but I will next week. Massive amount of other thing to do like everyone ;) but committed to get the Canon Powershot SD980 IS a.k.a. IXUS 200 IS in Europe, IXY DIGITAL 930 IS to work with CHDK.

RaduP, indeed some guidance really appreciated... so I bet now it is reading the Wiki for developers next week.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: RaduP on 01 / August / 2010, 21:01:47
Sure, i will try to answer your questions as best as I can.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: sens125 on 02 / August / 2010, 14:34:08
I hope you get it to work, the SD980 shoots incredible images for an ultracompact but it would always be nice to get more control over them.

If It's allowed I'll put up a $15 reward for anyone who gets this done.

I really hope you guys get this to work! Since this kind of stuff is way over my head, I'd like to follow Legion5 and offer $15 to whoever gets this done. Thanks for the effort!
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 03 / August / 2010, 09:48:46
Well sens125 and Legion5 I hope you lose your $ to me or someone else, since that means we all managed together to get it to work ;). Got my camera in today, and no surprise here: indeed v1.01c. Have massive amount of things to do but steadily will work with you all towards a working firmware. I will follow in the footsteps of RaduP since he managed to get it to work for Firmware v1.00. Now first of to building this blinky rip the firmware electronics thing I bet. And reading much more Wiki and Forum posts until I get a hang of it.

IDEA: Can I use a (build in) webcam to rip the firmware data, ...hmmmm maybe slower even but saves hassle with buildin RS232 cables and stuff...

Q: If someone has a corrrect v1.01 Firmware of the IXUS200IS let me know plz.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: RaduP on 03 / August / 2010, 13:09:25
The firmware has been dumped before, not sure where. Check to see if it is posted in the 'firmware dumps repository'.
Edit: Yep, here: http://drop.io/chdkdumps2/asset/sd980-ixus200-101c-7z (http://drop.io/chdkdumps2/asset/sd980-ixus200-101c-7z)
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 04 / August / 2010, 12:22:01
Great, THX That is a real timesaver not having to use a blinker or udumper myself now! BTW got my second Ixus 200IS camera today to toy around with, also Firmware 1.01c. But now first have to set up the correct ARM toolchain on my 64 Bit Linux. Try to keep also my other toolchains GCC and BinUtil versions needed later for other projects. Also will try IDA (On Windows7 64Bit YUK!) Well being pragmatic now.. There is just so much to do aside from the CHDK stuff. Well, I torture myself voluntary ;)  with the Canon hackery...
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: reyalp on 04 / August / 2010, 17:32:10
But now first have to set up the correct ARM toolchain on my 64 Bit Linux. Try to keep also my other toolchains GCC and BinUtil versions needed later for other projects.
Following the instructions for building gcc on linux in the wiki, you can make a self contained GCC setup for CHDK. I have this set up on my 64 bit linux box, and just run a shell script to set the paths correctly before working on CHDK.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: fe50 on 05 / August / 2010, 01: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 (http://www.wirklemms.de/chdk/forum/viewtopic.php?t=1829)
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: azulgranas on 12 / August / 2010, 08:45:16
been waiting for it for a soooooo long time :(
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 15 / August / 2010, 09: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.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 23 / August / 2010, 23: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
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: reyalp on 24 / August / 2010, 00: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.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 24 / August / 2010, 02: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.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: reyalp 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)
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav 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 (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.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: RaduP 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?
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav 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

Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: RaduP 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.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: RaduP 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.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: azulgranas on 24 / August / 2010, 05:17:21
i respectfully appreciate your work!
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav 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.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav 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!
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: reyalp on 24 / August / 2010, 12:15:26
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.
DISKBOOT.BIN is used when booting automatically.

PS.FI2 is used when loading with "firm update"

You only need whichever one goes with the method you are using to load CHDK

If the CHDK splash screen is being shown, my previous comments probably do not apply. I was under the impression the camera crashed immediately at boot without showing anything. This sounds more like your modified binary isn't being used at all. Make sure you are putting the correct binary for whatever loading method you are using on the card. If you are using automatic boot on a multi-partition card, make sure you are putting diskboot.bin on the small partition.
Quote
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!
This is normal. You only need the reference bins if you are adding new entry points to the system. If you don't have them, your build uses the ones which are svn, which is fine for what you are doing.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 24 / August / 2010, 12:56:47
aah that gives me a lot of clear ideas now.. I am doing it through Firmware update method.. so its loading FI2 and not DISKBOOT.BIN.. for some reason DISKBOOT.BIN doesnt work for me.. am not sure why..

anyways so when I compile code with following command

gmake fir

or

gmake PLATFORM=ixus200_sd980 PLATFORMSUB=101C fir

it gives me DISKBOOT.BIN only.. how do rebuild or generate PS.FI2 file?
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 24 / August / 2010, 13:42:57
hmm ok I found out.. so I need keys to enter in fi2.inc file.. which will be a little tricky.. if anyone knows keys for ixus200_sd980 let me know plz :)

I will meanwhile find out why my SD card doesnt boot up.. I have made it bootable also.. and have included DISKBOOT.BIN file.. but doesnt boot up.. any pointers?
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: RaduP on 24 / August / 2010, 14:41:47
Is it FAT16 or 32?
It will only boot from a FAT16 partition.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 24 / August / 2010, 14:49:55
yes it is FAT16.. I managed to create FI2 file.. but when I load it from firmware update.. camera starts and crash :( also LED doesnt blink.. so am not sure whether am on proper line or not.. but I will try out with removing LED light code and see if I can see CHDK splash back or not.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: RaduP on 24 / August / 2010, 15:07:06
Ok, so then if you managed to get to the CHDK splash screen, which method did you use? And did the file time stamp match the compilation time?
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 24 / August / 2010, 15:09:00
I tried removing code of LED blink.. but it just fails to startup.. now it doesnt show splash screen. :( I built FI2 file using f2encoder.. not with gmake.. as gmake requires keys.. which I am unable to get.

am I doing right or wrong?

when I managed to get CHDK splash screen.. I used the FI2 file which was uploaded in this thread.. on 1st post.. inside zip folder.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: RaduP on 24 / August / 2010, 15:20:27
Well, let's try the boot disk version then. Please describe all the steps you took to attempt to load it via the diskboot method. And did you remember to write protect the SD card?
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 24 / August / 2010, 15:26:07
I started as follows:

2 GB SD Card..

used CardTricks144 to format SD Card FAT16.. once formatted clicked on Make Bootable.. once done.. copied CHDK folder onto SD Card.. along with DISKBOOT.BIN file.. after that write protected card.. slide it inside camera.. and turned it on.. on screen all I see is card is locked.

I also tried manual formating and then through CardTricks144 just clicked on MakeBootable.. but same issue. does not boot up.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: RaduP on 24 / August / 2010, 16:22:21
Just making it bootable for Windows/DOS won't. Follow the instructions here: http://chdk.wikia.com/wiki/Bootable_SD_card (http://chdk.wikia.com/wiki/Bootable_SD_card)
If you have a hex disk editor, make sure the boot sector matches the description in that link.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 24 / August / 2010, 16:46:18
:( tried all 4 ways.. none of them works.. not sure why :( even with HEX Editor it shows FAT16 and BOOTDISK. and I have DISKBOOT.BIN file as well on my card.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 24 / August / 2010, 16:54:26
do you think it has something to do with DISKBOOT.BIN not having signature? but I just checked code and has at 0x1900
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: RaduP on 24 / August / 2010, 17:08:59
What is the size of your diskboot.bin file?
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 24 / August / 2010, 23:02:23
Size is 247KB = 252000 bytes and 253952 bytes size on disk
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 25 / August / 2010, 01:28:53
I just recently did low format with Canon digicam only.. and then modified boot sector to include BOOTDISK starting from address 40... included DISKBOOT.BIN and PS.FI2 file.. but still doesnt boot.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 25 / August / 2010, 01:46:08
ok.. I managed to be one step closer.. I deleted all code which was inside my_restart(), earlier it used to restart camera and canon splash screen comes and then turns off.. now it doesnt restart camera.. :) so now I know that I am getting proper FI2 file with fi2encdec. so now issue I have to check is with what is happening after that. before that I will just try to lit up LED. will keep posted here.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 25 / August / 2010, 02:23:04
managed to get LED blink.. but AF light.. not the back light. AF light address at 0xC0223030 this is happning at start of my_restart() method.

now I will check with more related to copy_and_restart part.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: RaduP on 25 / August / 2010, 03:24:15
What happens AFTER you get the splash? Does the camera freeze or something?
If you get to the splash screen, I guess the firmware versions are very very close to each other and you won't have to do much work in the initialization part.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 25 / August / 2010, 05:19:40
I get canon logo.. but not CHDK splash screen right now.. I am just checking whether it is causing issue.. I am right now checking with boot() method in boot.c file.

forgot to add.. after CANON Splash screen (LOGO).. camera turns off.. it doesnt freeze.. just turns off itself.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 25 / August / 2010, 05:27:26
ok finally found where the issue is.. issue is at boot() method in boot.c file. I am not sure where exactly error is.. but I tried to blink LED at start of boot.. which happend.. and then at end of boot method.. which failed. so ASM code which is being executed is having issue. CHKD address is incorrect?
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 25 / August / 2010, 06:42:13
I noticed that in boot.c file.

task_Startup_my() method has following line commented

//         "BL      sub_FF83A2F8\n"    // start diskboot.bin

is this right? as far as what I understand if I uncomment it.. diskboot will try to load.. and again restart.. which will get into infinite loop?
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 25 / August / 2010, 07:03:57
hmm not getting where exactly the issue is appearing.. I will just give behaviour..

when I start the cam.. and do firmware update.. it restarts cam.. it plays startup sound.. shows canon logo on screen.. and led light blinks on back 1st time.. and then 2nd time also it blinks.. and camera just turns off. but when 2nd time it blinks.. LED just turns on.. and doesnt get off.. camera turns off.. while LED is on.. camera turns off.. and LED also off.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: RaduP on 25 / August / 2010, 14:23:13
Well, that ASM cod needs to be modified, because every camera and firmware version will have the functions and stuff at different addresses.
So what you must do is take IDA or some other asm disassembler and look at the code from the firmware, get the right addresses and replace them in my code.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 25 / August / 2010, 14:28:43
ya I am planning to do that.. I am trying to get original firmware.. which I am unable to get with UDumper.. so wll have to use blinker method.. which I will try in couple days.

you have ported to 1.00c right? is it in SVN?
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 25 / August / 2010, 15:13:22
ok I got the issue..

in boot.c file, in task_Startup_my() method.. last line is

B sub_FF8165B0

and here it is causing the issue, making camera crash and turn off. any idea?

when I tried changing its address to something else.. it just show me canon logo.. and camera turned off.. so I belive FF8165B0 is code to start DryOS and after that it will hook CHDK.. but I am unable to find what is happening or where execution is going after B sub_FF815B0
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: RaduP on 25 / August / 2010, 16:59:27
The firmware has been dumped already, there is a link to it somewhere in this thread. And I only ported the first version of the firmware, I forgot what version that is.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 25 / August / 2010, 22:54:19
link on this thread for firware is dead :(
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: RaduP on 25 / August / 2010, 23:18:25
The first one is dead, but this one isn't: http://chdk.setepontos.com/index.php/topic,5321.msg53320.html#msg53320 (http://chdk.setepontos.com/index.php/topic,5321.msg53320.html#msg53320)
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 25 / August / 2010, 23:44:12
Thank you :) will start work on this very soon.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 29 / August / 2010, 16:21:46
worked tonight on this for about hour.. and made very little progress.. found two LED Addresses.

for Green and Orange

so now we have AF, Green and Orange

#define LED_PR         0xC0220130
#define LED_ORANGE     0xC0220134
#define LED_AF         0xC0223030

also updated Wikia page - http://chdk.wikia.com/wiki/Ixus_200 (http://chdk.wikia.com/wiki/Ixus_200)
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 30 / August / 2010, 06:54:47
just a question..

what is LED_PR? is it same as LED_GREEN? I mean both have same color Green?
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: fe50 on 01 / September / 2010, 05:59:51
what is LED_PR?
LED_PRINT, blue LED on the PRINT button on most Powershots...
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: Dummie on 02 / September / 2010, 04:19:57
Progress has been made?
I appreciate the work you are doing!
I know that you do for the spirit of sharing and you probably do not need but i'm going to pay 50,00 euros to anyone generates a working CHDK for firmware 1.01c!
I swear I do!
Thanks again!
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: Finlandia on 18 / September / 2010, 08:33:52
I will donate another 50 euros!
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 28 / September / 2010, 12:08:43
Now that the OBC2010 Challenge is past, I can devote time to the 1.0.1c firmware again and I see that dhavalhirdhav is progressing, good to see that.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: azulgranas on 09 / October / 2010, 03:53:52
i've been waiting for this for a so long time. considering between continuing waiting or changing to a DSLR...
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 31 / October / 2010, 02:33:00
Hello everyone.. sorry for not showing up here sicne long time.. I was caught up with lots of work at office.. and was travelling.. I am back on this.. and will soon start putting more updated.

@openuas: any progress that you have made so far?
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 03 / November / 2010, 22:27:05
Honestly? No, same here lots of work to do... :-[ But this night, first time since long, logging into the forum, that is a good sign... No promisses, but I finally got my IR modded Cam working again. So now have Two working 200IS's.

Can boot CHDK, do get a boot message, then the Firmware crashes. Now it is time to undust and revive my Build environment on Linux...
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 04 / November / 2010, 15:00:54
So I've updated source CHDK to SVN revision 964. make clean then in make I'll get
reversebytes.S:11: Error: bad instruction `ldm r0,{R4-R11}'

Any hint?
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 04 / November / 2010, 15:40:48
i think i need this patch
http://chdk.neszt.hu/git/?p=chdk.git;a=commitdiff;h=cec4ed0d549e3d7872376b7bc03908903a4e84ef#patch12 (http://chdk.neszt.hu/git/?p=chdk.git;a=commitdiff;h=cec4ed0d549e3d7872376b7bc03908903a4e84ef#patch12)
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 04 / November / 2010, 15:44:28
@dhavalhirdhav, what does your

$ arm-elf-gcc -v

Give?
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 08 / November / 2010, 10:27:55
Today's progress. Installed Toolchain from scratch under Linux64bit and now CHDK build gave:

<< Leaving loader/ixus200_sd980
<< Leaving loader
>> Entering to CHDK
...
**** Firmware creation completed successfully  :haha

JaY! On the the next steps...
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 09 / November / 2010, 09:42:09
Note:
Under Linux capitalization is important thus
>>make PLATFORM=ixus200_sd980 PLATFORMSUB=101C
is incorrect and should be

make PLATFORM=ixus200_sd980 PLATFORMSUB=101c fir

Mind the small c and not C in the end
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 09 / November / 2010, 09:43:20
Updated to SVN v966 and still :-) can compile via

$ make PLATFORM=ixus200_sd980 PLATFORMSUB=101c fir

Now onto the SD Boot issues...
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 09 / November / 2010, 11:14:38
Using GCC3.4.6 Crosscompiler on Linux 64Bit

$ make PLATFORM=ixus200_sd980 PLATFORMSUB=101c fir NEED_ENCODED_DISKBOOT=3

Press the Play button on the cam..This boots the firmware! I see the CHDK logo, then screen blanksnothing anymore...

but that is fine ;) I will adjust main.c later, but now first of to getting the IRDA on Win7, Brrrr :( working inclusive helper scripts.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 09 / November / 2010, 14:35:00
Good, after changing my_restart() in "{yoursource}/loader/ixus200_sd980/main.c" the LED blink, code executes. Great!

Current code

Code: (c) [Select]
void __attribute__((noreturn)) my_restart()
{
    //void __attribute__((noreturn)) (*copy_and_restart)(char *dst, char *src, long length);
    //int i;

    /* New code for proving the code is executed and firmware works */
    #define LED_PR         0xC0220130 //LED light up green
    #define LED_ORANGE     0xC0220134 //Same LED light up orange now
    #define LED_AF         0xC0223030

    int j;
    int k=6;

    for(;k>0;k--)
    {
        /* Turn on the LEDS */
        *((volatile int *) LED_AF) = 0x46;
        /* ((volatile int *) LED_ORANGE) = 0x46; */
        *((volatile int *) LED_PR) = 0x46;

        /* Wait a while */
        for (j=0; j<5000000; j++)
        {
                asm volatile ( "nop\n" );
        }

        /* Turn them off again */
        *((volatile int *) LED_AF) = 0x44;
        /* ((volatile int *) LED_ORANGE) = 0x44; */
        *((volatile int *) LED_PR) = 0x44;

        /* Wait a while again */
        for (j=0; j<5000000; j++)
        {
                asm volatile ( "nop\n" );
        }
    }

    /* Original code again */
/*
    for (i=0; i<(blob_copy_and_reset_size/sizeof(long)); i++){
        ((long*)(RESTARTSTART))[i] = blob_copy_and_reset[i];
    }

    copy_and_restart = (void*)RESTARTSTART;
    copy_and_restart((void*)MEMISOSTART, (char*)blob_chdk_core, blob_chdk_core_size);
*/
}

What is the *best next step* which leads the fastest to a fully working Firmware? Since I'm dying to try some scripting on my cam... ;)
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 09 / November / 2010, 15:50:39

Waiting on ARM disassembly, why not post progress in the meantime...  8)
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 09 / November / 2010, 15:51:59
Looking OK to me...or I bet e few byte offet wrong

FF800000 ; -- -------------------------------------------------------------------------
ROM:FF800004 aGaonisoy       DCB "gaonisoy"
ROM:FF80000C ; ---------------------------------------------------------------------------
ROM:FF80000C
ROM:FF80000C loc_FF80000C                            ; CODE XREF: ROM:loc_FF800000j
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 09 / November / 2010, 16:11:54
Ran the scan-string.idc and ripped the strings, worked out well.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: reyalp on 09 / November / 2010, 16:22:47
The starting address should be FF810000, there is no chance it uses a different ROM address than the already known 100c.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: Dummie on 10 / November / 2010, 03:58:57
openuas I appreciate the work you're doing.
I hope you'll post the CHDK soon.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 10 / November / 2010, 05:28:14
reyalp, THX. Will disassemble again with this value, and run the standard scripts to get some useful data out of firmware and put it up for download.

BTW what would be the best next step now? I Bet http://chdk.wikia.com/wiki/Adding_support_of_a_new_camera (http://chdk.wikia.com/wiki/Adding_support_of_a_new_camera)
Any hints to good threads of people that already walked such a path welcomed
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 10 / November / 2010, 09:33:52
Intermezzo:
As one might have read, drop.io service will be closed down. It just so happens all the CHDK dumped firmware blocks are stored there on this server. Just to make sure the dumps do not get lost, I've made a clone of ALL dumps. they can be found here:
 http://www.openuas.org/chdkdumps/asset/

With all the same filenames thus simply replacing
 http://drop.io/{whateveritwas}
of the original link with
 http://www.openuas.org/{whateveritwas}
will get you your file.

NOTE: Three wrongly named files where renamed but for link's sake made also a symbolic link to old name.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: waterwingz on 10 / November / 2010, 10:49:27
OpenUAS :   There are two firmware dumps for the SD940 at http://drop.io/IXUS_120. (http://drop.io/IXUS_120.)  Can you grab the 103c version as well ?

Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 10 / November / 2010, 12:21:32
Done. BTW named the IXUS120.BIN to ixus120_sd940_100a.7z the other to the "default" filenaming: ixus120_sd940_103c.7z

To not confuse reader in this thread, it about IXUS200IS also known as SD980 v1.01c porting
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 11 / November / 2010, 15:08:52
Status update:

                                                                                           
                                                                                                                              

ROM:FF810000                 B       loc_FF81000C                                                                            
ROM:FF810000 ; END OF FUNCTION CHUNK FOR sub_FF83A130                                                                        
ROM:FF810000 ; ---------------------------------------------------------------------------                                    
ROM:FF810004 aGaonisoy       DCB "gaonisoy"                                                                                  
ROM:FF81000C ; ---------------------------------------------------------------------------                                    
ROM:FF81000C ; START OF FUNCTION CHUNK FOR sub_FF83A130                                                                      
ROM:FF81000C


A new file called "stubs_entry_ida.S" was nicely generated and sat alongside the PRIMARY.BIN

Started reading http://chdk.wikia.com/wiki/Adding_support_for_a_new_camera (http://chdk.wikia.com/wiki/Adding_support_for_a_new_camera) and will follow the steps as advised there

....

..It is mighty quiet here, any help appreciated so we would have a Beta by  :xmas for everyone...
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: waterwingz on 11 / November / 2010, 23:20:47
OpenUAS :  I'm confused (but that is normal).  At the start of this thread, I believe citizenx posted a working version of code for the 1.01c.  How come you are stuck back at an earlier step.  What did I miss ?
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 12 / November / 2010, 13:11:59
Hello,

my source is not able to start up.. it starts flashes LED>. but no CHDK screen nothing.. so if you can give me ur code.. it will be great..
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: titbb on 14 / November / 2010, 09:49:25
OpenUAS :  I'm confused (but that is normal).  At the start of this thread, I believe citizenx posted a working version of code for the 1.01c.  How come you are stuck back at an earlier step.  What did I miss ?

I THINK it is because it is easyer to start all over at times, then to sift through all the code looking for an error of some sort.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: waterwingz on 14 / November / 2010, 10:03:15
titbb :  I understand about what you are saying as far as starting clean.  For what its worth,  I started with the code posted in this forum and have been trying to convert it to run on the SD940.  From what I can tell, the SD980 is pretty close - the addresses in stubs_entry.s either match or are at least all in the same order.   At this point,  I can boot from the SD card,  get CHDK to load, verify that the spytask runs (it now blinks the orange LED every 5 seconds so that I know its there) and can get the CHDK logo to display. I guess figuring out the keypad is next.  

Not sure I could have gone even this far without the posts in this forum (and I've spent hours scanning other threads) so thanks to all the people who posted !   My next worry is wearing out the SD card contacts and/or breaking the access door on the bottom of the camera with all the "compile, load, run" cycles I'm putting on it.

WW
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 15 / November / 2010, 08:19:48
waterwingz , you wote "What did I miss ?"

Well probabbly  this part of what citizenx wrote ;)
> however pressing any further button (e.g. menu) causes the camera to turn off.

Great that you are porting for IXUS120 SD940, and great you dumped v1.03C I wish you success isn creating a BETA.

titbb, if there would be a working version I would not have started the port :blink: . There is a difference in working and booting the CHDK firmware. Working means you have functioality of the CHDK , e.g the abillity to run scripts etc.

To know what amount of effort you have to put in to get a working beta you can read http://chdk.wikia.com/wiki/Adding_support_of_a_new_camera (http://chdk.wikia.com/wiki/Adding_support_of_a_new_camera)  even if it is not a "NEW" camera a new Firmware version takes about the same amount of work.

Also made my own toolchain since on a 64Bit Linux and needed speciffic ARM GCC optiona compiled in.

Just FYI waterwingz, "stuck back at an earlier step",  ??? Not really ;) it is now just the hard work of adding functions step by step for v1.0.1c of the IXUS200 SD980

A new week and will continue working of the firmware.... THX for all the encouragement.



Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 15 / November / 2010, 08:26:34
Hello,

my source is not able to start up.. it starts flashes LED>. but no CHDK screen nothing.. so if you can give me ur code.. it will be great..
See http://chdk.setepontos.com/index.php?topic=5321.msg56794#msg56794 (http://chdk.setepontos.com/index.php?topic=5321.msg56794#msg56794) for code. But adding this code there will stop running the CHDK start, that is normal. Do not forget to add the CHDK folder on your SD otherwise the Logo will indeed not show, since the resource for this is in a subfolder of the CHDK folder on your SD. Will send you the current code.

BTW dhavalhirdhav which GCC toolchain do you use on Which platform? If it is selfmade with wrong flags, chances are high the ARM code indeed crashes on your IXUS. An $ arm-elf-gcc -v woud be helpfull solving your issue.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: titbb on 15 / November / 2010, 09:47:03
titbb, if there would be a working version I would not have started the port :blink: . There is a difference in working and booting the CHDK firmware. Working means you have functioality of the CHDK , e.g the abillity to run scripts etc.

To know what amount of effort you have to put in to get a working beta you can read http://chdk.wikia.com/wiki/Adding_support_of_a_new_camera (http://chdk.wikia.com/wiki/Adding_support_of_a_new_camera)  even if it is not a "NEW" camera a new Firmware version takes about the same amount of work.


Yo :)

Yes, i read that, tried a bit of it myself, but my knowledge regarding such things is not really that good. I was just replying to the question why you did start a new port, and not continued the existing one :)

And yes, i also appreciate your hard work regarding the port. Can't wait to CHDK again. Need bracketing for my HDR.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: dhavalhirdhav on 15 / November / 2010, 10:14:08
@openuas:

I am running gcc 4.4.0 on Windows 7 32-bit.. its not custom made. Thread model: Single. I downloaded it from SVN. I do have CHDK folder in my device but still it wont show CHDK logo.. I figured out where error is.. I will post it in next post. .am in office now.. once I get back home will post where am having an error.

my output for arm-elf-gcc -v

Using built-in specs.
Target: arm-elf
Configured with: ../gcc-4.4.0/configure --target=arm-elf --prefix=/home/Administ
rator/install --enable-multilib --enable-languages=c --enable-clocale=gnu --disa
ble-nls --disable-shared --disable-threads --disable-libssp --disable-libstdcxx-
pch --disable-libmudflap --disable-libgomp -v --with-gcc --with-gnu-as --with-gn
u-ld --with-newlib --with-gmp=/home/Administrator/addontools --with-mpfr=/home/A
dministrator/addontools
Thread model: single
gcc version 4.4.0 (GCC)
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: raid72 on 25 / November / 2010, 04:27:38
Hello to all,

I've been trying to get chdk work for a many days now, and I would need some help...

First of all, I'm not able to see the firmware version of my Ixus 200 IS, ver.req or vers.req
trick does'nt seem to work on my cam. exiftool says Firmware Revision : 1.01 rev 3.00

Automatic boot does'nt work eather. But I can run chdk by "firmware update".  It ask me if
I want to update from 1.0.1.0 -> 1.0.0.0. After that I see chdk splash screen for a few seconds
and the camera turns off. I have tried few versions of chdk that I found, and one version hangs
the whole camera.

Does someone know what I'm doing wrong? Should these beta versions buut up at all?


BR,  Raid
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: reyalp on 25 / November / 2010, 15:56:02
Hello to all,

I've been trying to get chdk work for a many days now, and I would need some help...

First of all, I'm not able to see the firmware version of my Ixus 200 IS, ver.req or vers.req
trick does'nt seem to work on my cam. exiftool says Firmware Revision : 1.01 rev 3.00
101c

Quote
Does someone know what I'm doing wrong? Should these beta versions buut up at all?
You will have to read the specific details posted about each build to determine what they are expected to do. Since your camera is 101c, you can limit yourself to the ones intended for that version.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: raid72 on 27 / November / 2010, 11:42:32
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: Awol on 10 / December / 2010, 23:07:05
If I buy a new camera, is it likely that it will come with the newest firmware? Or is it a 50/50 tossup?
I'm thinking about buying an SD980, but hoping I get the older supported firmware.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: titbb on 11 / December / 2010, 03:48:49
If I buy a new camera, is it likely that it will come with the newest firmware? Or is it a 50/50 tossup?
I'm thinking about buying an SD980, but hoping I get the older supported firmware.

Dont count on getting the old FW tbh.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 15 / December / 2010, 20:27:40
..Other thing to do at the moment, but still committed to make the firmware
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: Awol on 18 / December / 2010, 00:26:23
Thanks for the update! :)
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: Awol on 03 / January / 2011, 02:22:45
Just ordered one of these cameras.
Can't wait until it can run CHDK. :)
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: Awol on 14 / January / 2011, 21:48:03
Well, just got the camera in the mail, tested the firmware, and sure enough it's 1.01c.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 23 / March / 2011, 06:35:43
New Linaro 4.4 ARM based toolchain installed, still committed to make the firmware compile n work. It would be great to have more help, anyone else still commited?
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: Awol on 27 / March / 2011, 13:57:04
Good to hear this project is still going! Sorry I don't know enough about programming to help.
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: titbb on 05 / May / 2011, 08:40:36
New Linaro 4.4 ARM based toolchain installed, still committed to make the firmware compile n work. It would be great to have more help, anyone else still commited?

Guess not :(
Shame you cant downgrade a FW
Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: jamabushi on 06 / June / 2011, 20:29:18

Any news on progress lately?  I've seen 100+ euros plus at least $60 (including my match) offered in another thread to help get a 1.01C CHDK version ready.

What else is needed?  I'm one of the non-programmers (hence the offer of $), but would be happy to help any other way.

Seems like a lot of progress has been made so far already, no?

Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: waterwingz on 06 / June / 2011, 20:57:50
Any news on progress lately?
Currently working on the 1.01c firmware port.  

Posting thread moved here :  SD980 beta release (http://chdk.setepontos.com/index.php?topic=4335.new#new)

UPDATE : Current BETA release here :  IXUS200-SD980 Beta Release for Firmward 1.01c (http://www.box.net/shared/83zabfkxn7chld333o60\)

Title: Re: Ixus 200IS/SD980 1.01c porting thread
Post by: openuas on 17 / July / 2011, 19:16:01
UPDATE : Current IXUS200-SD980 Beta Release for Firmward 1.01c now on the autobulld server.   :D

http://mighty-hoernsche.de/ (http://mighty-hoernsche.de/)

(Search for IXUS200 in that page)

As always Beta's need testing and feedback. After Beta success this thread can be closed. Then let's all move again to the main thread found here  http://chdk.setepontos.com/index.php?topic=4335.new#new (http://chdk.setepontos.com/index.php?topic=4335.new#new)

THX to all involved  8)