IXUS 1100 HS ELPH 510 Porting Thread - page 7 - DryOS Development - CHDK Forum  

IXUS 1100 HS ELPH 510 Porting Thread

  • 89 Replies
  • 25447 Views
Re: IXUS 1100 HS ELPH 510 Porting Thread
« Reply #60 on: 21 / February / 2014, 22:34:18 »
Advertisements
I keep planning on posting the code I have but keep not getting to it, I'll try to get this up right now.  Been a busy week with work, and school etc.

~Phil

Re: IXUS 1100 HS ELPH 510 Porting Thread
« Reply #61 on: 21 / February / 2014, 22:39:09 »
Okay here's my sources taken from nafraf's and modded to fit in with my latest dissasembly stuff.

https://www.assembla.com/code/frenchiefilms-chdk/subversion/nodes/3/trunk

~Phil

Re: IXUS 1100 HS ELPH 510 Porting Thread
« Reply #62 on: 21 / February / 2014, 22:44:41 »
If you look in boot.c:

https://www.assembla.com/code/frenchiefilms-chdk/subversion/nodes/3/trunk/chdk/platform/ixus1100_elph510hs/sub/100b/boot.c

You'll see that I have some debug led code in there:

Code: [Select]
//** sub_FF0011B0_my @ 0xFF0011B0 - 0xFF001248, length=39  NOTE: HERE IS WHERE IT LAST WORKS
void __attribute__((naked,noinline)) sub_FF0011B0_my() {

    #define DEBUG_LED ((volatile int *)0xC0220138) // AF, green not found
    #define DELAY 500000

    // DEBUG: blink led

    int counter;

    while(1) {
    counter = DELAY; *DEBUG_LED = 0x46;  while (counter--) { asm("nop\n nop\n"); };
    counter = DELAY; *DEBUG_LED = 0x44;  while (counter--) { asm("nop\n nop\n"); };
    }

This is the last place it works, lines 200 plus, if i put that same block of code at the end of the block its in now, or the first of the next block, it never blinks.  I'm not sure what is failing,  Suggestions?

~Phil

*

Offline fe50

  • ******
  • 3131
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: IXUS 1100 HS ELPH 510 Porting Thread
« Reply #63 on: 22 / February / 2014, 04:58:02 »
Added the
  • IXUS 1100 / ELPH 510 1.00B
full 16MB dump by pompeiisneaks from this forum post to the CHDK P&S FW dumps repository.


*

Offline srsa_4c

  • ******
  • 4396
Re: IXUS 1100 HS ELPH 510 Porting Thread
« Reply #64 on: 22 / February / 2014, 07:58:57 »
Code: [Select]
//** sub_FF0011B0_my @ 0xFF0011B0 - 0xFF001248, length=39  NOTE: HERE IS WHERE IT LAST WORKS
void __attribute__((naked,noinline)) sub_FF0011B0_my() {

    #define DEBUG_LED ((volatile int *)0xC0220138) // AF, green not found
    #define DELAY 500000

    // DEBUG: blink led

    int counter;

    while(1) {
    counter = DELAY; *DEBUG_LED = 0x46;  while (counter--) { asm("nop\n nop\n"); };
    counter = DELAY; *DEBUG_LED = 0x44;  while (counter--) { asm("nop\n nop\n"); };
    }

This is the last place it works, lines 200 plus, if i put that same block of code at the end of the block its in now, or the first of the next block, it never blinks.  I'm not sure what is failing,  Suggestions?
Some notes:
The blinker routine you're using alters register values and can badly influence the surrounding code. You can surround it with
Code: [Select]
asm volatile ("STMFD   SP!, {R0-R12,LR}");
<your blinker code>
asm volatile ("LDMFD   SP!, {R0-R12,LR}");
and that will make it safer, although it may still be unpredictable what the compiler will make of it  :)
The code you're working with was originally generated by code_gen and is a bit optimized: subroutines often end with jumping back to ROM (those are the LDR PC, ... instructions), so you don't see how they really end.
Remove everything from stubs_entry_2.S and stubs_min.S that's just a copy from stubs_entry.S, place only overrides there.
The boot process should continue at sub_FF005F2C_my.

Re: IXUS 1100 HS ELPH 510 Porting Thread
« Reply #65 on: 22 / February / 2014, 11:35:52 »
Thanks, I'll give that a try.

~Phil

Re: IXUS 1100 HS ELPH 510 Porting Thread
« Reply #66 on: 17 / July / 2014, 01:59:37 »
Okay so this sucks, I tried the toolchain you mentioned even after my gcc compiled and failed and that one fails compiling too.  If I try either to do make rebuild-stubs it errors on either, with the 'happy' toolchain you pointed to, I get massive amounts of errors, ending like:

Code: [Select]
../../../../tools/finsig_dryos.c:4914: error: 't1' undeclared (first use in this function)
../../../../tools/finsig_dryos.c:4914: error: 'CLOCKS_PER_SEC' undeclared (first use in this function)
../../../../tools/finsig_dryos.c:4914: error: pointer value used where a floating point value was expected
make[1]: *** [../../../../tools/finsig_dryos] Error 1
make: *** [rebuild-stubs] Error 2

and it starts with:
Code: [Select]
rebuild stubs for ixus1100_elph510hs-100b
In file included from ../../../../tools/finsig_dryos.c:3:0:
/home/pdavis/lib/gcc/arm-elf/4.6.4/include/stdint.h:3:26: fatal error: stdint.h: No such file or directory
compilation terminated.
make[1]: *** [../../../../tools/finsig_dryos] Error 1
make: *** [rebuild-stubs] Error 2

Everything in the 'tools' directory has to be compiled as native applications for your workstation - not as ARM code for the camera. You are trying to use the arm-elf include files to build the tools - you need the native GCC include files.

Phil.

I ran into this problem myself.  If try try to run "make rebuild-stubs", I get tons of errors when make attempts to build finsig_dryos, and the errors do look like they are caused by using the arm-elf compilers.  If I run "make -d rebuild-stubs", I can see that make doesn't find a rule for finsig_dryos, so it makes one up.  That means it will use $(CC) rather than $(HOSTCC) to compile the program.  If I first cd into the tools directory and run 'make', then everything builds fine (and the make debug output shows that it finds the proper rule).  So, something about running from the top-level directory is messing with the make rules in tools/.   Any ideas?  I'm running in a 64-bit Linux OS (Slackware current), and working in trunk rev.3508.

*

Offline philmoz

  • *****
  • 3290
    • Photos
Re: IXUS 1100 HS ELPH 510 Porting Thread
« Reply #67 on: 17 / July / 2014, 04:30:01 »
I ran into this problem myself.  If try try to run "make rebuild-stubs", I get tons of errors when make attempts to build finsig_dryos, and the errors do look like they are caused by using the arm-elf compilers.  If I run "make -d rebuild-stubs", I can see that make doesn't find a rule for finsig_dryos, so it makes one up.  That means it will use $(CC) rather than $(HOSTCC) to compile the program.  If I first cd into the tools directory and run 'make', then everything builds fine (and the make debug output shows that it finds the proper rule).  So, something about running from the top-level directory is messing with the make rules in tools/.   Any ideas?  I'm running in a 64-bit Linux OS (Slackware current), and working in trunk rev.3508.

The command 'make rebuild-stubs' is not valid. You need to also specify the PLATFORM and PLATFORMSUB values.

The makefile needs better error checking.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)


Re: IXUS 1100 HS ELPH 510 Porting Thread
« Reply #68 on: 17 / July / 2014, 12:02:08 »
The command 'make rebuild-stubs' is not valid. You need to also specify the PLATFORM and PLATFORMSUB values.

The makefile needs better error checking.

I had those environmental variables set, and had them set in localbuildconf.inc, so I figured I was covered.  Anyway, here's what I get when I set them explicitly in the command line:

Code: [Select]
robpc4>make PLATFORM=ixus265_elph340hs PLATFORMSUB=100a rebuild-stubs
rebuild stubs for ixus265_elph340hs-100a
In file included from ../../../../tools/finsig_dryos.c:3:0:
/home/robk/arm-elf/build-dir-gcc452/arm/toolchain/bin/../lib/gcc/arm-elf/4.5.2/include/stdint.h:3:26: fatal error: stdint.h: No such file or directory
compilation terminated.
make[1]: *** [../../../../tools/finsig_dryos] Error 1
make: *** [rebuild-stubs] Error 2

which is the same problem as before.

If I go into the 'tools' directory and type make, the tools get built correctly.  Then running "make rebuild-stubs" in the top-level directory gets the stubs generated in the correct PLATFORM/PLATFORMSUB directory.  So, the problem is something else.

*

Offline philmoz

  • *****
  • 3290
    • Photos
Re: IXUS 1100 HS ELPH 510 Porting Thread
« Reply #69 on: 17 / July / 2014, 15:39:03 »
If I go into the 'tools' directory and type make, the tools get built correctly.  Then running "make rebuild-stubs" in the top-level directory gets the stubs generated in the correct PLATFORM/PLATFORMSUB directory.  So, the problem is something else.

Should be fixed in revision 3514 (trunk) and 3515 (release 1.2)

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

 

Related Topics