Right, the MMIO_TRACE experiment was meant to be run on the camera, in order to cross-check the MMIO values from emulation with those from actual hardware, and find out their meaning. However, I think I've figured it out by looking at what the firmware expects - there is one bit checked to make sure the sensor was powered on. If that bit is not right, the firmware prints "Image Power Failure"; after that, it will (on most models) or will not (on 500D and 5D2) proceed with image capture.
FA_CaptureTestImage is currently emulated well on the following models:
Testing FA_CaptureTestImage...
5D2: OK
5D3: OK
6D: OK
50D: OK
60D: OK
70D: OK
500D: OK
550D: OK
600D: OK
650D: OK
700D: OK
1100D: OK
1200D: OK
Also tested manually (outside the automated test suite) on 450D and 1300D. Reason: the minimal testing code is not portable enough.
EOS M and M2 are not working: apparently they fail to allocate a buffer for image capture. They also request a larger image size, compared to other 18 megapixel models. Figure out why.
EOS M2 is also a bit unique: it attempts to call some functions from the MPU first. It's also the only model that prints FA_CaptureTestImageForML.
100D and EOS M2 have something called ADTGDMA, that expects interrupt 0x37 on completion. By emulating that interrupt, FA_CaptureTestImage works on 100D, but it breaks the LiveView screenshots on EOS M2 (they look washed out after that change), so it's not committed yet.
700D and 650D were expecting some other EDMAC transfers to complete, besides the 14-bit raw data. No idea what sort of data they were expecting; I've just returned
zeros.
For 5D2,
this was the changeset that fixed the emulation. Unlike most other camera models, which simply checked whether the sensor is powered on (ImgPowDet) after enabling its power signal, 5D2 firmware also checked whether the sensor is off before enabling the power. So, other models could get away with a simpler emulation of the ImgPowDet register (just returning 1 was enough), while 5D2 locked up during these checks. The changeset is large because I wanted to emulate it properly on all other models, as this code also serves as documentation of what Canon hardware does, and it helped me understand
this topic a little better.
The above emulation covers only the raw image capture, without any postprocessing. It won't be able to create a CR2.