max wrote:I've played with libgphoto a little bit, and I would definitely consider using it as a base for camera communication -- it has all the PTP stuff figured out.
It's fine for PTP stuff, but if any relevant debug functionality is available over USB then I guess it will not follow PTP to the letter, and libgphoto2 may not bring much. But let's see!
Once you can talk to the camera, we still don't know how to invoke a firmware transfer.
This is not neccessarily possible at all.
leegong wrote:If possible, combining the USB controlling with Step trace trap function of MCU might become an on-chip debugger, should do great help for hacking.
This sounds very interesting -- do you think that the required hardware hooks are in the USB interface to be able to do this?
"hardware hooks" is an extreme simplification of what is required for something like that to actually work.
leegong wrote:At least it is doable in theory.
Except that we assume that firmware also handles USB communication, and firmware can not simultaneously be traced/trapped at one place in the code while executing USB communication routines at another place.
Usually "soft debug" like this is not really common, and an external connection and dedicated hardware is neccessary to have full control over the processor. As I've mentioned, real FR debug hardware is neither simple nor cheap. The debug communication between the debug hardware and the processor may actually be simple, and then it could be possible to develop our own cheap hardware to do debugging, but we can't know without at least having some captures of the communication with the real debug hardware.
A "soft" RealOS debugger could theoretically be (made) part of the firmware, without any external hardware, but it would be limited in what it could do, especially if our assumption that firmware also handles USB communication holds true (I believe it does).
But, if anyone does find some USB request handlers in the firmware which are useful for debugging then I'm happy to quickly make some host software to exercise them.