supplierdeeply

SX410 IS porting thread

  • 81 Replies
  • 28573 Views
*

Offline blackhole

  • *****
  • 548
  • A590IS 101b
    • Planetary astrophotography
SX410 IS porting thread
« on: 19 / August / 2016, 13:17:37 »
Advertisements
A few days ago I bought this camera and I tried to make a port for it.
CHDK is properly loaded, the main overrides works well.
DNG is OK.
Video features are supported.
Zebra and histogram on the 'half-press' instantly crash the camera.
Attempting to display the color palette also cause crash the camera.

Scripts generally do not work.
Transfer files using chdkptp works without problems but 'Viewfinder' and 'UI overlay' cause the crash.

EDIT:Replaced link to the source code.

EDIT:The source code is added to the trunk.
« Last Edit: 20 / September / 2016, 19:18:13 by blackhole »

*

Offline srsa_4c

  • ******
  • 3583
Re: SX410 IS porting thread
« Reply #1 on: 19 / August / 2016, 15:08:09 »
A few days ago I bought this camera and I tried to make a port for it.
CHDK is properly loaded, the main overrides works well.DNG is OK.
Congrats (I think this is your first "from scratch" port?).
Quote
Zebra and histogram on the 'half-press' instantly crash the camera.
Attempting to display the color palette also cause crash the camera.
(...)
Transfer files using chdkptp works without problems but 'Viewfinder' and 'UI overlay' cause the crash.
All these symptoms suggest that there's something wrong with the bitmap overlay (and perhaps also the viewport related) code.
Either the dimensions are wrong, or one or more firmware pointer is wrong.

Note that nafraf's sx400 port (what you seem to have used as starting point) does have some unresolved problems, also viewport/overlay related.

Some romlogs may tell more about the crashes.

*

Offline blackhole

  • *****
  • 548
  • A590IS 101b
    • Planetary astrophotography
Re: SX410 IS porting thread
« Reply #2 on: 19 / August / 2016, 16:39:27 »
Quote
Congrats (I think this is your first "from scratch" port?).
Yes, this is first from scratch,thanks.
Quote
Some romlogs may tell more about the crashes.
Attached is romlog,crash by Zebra.

*

Offline srsa_4c

  • ******
  • 3583
Re: SX410 IS porting thread
« Reply #3 on: 19 / August / 2016, 20:22:28 »
Attached is romlog,crash by Zebra.
Exception 0x10, data abort in spytask. An invalid memory location was accessed (the content of the R2 register is suspicious, but hard to tell what was going on without knowing the surrounding code).

An advice: if you see any CHDK-related tasks in the romlog, it's usually a good idea to include the corresponding main.bin.dump file.
CHDK-related tasks are (these are not exact names):
- tasks that are hooked (physw, capt_seq, ...)
- spytask
- ptpsessiontask (in case of ptp-related crashes)


*

Offline blackhole

  • *****
  • 548
  • A590IS 101b
    • Planetary astrophotography
Re: SX410 IS porting thread
« Reply #4 on: 20 / August / 2016, 05:20:05 »
Quote
Exception 0x10, data abort in spytask. An invalid memory location was accessed (the content of the R2 register is suspicious, but hard to tell what was going on without knowing the surrounding code).

An advice: if you see any CHDK-related tasks in the romlog, it's usually a good idea to include the corresponding main.bin.dump file.
CHDK-related tasks are (these are not exact names):
- tasks that are hooked (physw, capt_seq, ...)
- spytask
- ptpsessiontask (in case of ptp-related crashes)
I found the cause of the problem to crash into Zebra and histogram.
'Viewport_buffers' address in stubs_min.s was completely wrong.
The histogram is now working well, the zebra is probably in the same problem as on the SX400, faulty display but without crashing.
Viewfinder in chdkptp now works well, but UI overlay still causes crash of the camera.
Attached is romlog and  main.bin.dump file (chdkptp UI overlay crash).
The source code in the first post is replaced with a new one.

*

Offline srsa_4c

  • ******
  • 3583
Re: SX410 IS porting thread
« Reply #5 on: 20 / August / 2016, 06:35:52 »
Viewfinder in chdkptp now works well, but UI overlay still causes crash of the camera.
Check vid_get_bitmap_active_palette(), it seems to return 0x3F000004 according to the romlog (that value seems to be looks like a palette entry).
« Last Edit: 20 / August / 2016, 06:45:05 by srsa_4c »

*

Offline blackhole

  • *****
  • 548
  • A590IS 101b
    • Planetary astrophotography
Re: SX410 IS porting thread
« Reply #6 on: 20 / August / 2016, 09:54:14 »
Quote
Check vid_get_bitmap_active_palette(), it seems to return 0x3F000004 according to the romlog (that value seems to be looks like a palette entry).
Yes, now works, thanks again.
Now the problem is ONLY the running of scripts. :D
The scripts seem like running, but nothing happens. Some test scripts seem to operate normally.

*

Offline srsa_4c

  • ******
  • 3583
Re: SX410 IS porting thread
« Reply #7 on: 21 / August / 2016, 11:06:21 »
The scripts seem like running, but nothing happens. Some test scripts seem to operate normally.
Can you give some more details?
Which scripts are working, which are not, what happens exactly when "nothing" happens (for example, do you need to kill the script with full press, etc)...

Do llibtst.lua and ubtest.bas work?



*

Offline blackhole

  • *****
  • 548
  • A590IS 101b
    • Planetary astrophotography
Re: SX410 IS porting thread
« Reply #8 on: 21 / August / 2016, 13:35:45 »
llibtst.lua and ubtest.bas work.
In the console of ubtest.bas scripts are three problems:halfshoot failed ,exp count or shot fail ,cam has iris failed 2.
The first strange thing is what in <ALT> mode, pressing to the 'half shutter' the camera make AF. Full shutter press first take a snapshot and then start the script.
Simple scripts as HDR.lua or Interval.lua  do not work properly.
Scripts are started, the console shows that everything is working normally, but none of the pictures was not taken.
KeyMap for 'KEY_SHOOT_FULL' and 'KEY_SHOOT_HALF ' is OK.
Other keys I could not check because the value of the PS1 and PS2 are constantly changing.

*

Offline srsa_4c

  • ******
  • 3583
Re: SX410 IS porting thread
« Reply #9 on: 21 / August / 2016, 15:30:12 »
llibtst.lua and ubtest.bas work.
In the console of ubtest.bas scripts are three problems:halfshoot failed ,exp count or shot fail ,cam has iris failed 2.
The first strange thing is what in <ALT> mode, pressing to the 'half shutter' the camera make AF. Full shutter press first take a snapshot and then start the script.
Simple scripts as HDR.lua or Interval.lua  do not work properly.
Scripts are started, the console shows that everything is working normally, but none of the pictures was not taken.
KeyMap for 'KEY_SHOOT_FULL' and 'KEY_SHOOT_HALF ' is OK.
Other keys I could not check because the value of the PS1 and PS2 are constantly changing.
I'm not sure if this is what's causing all your problems, but you need to correct the KEYS_MASKx constants in platform_kbd.h.
For KEYS_MASK0, OR all used keyboard bits in the first physw_status word:
    { 0, KEY_VIDEO           ,0x00000002 }, // Found @0xffbf9000, levent 0x02
    { 0, KEY_PLAYBACK        ,0x00000040 }, // Found @0xffbf9010, levent 0x101
    { 0, KEY_SET             ,0x00000100 }, // Found @0xffbf9018, levent 0x0a
    { 0, KEY_UP              ,0x00000200 }, // Found @0xffbf9020, levent 0x06
    { 0, KEY_RIGHT           ,0x00000400 }, // Found @0xffbf9028, levent 0x09
    { 0, KEY_DOWN            ,0x00000800 }, // Found @0xffbf9030, levent 0x07
    { 0, KEY_LEFT            ,0x00001000 }, // Found @0xffbf9038, levent 0x08
    { 0, KEY_MENU            ,0x00008000 }, // Found @0xffbf9050, levent 0x14
That's 0x00009f42.
Then repeat the procedure for KEYS_MASK2.


Looks like the masks are okay, so disregard what's written above.

Regardless, if ALT mode doesn't block certain buttons from the Canon UI, there's something wrong with the keyboard...

alvm reported keyboard related issues a while ago on recent PowerShots. If you're unlucky, you're experiencing the same.
« Last Edit: 21 / August / 2016, 15:36:42 by srsa_4c »

 

Related Topics