Author Topic: A1000IS porting...  (Read 41435 times)

Offline Qanthelas

  • Rookie
  • *
  • Posts: 31
Re: A1000IS porting...
« Reply #285 on: 04 / July / 2011, 07:00:30 »
In 100b stubs_entry_2.s,

NSTUB(Unmount_FileSystem,         0xFFC00940)
NSTUB(Mount_FileSystem,            0xFFC00940)
NHSTUB(UnsetZoomForMovie,         0xFFC00940)
NSTUB(rewinddir,               0xFFC00940)

is obviously incorrect and NSTUB should be NHSTUB.

I can only assume CHDK does not use those functions.
You need to set to a NULLSUB address.

Ah thanks, I see what is going on now.  I added in the items you mentioned to the 100a stubs_entry_2.S (and changed them to NHSTUB instead of NSTUB), tried to compile, and got this error:

========== C:\CHDK\DE\TRUNK\TRUNK695\BIN\LOGS\ERR-A1000-100A.TXT ==========

Time to generate stubs 7.21 seconds
../platform/a1000/sub/100a/libplatformsub.a(stubs_entry_2.o): In function `_qsort':
(.text+0xb0): undefined reference to `NULL_STUB'
collect2: ld returned 1 exit status
C:\CHDK\gcc451\bin\gmake.exe[1]: *** [main.elf] Error 1
gmake: *** [all-recursive] Error 1


The line in stubs_entry_2.S for qsort is basically the same for both the 100a and the 100b.

For the 100a:
NHSTUB(qsort, 0xffe2bbec)  

For the 100b:
NHSTUB(qsort,                       0xffe2bbec) //SDM

I don't see anything related to qsort and NULL_STUB - only the three items I just added (Unmount_FileSystem, Mount_FileSystem, and rewinddir) are NULL_STUB in stubs_entry_2.S for the 100a.  I gotta get going now but I'll poke at this later.  If any of you have an idea on what the problem might be please post :)

EDIT: I saw reyalp's post about FFC00940 being a null address so I changed "NULL_STUB" for "FFC00940" in my 100a stubs_entry_2.S file and now I get this error:

========== C:\CHDK\DE\TRUNK\TRUNK695\BIN\LOGS\ERR-A1000-100A.TXT ==========

Time to generate stubs 7.21 seconds
../platform/a1000/sub/100a/libplatformsub.a(stubs_entry_2.o): In function `_qsort':
(.text+0xb0): undefined reference to `FFC00940'
collect2: ld returned 1 exit status
C:\CHDK\gcc451\bin\gmake.exe[1]: *** [main.elf] Error 1
gmake: *** [all-recursive] Error 1



This leads me to think that it's one of the 3 NHSTUB entries that I just added for the 100a that is causing this to error out (even though it talks about '_qsort', presumably one of these 3 is called by qsort.)  In the past (on other small programming-ish tweaking projects) I've missed some little thing when copy/pasting (like a tab or a space) and that breaks the world.  I'm gonna fiddle with things a bit and see if perhaps the values are right I just copy/pasted them wrong.

ANOTHER EDIT: To see if I could isolate if it's just 1 of the 3 new lines I added that is breaking, I changed NHSTUB(rewinddir, FFC00940)   to NHSTUB(rewinddir, NULL_STUB)   and then I get this error on compiling:

========== C:\CHDK\DE\TRUNK\TRUNK695\BIN\LOGS\ERR-A1000-100A.TXT ==========

Time to generate stubs 7.21 seconds
../platform/a1000/sub/100a/libplatformsub.a(stubs_entry_2.o): In function `_qsort':
(.text+0xb0): undefined reference to `FFC00940'
../platform/a1000/sub/100a/libplatformsub.a(stubs_entry_2.o): In function `_qsort':
(.text+0xc4): undefined reference to `NULL_STUB'
collect2: ld returned 1 exit status
C:\CHDK\gcc451\bin\gmake.exe[1]: *** [main.elf] Error 1
gmake: *** [all-recursive] Error 1


So nuts, looks like either way it doesn't know what this null stub thing is :P

EDIT ONCE MORE, WITH FEELING: Derp! I just realized that I forgot the "0x" at the begging of "FFC00940" and also that the 100b version of stubs_entry_2.S that I was looking at had this line near the top "#define NULL_STUB 0xFFC00940".  After adding that define line to my 100a file and changing the 3 references to NULL_STUB, it compiled!
« Last Edit: 04 / July / 2011, 07:18:39 by Qanthelas »

Offline Qanthelas

  • Rookie
  • *
  • Posts: 31
Re: A1000IS porting...
« Reply #286 on: 04 / July / 2011, 07:25:37 »
I feel like I've edited that last post enough.  Now I am at a loss for what to do next.  I finally got the 100a CHDK version to compile so I loaded it up on a card, stuck it in my 100a camera, and it won't turn on.  Just out of curiosity, I then put it in my 100b camera and it does turn on.  (I took a picture and ran it through ACID.jar just to be sure that was indeed my 100b camera and indeed it is.)  So apparently I've missed something important, but I don't know what.  I'm attaching my whole a1000 folder to this post in a .zip - if you have any ideas, let me know :)  I've also attached the full compiled '100a' (which is apparently really a 100b) version .zip folder to this, too, just as a 'for what it is worth'.  (Note, I had the PRIMARY.BIN file for the 100a in the sub/100a folder but I took it out before I zipped this since the file would be to big to post on the forums otherwise.  On a sidenote, am I not supposed to have that PRIMARY.BIN file in there?  It looks like the trunk sub/100b folder just has an empty file called PRIMARY.BIN at 0KB.)
« Last Edit: 04 / July / 2011, 07:33:41 by Qanthelas »

Offline waterwingz

  • Guru Member
  • ******
  • Posts: 2028
Re: A1000IS porting...
« Reply #287 on: 04 / July / 2011, 09:24:29 »
I feel like I've edited that last post enough.  Now I am at a loss for what to do next.  I finally got the 100a CHDK version to compile so I loaded it up on a card, stuck it in my 100a camera, and it won't turn on.  Just out of curiosity, I then put it in my 100b camera and it does turn on.

It looks like just using the tasks .C files from the 100b for the 100a is not going to work.  Your earlier comment about :

Quote
100a:
line 78 "   LDR   R0, =0xFFEEAFD0 \n"       

100b:
line 77 "   LDR   R0, =0xFFEEAE90 \n"     

should have been a clue.  The files really need to be translated - CHDK-PT can help with that but it still a couple of hours work for someone who knows what they are doing.


Quote
  On a sidenote, am I not supposed to have that PRIMARY.BIN file in there?  It looks like the trunk sub/100b folder just has an empty file called PRIMARY.BIN at 0KB.)

This is normal - the 0KB version of the file prevents the signature finder from running each time a compile is done. The output of that step - the stubs_entry.S file should never change for a given primary.bin file and doing this results in  a considerable time savings when building the entire trunk of all cameras.  It also cuts the size of the source download as the 4M & 8M promary.bin files are not distributed.




Offline Qanthelas

  • Rookie
  • *
  • Posts: 31
Re: A1000IS porting...
« Reply #288 on: 04 / July / 2011, 09:44:01 »
It looks like just using the tasks .C files from the 100b for the 100a is not going to work. ... The files really need to be translated - CHDK-PT can help with that but it still a couple of hours work for someone who knows what they are doing.
Well nuts, figures it couldn't be quite as easy as I might have hoped ;)  I really am not sure what all is different between the two firmware versions so I think I'm just out of my league with this whole conversion thing.

This is normal - the 0KB version of the file prevents the signature finder from running each time a compile is done. The output of that step - the stubs_entry.S file should never change for a given primary.bin file and doing this results in  a considerable time savings when building the entire trunk of all cameras.  It also cuts the size of the source download as the 4M & 8M promary.bin files are not distributed.
Ah OK, that makes sense and it's good to know. It also explains why compiling my '100a version' (which is apparently really a 100b version) took longer than I thought it normally did to complete.

Offline waterwingz

  • Guru Member
  • ******
  • Posts: 2028
Re: A1000IS porting...
« Reply #289 on: 05 / July / 2011, 00:43:27 »
I feel like I've edited that last post enough.  Now I am at a loss for what to do next. 

@Qanthelas : here are two things you can try.

100a:
line 78 "   LDR   R0, =0xFFEEAFD0 \n"       

100b:
line 77 "   LDR   R0, =0xFFEEAE90 \n"     
These specify different start addresses for the data space.  It possible the 1.00b boot.c code will be alright for the 1.00a if you simply change the value on line 33 from 0xFFEEAE90 to 0xFFEEAFD0.

I went through the rest of the boot.c file and flagged anything that was different than what's in the 1.00a primary.bin file (other than the CHDK required mods). File attached - there were 10 things different between the 1.00b and 1.00a - marked //** different than 1.00b in the attached file.

See if that will compile and run ?





Offline Qanthelas

  • Rookie
  • *
  • Posts: 31
Re: A1000IS porting...
« Reply #290 on: 05 / July / 2011, 21:04:14 »
EDIT: Danke CHDKLover, this 100a version of CHDK is now in the German trunk - Changeset 697 Trac notes here. (I'm a somebody now, I'm thanked on a changeset note  :D ;)) On an amusing sidenote, since my timezone is several hours behind Germany, when I just went and built the 100a version with CHDK-Shell from the new German trunk (697) it gave me a bunch of errors in errors.txt about "[some file] has modification time in the future (1309911526 > 1309902833)".  We are traveling through time! :P  Still, the 100a version compiles and I just tested it out in my camera and it seems to work :)

...
These specify different start addresses for the data space.  It possible the 1.00b boot.c code will be alright for the 1.00a if you simply change the value on line 33 from 0xFFEEAE90 to 0xFFEEAFD0.

I went through the rest of the boot.c file and flagged anything that was different than what's in the 1.00a primary.bin file (other than the CHDK required mods). File attached - there were 10 things different between the 1.00b and 1.00a - marked //** different than 1.00b in the attached file.

See if that will compile and run ?


It works!!! Waterwingz, I hereby award you one free internet! I copied and replaced over the boot.c file in my sub/100a directory with the one you linked to your post, compiled it in CHDK-Shell, loaded the resulting files on to my SD card, plugged it in to my 100a, and for the first time ever the 100a turned on!  (Just out of curiosity, I then tried it on my 100b and it did not turn on.)

I did a little testing and it looks like things like Histogram and Zebra work (although I was getting a bit of lag on the screen or sometimes part of the screen would still show the orange lines of something like Edge even after I released the trigged but then once I did it again the orange lines would be repainted for the right spot.  On a related note, the menu text for both this 100a version and my 100b version will sometimes 'stick' so you have to toggle out of "ALT", hit the menu button, then hit the menu button again - basically make the camera 'redraw' the screen.)  I also tested out RAW and it seemed to work but I'm guessing the color matrix will need to be fixed (and, for that matter, probably needs some tweaking on the 100b.)  I honestly don't know that much about all that so I'll leave that to someone else :P  Anyways, I was able to create badpixel.bin, turn on DNG recording, and take a couple DNG pictures and then when I put the SD card back in my computer I was able to open those DNG files with UFRaw and they did indeed look like what I took a picture of.  I also tested a .jpg with ACID.jar to make sure this was indeed my 100a camera and indeed it was :D

On a sidenote, I noticed that CHDK-DE has a new release out (696) and it looks like it includes the tweaks to the a1000 100b platform_camera.h file (to fix the RAW width and height.)  I'm going to see if I can make a 696 version of 100a (currently I have a 696 version) and I'll edit this post with what I find out.

EDIT: Well I'll be...it works!  In the CHDK/DE/trunk696/platform/a1000/sub folder I copied 100b and renamed the copy 100a.  I then copied and replaced over the following files from my newly working trunk695's 100a folder:
stubs_entry.S
stubs_auto.S
boot.c (Note that this is the one from waterwingz's post)
stubs_entry_2.S
stubs_min.S
capt_seq.c
lib.c
PRIMARY.BIN


Note, I don't think all of these would have been actually required but I just went and copied over anything with a "Date modified" from the last few days (which is while I've been working on the 100a port.)  I also had to copy Makefile from CHDK/DE/trunk/trunk695 and paste it to /trunk696 (in order to get CHDK-Shell to notice that I had a 100a sub folder in there.)  I then fired up CHDK-Shell and compiled it.  As with the 695 version, when it finishes the "100 A" area by the checkbox by A1000 goes yellow (instead of green) and an error pops up that reads:

========== C:\CHDK\DE\TRUNK\TRUNK696\BIN\LOGS\ERR-A1000-100A.TXT ==========

Time to generate stubs 7.21 seconds



Not sure why this is, but it does compile the .zip files and they seem to work :)  I loaded up my SD card with the contents of a1000-100a-1.1.0-r696-full.zip (then deleted the CHDK/LANG/german.lng file so that it'd be in English), put it in my 100a camera, and it started up :)  I tested Histogram and Zebra and they seemed to work fine.  I then created badpixel.bin (through the Raw options menu), turned on DNG recording, and took a couple DNG pictures.  I then put my SD card back in my computer and those DNG files open in UFRaw and do indeed look like what I took a picture of.  I also ran one of the .jpg files through ACID.jar to make sure that was my 100a camera and indeed it was :)

So, now we seem to have a fairly functional 100b and 100a build for the a1000IS :D  This is the point that I was trying to get to (well, and then an SDM build for the 100a) so as far as I'm concerned this is a good release, but I am willing to help people test and whatnot to fix a few little remaining issues (for example, I think the OSD counters for pictures remaining and whatnot are not accurate - the numbers never seem to decrease.)

I have attached my CHDK-DE trunk696 a1000 folder (in a .zip and without PRIMARY.BIN) to this post and I've also attached the compiled a1000-100a-1.1.0-r696-full.zip.
« Last Edit: 06 / July / 2011, 03:06:51 by Qanthelas »

Offline Qanthelas

  • Rookie
  • *
  • Posts: 31
Re: A1000IS porting...
« Reply #291 on: 05 / July / 2011, 23:33:46 »
I realized after I had put the two .zip files in my last post that you also need a modified Makefile (for the trunk696 folder) in order to get CHDK-Shell to recognize the 100a stuff.  I've attached my modified Makefile to this post.  (Note that makefile.inc should probably also be tweaked, but I didn't find any mention of the a1000 in the CHDK-DE 695 makefile.inc - perhaps this is why I get an 'error log' that isn't really an error log when I compile the 100a?)

Out of curiousity, how hard is it to go from the German trunk to the English trunk?  I would kinda like to see the a1000 become part of the English trunk (with both the 100a and 100b sub folders.)  I'm guessing this would require tweaking a few files (like kbd.c, which was recently cleaned up in the German version by the way.)  If someone could get around to that I'd appreciate it :)

Also, I want to thank some people for their help :) Thanks to CHDKLover for watching this forum thread and updating the German trunk with the changes.  Thanks to reyalp for being a huge help on IRC.  Thanks to waterwingz for making some tweaks and coming up with ideas here on the forums and on IRC.  Thanks to philmoz for some key info to get this up and working.  Thanks to Microfunguy for help getting the German autobuild alpha version of the 100b to actually boot up on my camera (and, hopefully, some help in getting a 100a SDM version! :D)  I don't think they are around much to read this any more, but I also want to say thanks to diablo for starting this project and bolalex and the rest of the Russia team who worked on this for patching some things.  I am not sure who all helped CHDKLover with the German version, but thanks to all of them, too!

I also want to say thanks to anybody reading this and everyone who has posted over these last 20 pages - it has taken a while (mainly due to some long gaps in development) but I think we have a working version of CHDK for the A1000IS - both 100a and 100b!  Now with luck we can get some more bug squashing and feature implementing so this can finally be a 'full' release and not just a 'beta' release :D

Offline waterwingz

  • Guru Member
  • ******
  • Posts: 2028
Re: A1000IS porting...
« Reply #292 on: 06 / July / 2011, 04:52:01 »
Out of curiousity, how hard is it to go from the German trunk to the English trunk?  I would kinda like to see the a1000 become part of the English trunk (with bothTthe 100a and 100b sub folders.)  I'm guessing this would require tweaking a few files (like kbd.c, which was recently cleaned up in the German version by the way.)  If someone could get around to that I'd appreciate it :)

Takes a few tweaks.  Also your source zip files is missing the loader files for the A1000.

Offline Qanthelas

  • Rookie
  • *
  • Posts: 31
Re: A1000IS porting...
« Reply #293 on: 06 / July / 2011, 05:05:22 »
Takes a few tweaks.  Also your source zip files is missing the loader files for the A1000.

I made this using the German trunk and it already contains the loader/a1000 folder.  (The one a few posts up is from the platform folder, by the way.)  I have attached it as a .zip to this post just in case, but yeah, this is all part of the German trunk now :D
« Last Edit: 06 / July / 2011, 05:06:54 by Qanthelas »

CHDK Forum

Re: A1000IS porting...
« Reply #293 on: 06 / July / 2011, 05:05:22 »

Offline Qanthelas

  • Rookie
  • *
  • Posts: 31
Re: A1000IS porting...
« Reply #294 on: 14 / July / 2011, 00:12:41 »
Over 175 e-mails and 45 tests later, Microfunguy and I finally seem to have figured out why SDM for 100a was crashing on turning the camera back on after taking a DNG.  Apparently it has to do with SDM trying to open a file that the camera itself hasn't closed all the way or something like that.  In any case, I have attached a working 100a SDM to this post.

Offline Microfunguy

  • Developers
  • Guru Member
  • ****
  • Posts: 3027
    • StereoData Maker
Re: A1000IS porting...
« Reply #295 on: 14 / July / 2011, 00:42:21 »
Taking a DNG, was a red herring.
Any menu change that caused a CFG file to be created caused a crash on rebooting if the default script file could not be found on the previous boot.
That resulted in the current script name in the CFG file being set to "" (null).
Maybe that speeded-up the boot sequence loading such that a file handle used by the Canon firmware had not been closed but was inadvertantly being allocated to the cfg or other file.

This is with SDM, I don't know if CHDK boot has the same problem, it is a timing issue.

For SDM, philmoz's boot fix simply and easily cures the problem.

In the case of CHDK, if necessary, you add the following to platform_camera.h :-

 #define CAM_STARTUP_CRASH_FILE_OPEN_FIX   1


Maybe this also applies to the A3000.

For 100a and 100b, the firmware addresses for 'Open' and 'open' are correct.



David
« Last Edit: 14 / July / 2011, 00:48:52 by Microfunguy »

Offline jmartis

  • Newbie
  • *
  • Posts: 4
Re: A1000IS porting...
« Reply #296 on: 11 / August / 2011, 15:10:33 »
Hello,
sorry for a dumb question. I have an A1000 camera with 1.00b firmware. I tried loading the r695 version of CHDK, I formatted the SD card and extracted the archive onto it, turn camera on in the playback mode but the Firm Update menu option is missing. I then tried loading other versions of the firmware, went through all menus but the option is not there. Thanks for your help.

Offline fe50

  • Guru Member
  • ******
  • Posts: 2608
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: A1000IS porting...
« Reply #297 on: 12 / August / 2011, 10:21:56 »
I tried loading the r695 version of CHDK, I formatted the SD card and extracted the archive onto it, turn camera on in the playback mode but the Firm Update menu option is missing.

The "Firm. Update" menu item is only visible when there's a file "PS.FI2" stored in the card's root folder.

If the CHDK download you want to test doesn't include this ps.fi2 file (e.g. diskboot.bin only),
you can start CHDK with a CHDK-bootable, locked SD card
--> http://chdk.wikia.com/wiki/Bootable_SD_card

I suggest to load the latest CHDKDE complete package
(rev. 745, from here: http://forum.chdk-treff.de/download.php - select the "Komplett" option).
Expand all files to your card's root folder, start in playback mode...

To change the CHDK language from german to english, just delete the file \CHDK\LANG\german.lng on your SD card.

Note:  using a Mac, read http://chdk.wikia.com/wiki/FAQ/Mac and especially http://chdk.wikia.com/wiki/FAQ/Mac#Still_Having_Trouble.3F

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal