Testing some - perhaps many - cams with CHDKPTP - page 10 - General Discussion and Assistance - CHDK Forum

Testing some - perhaps many - cams with CHDKPTP

  • 122 Replies
  • 71077 Views
*

Offline koshy

  • *****
  • 1096
Re: Testing some - perhaps many - cams with CHDKPTP
« Reply #90 on: 11 / November / 2019, 12:58:02 »
Advertisements
Tested all A4xx
A410, the oldest shows trouble
This failed on 52 byte transfer like ixus30 and some other early VX cams, but unlike those, A410 has the usual native PTP buffer functions. Test build attached.
Tested it, looks as it did before to me.
Koshy had a little ELPH which wasn't white as snow but everywhere that Koshy went the ELPH was sure to go. (actually an SD, but that detail ruins the rhyme...)

*

Offline srsa_4c

  • ******
  • 4451
Re: Testing some - perhaps many - cams with CHDKPTP
« Reply #91 on: 11 / November / 2019, 13:28:13 »
It does differ from what we have on file. I loooked it up I dumped the FW of this very camera in 2014. That dump went into the general FW collection, what is there is identical in timestamp and file content to the dump I saved in my own FW dumps file structure. So you seem to be right. How does one restore this? Bit by bit?
There is only one bit of obvious difference, at offset 0x2439d3.
The following Canon Basic script should restore the original byte (0x2d -> 0x25).
Code: [Select]
private sub Initialize()
    adr = 0xFFE439D3
    SystemEventInit()
    buf = AllocateMemory(16)
    Poke8(buf, 0x25)
    byte = Peek8(adr)
    if byte = 0x2d then
        dangerous_eventproc(adr, buf, 1)
    end if
    FreeMemory(buf)
end sub
This could be turned into a CHDK script too, but anyway. I hope I've done everything right...
If the camera turns on after, dump the firmware again.

edit:
It's possible that something isn't done correctly, currently testing on an a410. It does not change the ROM.
edit2:
Solution below. If anyone needs to know what "dangerous_eventproc" is, you can ask in PM.
« Last Edit: 11 / November / 2019, 14:16:19 by srsa_4c »

*

Offline koshy

  • *****
  • 1096
Re: Testing some - perhaps many - cams with CHDKPTP
« Reply #92 on: 11 / November / 2019, 13:55:22 »
]There is only one bit of obvious difference, at offset 0x2439d3.
The following Canon Basic script should restore the original byte
How neat, even with a fail-safe check. Did it and guess what it works again. Wow... So that does happen... Only if powered off and on the shelf too long or even when used more frequently one wonders... Re-Dump enclosed. Thanks! I got a new camera  :xmas
Koshy had a little ELPH which wasn't white as snow but everywhere that Koshy went the ELPH was sure to go. (actually an SD, but that detail ruins the rhyme...)

*

Offline srsa_4c

  • ******
  • 4451
Re: Testing some - perhaps many - cams with CHDKPTP
« Reply #93 on: 11 / November / 2019, 14:13:37 »
How neat, even with a fail-safe check. Did it and guess what it works again. Wow... So that does happen... Only if powered off and on the shelf too long or even when used more frequently one wonders... Re-Dump enclosed. Thanks! I got a new camera  :xmas
You're welcome.
I now know why the script did not work for me: the Peek8 eventproc returns a 32-bit signed number. In my case, I checked for 0xff when I should have checked for -1. The values in your script were all positive, so that worked.


*

Offline reyalp

  • ******
  • 14080
Re: Testing some - perhaps many - cams with CHDKPTP
« Reply #94 on: 11 / November / 2019, 14:20:08 »
Tested it, looks as it did before to me.
Yep, still dying at 52 bytes. Weird, but at least it probably means there's not point trying to figure out what I messed up on the i30 test.

Can you run the following to check if standard PTP operations are affected?
Code: [Select]
!newfi2={ Filename="TEST.DAT", ObjectFormat=0xbf01, ObjectCompressedSize=52} return con:ptp_send_object_info(newfi2)
!return con:ptp_send_object(('x'):rep(newfi2.ObjectCompressedSize))
ls -l TEST.DAT
Don't forget what the H stands for.

*

Offline koshy

  • *****
  • 1096
Re: Testing some - perhaps many - cams with CHDKPTP
« Reply #95 on: 11 / November / 2019, 14:57:21 »
Can you run the following to check if standard PTP operations are affected?
Code: [Select]
!newfi2={ Filename="TEST.DAT", ObjectFormat=0xbf01, ObjectCompressedSize=52} return con:ptp_send_object_info(newfi2)
!return con:ptp_send_object(('x'):rep(newfi2.ObjectCompressedSize))
ls -l TEST.DAT
Yes I think so but the XP box seems to need an msys shell first... "Current MSYS2 can't be installed on Windows XP anymore." // "msys2-runtime 2.5.1 -- last version to support XP/2003"
Koshy had a little ELPH which wasn't white as snow but everywhere that Koshy went the ELPH was sure to go. (actually an SD, but that detail ruins the rhyme...)

*

Offline koshy

  • *****
  • 1096
Re: Testing some - perhaps many - cams with CHDKPTP
« Reply #96 on: 11 / November / 2019, 15:32:03 »
They don't name their releases after version numbers. Great. "pacman -Q" on the shell tells the version but not if it does not run... Eventually found that on the distrib archive the oldest entry, being msys2-i686-20150916.exe, uses "2.2.1". Good enough... now let's see...
Koshy had a little ELPH which wasn't white as snow but everywhere that Koshy went the ELPH was sure to go. (actually an SD, but that detail ruins the rhyme...)

*

Offline koshy

  • *****
  • 1096
Re: Testing some - perhaps many - cams with CHDKPTP
« Reply #97 on: 11 / November / 2019, 15:55:03 »
Can you run the following to check if standard PTP operations are affected?
Code: [Select]
!newfi2={ Filename="TEST.DAT", ObjectFormat=0xbf01, ObjectCompressedSize=52} return con:ptp_send_object_info(newfi2)
!return con:ptp_send_object(('x'):rep(newfi2.ObjectCompressedSize))
ls -l TEST.DAT
@reyalp I'm confused. What is this where do I use it?
With the "ls -l TEST.DAT" I thought it to be for a bash like shell - but no...
« Last Edit: 11 / November / 2019, 16:00:44 by koshy »
Koshy had a little ELPH which wasn't white as snow but everywhere that Koshy went the ELPH was sure to go. (actually an SD, but that detail ruins the rhyme...)


*

Offline reyalp

  • ******
  • 14080
Re: Testing some - perhaps many - cams with CHDKPTP
« Reply #98 on: 11 / November / 2019, 15:57:54 »
Can you run the following to check if standard PTP operations are affected?
Code: [Select]
!newfi2={ Filename="TEST.DAT", ObjectFormat=0xbf01, ObjectCompressedSize=52} return con:ptp_send_object_info(newfi2)
!return con:ptp_send_object(('x'):rep(newfi2.ObjectCompressedSize))
ls -l TEST.DAT
@reyalp I'm confused. What is this where do I use it?
With the "ls -l TEST.DAT" I thought it to be for a bash like shell - but no...
At the chdkptp prompt, after connecting

It just to check if the connection is hosed or not after the send_object
Don't forget what the H stands for.

*

Offline koshy

  • *****
  • 1096
Re: Testing some - perhaps many - cams with CHDKPTP
« Reply #99 on: 11 / November / 2019, 16:02:18 »
At the chdkptp prompt, after connecting
Thanks the "ls" threw me off, well now the XP has an msys2, so you can just say so and copy commands from your preferred environment...

Anyway, this comes out of that in CHDKPTP with A410:
Code: [Select]
> !newfi2={ Filename="TEST.DAT", ObjectFormat=0xbf01, ObjectCompressedSize=52} return con:ptp_send_object_info(newfi2)
=65537,0,6> !return con:ptp_send_object(('x'):rep(newfi2.ObjectCompressedSize))
> ls -l TEST.DAT480
ERROR: I/O error
>
Koshy had a little ELPH which wasn't white as snow but everywhere that Koshy went the ELPH was sure to go. (actually an SD, but that detail ruins the rhyme...)

 

Related Topics