EOS M3 porting

  • 478 Replies
  • 125345 Views
*

Offline srsa_4c

  • ******
  • 3601
Re: EOS M3 porting
« Reply #470 on: 29 / April / 2018, 15:09:13 »
Advertisements
I found that some names of exceptions(for example at 0x00E0A1D8) are similar to:
https://github.com/espressif/esp-idf/blob/master/components/esp32/include/xtensa/corebits.h
That was first noticed by reyalp - and that helped me discover the Xtensa graphic core. It turned out later that the strings belong to a different core's firmware.
Quote
There are strings containing "bitrate" at aria 0x00E00000. Maybe bitrate information can be taken from there?
Yeah, the strings are there, but I can't produce a disassembly, so they don't help much.

*

Offline Ant

  • ****
  • 360
Re: EOS M3 porting
« Reply #471 on: 07 / May / 2018, 16:55:24 »
I found interesting event procedure(FC431D74) on M3:
Quote
Usage: SubCPURebootRequest [NextBootReason] [RebootTime]
       [NextBootReason] 1:POWER 2:PLAY 4:MyDevice 8:NFC
                       16:LENS_DETECT 32:LENS_SW 64:BATTERY_COVER 128:MEDIA_COVER
       [RebootTime] after millisec reboot.  0==>(no wait)

It also present on EOS M5, M6, M10 cameras and can be used for reboot(automaticaly turning on the power after shutdown) and maybe for intervalometer

*

Offline srsa_4c

  • ******
  • 3601
Re: EOS M3 porting
« Reply #472 on: 08 / May / 2018, 14:17:51 »
I found interesting event procedure(FC431D74) on M3:
Quote
Usage: SubCPURebootRequest [NextBootReason] [RebootTime]
       [NextBootReason] 1:POWER 2:PLAY 4:MyDevice 8:NFC
                       16:LENS_DETECT 32:LENS_SW 64:BATTERY_COVER 128:MEDIA_COVER
       [RebootTime] after millisec reboot.  0==>(no wait)

It also present on EOS M5, M6, M10 cameras and can be used for reboot(automaticaly turning on the power after shutdown) and maybe for intervalometer
Another useful observation.

Tried SubCPURebootRequest on my M10 and found the following:
- the timer appears to activate when the camera is switched off (+ approx. 2 seconds, not sure why)
- therefore, executing SubCPURebootRequest(2, 10000) and leaving the camera on does nothing until the cam is powered down plus ~12 secs

This would be a nice addition for long running intervalometer scripts (as a script command). But, unfortunately, it would be limited to the supported EOS M models.
Side note: there are some old PowerShots with a subcpu, but this specific eventproc does not exist in their fw. It would require some reverse engineering to find similar functionality (used by built-in Canon intervalometer).

*

Offline srsa_4c

  • ******
  • 3601
Re: EOS M3 porting
« Reply #473 on: 08 / May / 2018, 14:25:57 »
To M3 users:

I have enabled movie mode support for both supported fw versions.
Since 120f is untested, that port might be broken starting at revision 5013. Please leave a note in this thread if that happened, so that we can fix it.

Important: maximum achievable video bitrate is approx. 41000 kbit/s.
« Last Edit: 08 / May / 2018, 16:00:27 by srsa_4c »


Re: EOS M3 porting
« Reply #474 on: 09 / May / 2018, 03:47:45 »
It also present on EOS M5, M6, M10 cameras and can be used for reboot(automaticaly turning on the power after shutdown) and maybe for intervalometer

Tried SubCPURebootRequest on my M10 and found the following:
- the timer appears to activate when the camera is switched off (+ approx. 2 seconds, not sure why)
- therefore, executing SubCPURebootRequest(2, 10000) and leaving the camera on does nothing until the cam is powered down plus ~12 secs

Interesting discovery ...

*

Offline srsa_4c

  • ******
  • 3601
Re: EOS M3 porting
« Reply #475 on: 13 / May / 2018, 11:21:25 »
I decided to make the above discussed automatic reboot available for scripting, as a Lua function (to be used directly in a script or included as module). Supports the M3 and M10 (all current ports).
Code: [Select]
--[[
Utility function providing scheduled camera start for use on EOS M3 and M10 cameras
Lua native calls are required.
]]

function power_down_for_seconds(delay)
    bi=get_buildinfo()
    cam_name=bi.platform
    cam_ver=bi.platsub
    func=0
    if cam_name=="m3" then
        if cam_ver=="101a" or cam_ver=="120f" then
            func=0xFC0F824F
        end
    elseif cam_name=="m10" then
        if cam_ver=="110d" or cam_ver=="110f" or cam_ver=="110g" then
            func=0xFC13207F
        end
    end
    if func~=0 then
        -- schedule power-on event, '2' is for playback mode
        call_func_ptr(func,2,delay*1000)
        -- power off immediately
        post_levent_for_npt("PressPowerButton")
    else
        -- returns false and does nothing on unsupported cameras
        return false
    end
    -- does not really return when successful
    return true
end
When power_down_for_seconds() is called, the camera switches off and then turns back on (in playback mode) after the specified number of seconds (plus 1...2 seconds).

Warning: the reboot event survives shorter power cuts (battery out for a few seconds). When the battery is removed for longer (and a reboot is scheduled), the cam switches quickly on/off after the battery is re-plugged.

edit:
Tested successfully with a 2 hour delay.

edit2:
To cancel a scheduled reboot, simply start the camera manually.
« Last Edit: 14 / May / 2018, 11:35:46 by srsa_4c »

Re: EOS M3 porting
« Reply #476 on: 14 / May / 2018, 05:17:11 »
When power_down_for_seconds() is called, the camera switches off and then turns back on (in playback mode) after the specified number of seconds (plus 1...2 seconds).

Does it works in record mode as well?

Tested successfully with a 2 hour delay.
Where is the limit? 32Bit value?

*

Offline srsa_4c

  • ******
  • 3601
Re: EOS M3 porting
« Reply #477 on: 14 / May / 2018, 11:33:55 »
Does it works in record mode as well?
The eventproc supports other operating modes, see the possible values in Ant's post. I chose playback mode, because changing to rec mode is a matter of issuing set_record().
Quote
Where is the limit? 32Bit value?
The firmware function takes a 32bit integer for its 'RebootTime' parameter. So, the maximum delay can - theoretically - be approx. 24 or 48 days. What I know is that the whole 32 bits are passed on to the subcpu. What happens inside the subcpu's firmware is unknown. To find out the real limit, one would have to test it. What I tried so far is 2 hours on my M10. The delay's accuracy is also unknown.


*

Offline Ant

  • ****
  • 360
Re: EOS M3 porting
« Reply #478 on: 14 / May / 2018, 11:53:28 »
What happens inside the subcpu's firmware is unknown.
You can dump and disassemble it using SubCPUMemoryDump procedure.
RENESAS R5F101CAA used as SubCPU on EOS M3.

 

Related Topics