Porting a camera sx530hs

  • 286 Replies
  • 55160 Views
Porting a camera sx530hs
« on: 15 / June / 2015, 20:41:01 »
Advertisements
Hello I am beginner here. I'm doing the port to sx530hs, and progressed a lot in it, but now I'm stuck trying to create the boot.c,
I will leave here the sources and the PRIMARY.BIN.

PRIMARY.BIN(https://drive.google.com/open?id=0B-QeCy-fO-ZYTDlDbzhvTC1fUHc&authuser=0)

I ask for help because I am unable to boot the camera. Can someone tell me what the minimum code to that.
« Last Edit: 16 / June / 2015, 13:28:31 by jeronymoGustavo »

*

Offline srsa_4c

  • ******
  • 3654
Re: Porting a camera sx530hs
« Reply #1 on: 16 / June / 2015, 15:30:17 »
Welcome,
Hello I am beginner here. I'm doing the port to sx530hs, and progressed a lot in it, but now I'm stuck trying to create the boot.c,
I will leave here the sources and the PRIMARY.BIN.

PRIMARY.BIN(https://drive.google.com/open?id=0B-QeCy-fO-ZYTDlDbzhvTC1fUHc&authuser=0)

I ask for help because I am unable to boot the camera. Can someone tell me what the minimum code to that.
that depends on what your goal is. You can jump back to the firmware at various points of the CHDK boot code. If you do that early, you get into a boot loop when using the diskboot.bin booting method.
Did you manage to blink/light up the LED?
Also, you did not post the modified files in the tools directory.

Re: Porting a camera sx530hs
« Reply #2 on: 17 / June / 2015, 07:14:31 »
Thanks for the answer.
Yes I can make LED blink. The code for this is in the file boot.c.
Put here attached the changed files within the tools folder.
I created the file myself boot.c. I did not use the "make run-code-gen" because it is generating an error. Then I realized I would have to change the code_gen.txt file so that the "make run-code-gen" stay well. but I did not do it yet.

code to blink led:

void debug_pisca_led(int n)
{
     volatile long *p = (void*)0xC022D1FC;

   int cnt=0, i=0;
   for(;cnt<n;cnt++)
   {
      *p = 0x93d800;
 
      for(i=0; i<0x100000; i++)
      {
         asm ("nop\n");
         asm ("nop\n");
      }
      *p = 0x83dc00;

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

*

Offline srsa_4c

  • ******
  • 3654
Re: Porting a camera sx530hs
« Reply #3 on: 17 / June / 2015, 19:24:18 »
Yes I can make LED blink.
How far do you get with the boot process (what is the last location that lets you blink the LED successfully)?

Which boot method are you using for your tests? Bootable card or "firmware update"?

There is another DIGIC 4+ port in progress, you can take a look at its code: https://github.com/adongy/ixus160_elph160/

Using code_gen is recommended, as it can make typos less likely and makes supporting additional fw versions much easier. You can start by generating boot.c only (and removing everything else from code_gen.txt). Startup routines usually don't need a lot of change.


*

Offline fe50

  • ******
  • 3088
  • IXUS50 & 860, SX10 Star WARs-Star RAWs
    • fe50
Re: Porting a camera sx530hs
« Reply #4 on: 21 / June / 2015, 02:57:17 »
Thanks for the dump  :)
Added the
  • SX 530 HS 1.00C
full 16MB dump by jeronymoGustavo from this forum post to the CHDK P&S FW dumps repository.

Re: Porting a camera sx530hs
« Reply #5 on: 29 / June / 2015, 08:13:59 »
Now this camera booting with CHDK. I need to know how to find the addresses below. Would anyone help me?
I saw posts about SX200, but I could not understand how.

#define KEYS_MASK0 (0x000FBD40) //Logic OR of group 0 Keymap values
#define KEYS_MASK1 (0x00000000) //Logic OR of group 1 Keymap values
#define KEYS_MASK2 (0x00000036) //Logic OR of group 2 Keymap values


*

Offline srsa_4c

  • ******
  • 3654
Re: Porting a camera sx530hs
« Reply #6 on: 29 / June / 2015, 19:51:28 »
These are not addresses. As the comments suggest, these masks need to include all bits that are used in keymap[] (see kbd.c).
Note that you'll likely need to identify most buttons as the sigfinder's guesses appear to be wrong for recent models.
Assuming you have a working display, uncomment this section in core/gui_osd.c:
Code: [Select]
        /*
        // debug keymap, KEYS_MASKx, SD_READONLY_FLAG, USB_MASK
        extern long physw_status[3];
        sprintf(osd_buf, "PS1: %#8x", physw_status[0]);
        draw_txt_string(DBGMISCVALS_X, DBGMISCVALS_Y+1, osd_buf, col);

        sprintf(osd_buf, "PS2: %#8x", physw_status[1]);
        draw_txt_string(DBGMISCVALS_X, DBGMISCVALS_Y+2, osd_buf, col);

        sprintf(osd_buf, "PS3: %#8x", physw_status[2]);
        draw_txt_string(DBGMISCVALS_X, DBGMISCVALS_Y+3, osd_buf, col);
        */
You can optimize the surrounding code a bit, but this should be enough to display the 3 words of physw_status[]. You will want to make this code unconditional, so replace
Code: [Select]
    if (conf.debug_misc_vals_show) {a few lines above with
Code: [Select]
    if(1) {:)

Press all camera buttons one-by-one (except those that are problematic, such as ON/OFF) and note which of the 3 words show a change (each button will influence one bit).
Note down all bits, then fill up keymap[] and the KEY_MASKs.

If you can't work something out, just ask.

Re: Porting a camera sx530hs
« Reply #7 on: 30 / June / 2015, 07:55:36 »
Thanks for the answer.
By doing this, I found the values. Now the buttons are working.
Now I have a problem using the CHDK the camera taking this very clear photos. Apparently the property (Shutterspeed) that fought in more than 1 second. I tried to set the property, but apparently she's locked.
Does anyone have idea about What's going on?


*

Offline srsa_4c

  • ******
  • 3654
Re: Porting a camera sx530hs
« Reply #8 on: 30 / June / 2015, 16:43:28 »
Now I have a problem using the CHDK the camera taking this very clear photos. Apparently the property (Shutterspeed) that fought in more than 1 second. I tried to set the property, but apparently she's locked.
I'm sorry but I can't understand this. Can you rephrase your words or illustrate the problem somehow?

Does anyone have idea about What's going on?
I'd suggest you to share the source code (upload it here / register on assembla / etc.).

Re: Porting a camera sx530hs
« Reply #9 on: 03 / July / 2015, 15:20:18 »
Now most of this done and working.I must also correct the live preview, as this very slow. anyone have any suggestions.
I am posting the trunk.
also could not do set_zom through the LUA scrips.

 

Related Topics