Author Topic: ML on EOS-M2  (Read 50401 times)

platerytter

  • Just arrived
  • *
  • Posts: 2
Re: ML on EOS-M2
« Reply #200 on: December 14, 2017, 05:50:21 PM »
Just registered to say there's more people cheering for you guys! The m2 is a fantastic camera and deserves a little magic :)

dfort

  • Hero Member
  • *****
  • Posts: 2308
Re: ML on EOS-M2
« Reply #201 on: December 15, 2017, 08:35:17 PM »
Yes, it would be great to end the year with at least "Hello World" running on the M2 but that requires an ML-SETUP.FIR file and a1ex decides who's been naughty or nice enough to get that present.
5D3.* 7D.* 700D.115 EOSM.* EOSM2.103

vagaboundedu

  • New to the forum
  • *
  • Posts: 8
Re: ML on EOS-M2
« Reply #202 on: December 18, 2017, 04:24:37 AM »
 :)

dfort

  • Hero Member
  • *****
  • Posts: 2308
Re: ML on EOS-M2
« Reply #203 on: December 27, 2017, 10:03:32 PM »
Enabling the boot flag on the camera might be one small step but it feels like a giant leap.



First issue that came up was that the firmware signature that I got out of QEMU didn't match what I got running the code on the camera:

src/fw-signature
Code: [Select]
-#define SIG_EOSM2_103 0x17D200D6
+#define SIG_EOSM2_103 0x1f321405

Still to do--figure out the Trash button code so we can get to the ML menu. There's also some other obvious issues but hey, it's alive!

5D3.* 7D.* 700D.115 EOSM.* EOSM2.103

Lars Steenhoff

  • Senior
  • ****
  • Posts: 309
Re: ML on EOS-M2
« Reply #204 on: December 27, 2017, 10:14:26 PM »
Thats a great step!  congrats  :)

Kharak

  • Hero Member
  • *****
  • Posts: 722
Re: ML on EOS-M2
« Reply #205 on: December 27, 2017, 10:14:51 PM »
Yes, it would be great to end the year with at least "Hello World" running on the M2 but that requires an ML-SETUP.FIR file and a1ex decides who's been naughty or nice enough to get that present.

You've beev a good boy it seems :) Congrats!
once you go raw you never go back

dfort

  • Hero Member
  • *****
  • Posts: 2308
Re: ML on EOS-M2
« Reply #206 on: December 27, 2017, 11:00:07 PM »
Got a basic in-camera startup log. Still looking for that magic Trash button code.
5D3.* 7D.* 700D.115 EOSM.* EOSM2.103

chrissul13

  • Just arrived
  • *
  • Posts: 2
Re: ML on EOS-M2
« Reply #207 on: December 28, 2017, 05:21:22 PM »
This makes me SO happy.  I just got my EOS M2 which i bought without realizing ML did not work with it...and now it may!!! can't wait.  I'm mainly just wanting focus peaking as it is HARD to focus this camera manually

platerytter

  • Just arrived
  • *
  • Posts: 2
Re: ML on EOS-M2
« Reply #208 on: January 03, 2018, 09:27:50 AM »
Terrifc update dfort! Happy new years to you!

vagaboundedu

  • New to the forum
  • *
  • Posts: 8
Re: ML on EOS-M2
« Reply #209 on: January 13, 2018, 06:24:10 PM »
This is awesome! It made my day to see the pictures you posted!

I agree--the focus peaking will be very helpful, as will clean video output for recording productions.

dfort

  • Hero Member
  • *****
  • Posts: 2308
Re: ML on EOS-M2
« Reply #210 on: January 16, 2018, 01:15:23 AM »
@a1ex committed a change for the EOSM2 on the qemu branch so of course I tried it out. Wish I could say everything was rainbows and unicorns but--

Code: [Select]
./run_canon_fw.sh EOSM2 -s -S &
arm-none-eabi-gdb -x EOSM2/patches.gdb -ex quit

...
Breakpoint 1, 0xff0c5144 in ?? ()
Patching LeoLens (infinite loop)
[MPU] Received: 06 05 09 11 01 00  (PROP_LV_DISPSIZE - spell #22)
[MPU] Received: 12 11 09 15 00 00 00 00 00 00 00 00 00 00 00 00 00 00  (PROP 80050020 - spell #23)
[MPU] Received: 14 13 09 25 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  (unnamed - spell #24)
[MPU] Received: 06 05 01 5a 00 00  (PROP_CONTINUOUS_AF_VALID - spell #25)
[MPU] Sending : 06 05 01 59 01 00  (PROP_MOVIE_SERVO_AF)
[MPU] Received: 06 05 09 2f 01 00  (unnamed - spell #26)
[MPU] Received: 06 05 0e 22 1e 00  (unknown - unnamed)
    70:   121.344 [MR] mvrChangeAckCBR : Video - Mode=0, Type=2, Rate=30, GOP=15
    88:   125.440 [PROPAD] ERROR GetPropertyData ID (1) = 0x01050038
    89:    60.160 [PROPAD] ERROR GetPropertyData ID (1) = 0x01050041
    90:    60.160 [PROPAD] ERROR GetPropertyData ID (1) = 0x01050042
    91:    60.160 [PROPAD] ERROR GetPropertyData ID (1) = 0x01050043
    92:    60.160 [PROPAD] ERROR GetPropertyData ID (1) = 0x01050044
    93:    60.160 [PROPAD] ERROR GetPropertyData ID (1) = 0x0105004F
    94:    60.160 [PROPAD] ERROR GetPropertyData ID (1) = 0x01050050
    95:    60.160 [PROPAD] ERROR GetPropertyData ID (1) = 0x01050051
    96:    60.160 [PROPAD] ERROR GetPropertyData ID (1) = 0x01050052
    97:    60.160 [PROPAD] ERROR GetPropertyData ID (1) = 0x0105010E
    98:    60.160 [PROPAD] ERROR GetPropertyData ID (1) = 0x0105010F
    99:    60.160 [PROPAD] ERROR GetPropertyData ID (1) = 0x01050110
   100:    60.160 [PROPAD] ERROR GetPropertyData ID (1) = 0x01050111
   101:    60.160 [PROPAD] ERROR GetPropertyData ID (1) = 0x0104000B
   102:    60.160 [LVCOM] InitializeLiveViewDefectDetection
   103:    60.416 [LVCOM] ExecuteDefectMarge Start
   104:    60.416 [LVCOM] ExecuteDefectMarge End
   106:    61.184 [LV]  PROP_LV_BLOCK  PROP_LV_UNBLOCKING 0
   108:    62.208 [AUDIO] RegisterCBRSDIOCableConnect
   109:    64.256 [WFT] InitializeAdapterControl END
SD: Unknown CMD1
[SDIO] Error
SD: Unknown CMD1
[SDIO] Error
SD: Unknown CMD1
[SDIO] Error
   124:   151.808 [SD] ERROR SDINTREP=0x00000000
   125:   151.808 [SD] ERROR UNEXPECTED ERROR
   131:   113.152 [RSC] WARN ILLEGAL SUBFREECLUSTERCOUNT ShootStorage.c 686
   157:   184.832 [DISP] ERROR PROP_TFT_SETTING_PARAM DON'T FIND
   158:   184.832 [DISP] ERROR Factory Adjust For TftCom
   159:   185.088 [MR_MOV] (Empty Func) MVW_RegisterXmpDataCallback
   160:   142.336 [TCH]Touch IC Ver : 0x0000
   161:   569.600 [TCH]ERROR  TouchPanelIC Ack Error
   162:   569.856 WARN [I2C] localI2C_Read : 378 (Task : Startup)
   163:   570.112 WARN [I2C] localI2C_Read : 378 (Task : Startup)
   164:   570.112 WARN [I2C] localI2C_Read : 378 (Task : Startup)
   165:   570.112 WARN [I2C] localI2C_Read : 378 (Task : Startup)
   166:   570.368 WARN [I2C] localI2C_Read : 378 (Task : Startup)
   167:   570.368 WARN [I2C] localI2C_Read : 378 (Task : Startup)
   168:   570.368 WARN [I2C] localI2C_Read : 378 (Task : Startup)
   169:   570.624 WARN [I2C] localI2C_Read : 378 (Task : Startup)
   170:   570.624 WARN [I2C] localI2C_Read : 378 (Task : Startup)
   171:   572.672 [IMPP] H264E InitializeH264EncodeFor1080pDZoom
   172:   572.672 [IMPP] H264E InitializeH264EncodeFor1080p25fpsDZoom
   179:   578.816 [STARTUP] startupInitializeComplete
   185:   580.864 [CEC]CEC OFF

I usually use debugmsg.gdb instead of patches.gdb so I gave that a go but couldn't get Hello World to print, much less the firmware signature. Going back to my previous build it worked--sort of. As expected, it printed the wrong firmware signature.

There is some positive news to report. Although I still can't get to the ML menu on the camera or QEMU I hacked the ML/SETTINGS/MAGIC.CFG file to see if any of the features are working--say like focus peaking?

It works! Yay!

So what's the next step of this walk through? Seems like we need to find the code for the Trash button, which on this camera is also the down key or bottom of the thumb wheel. Maybe do a serial flash dump? I could probably get everything set up but how to trigger a module without access to the ML menu?
5D3.* 7D.* 700D.115 EOSM.* EOSM2.103

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10704
  • 5D Mark Free
Re: ML on EOS-M2
« Reply #211 on: January 16, 2018, 08:58:03 AM »
Hello World is working out of the box here, with latest sources from EOSM2.103_wip (both minimal and CONFIG_HELLO_WORLD, both debugmsg.gdb and patches.gdb), same firmware signature as on real hardware (does this make any more sense now?)

Didn't test on Mac though; I'll try later if it still doesn't work. Without loading ML, is the Canon menu still working? (GUI emulation is covered in the test suite, which runs for every few commits, or every non-trivial commit).

Next steps were covered before: new-dryos-task-hooks (done for 1300D, some stubs apparently wrong on M2), a tiny hack in menu.c to bring menu in QEMU (not needed for camera), and if there are any buttons not recognized, just print their codes.

For working with modules, this tutorial should help: http://www.magiclantern.fm/forum/index.php?topic=19232.0

dacampora

  • Just arrived
  • *
  • Posts: 1
Re: ML on EOS-M2
« Reply #212 on: January 17, 2018, 12:22:28 AM »
Hello.  First post but long time reader. Just here to vouch my support for the M2. Mostly interested in time lapse.

dfort

  • Hero Member
  • *****
  • Posts: 2308
Re: ML on EOS-M2
« Reply #213 on: January 17, 2018, 07:05:54 AM »
Got it working on Windows Subsystem for Linux (WSL) -- (Scream like a little girl!)



(does this make any more sense now?)

Yes it does. Anytime the ROM is patched the firmware signature changes. Is that the lesson here?

Didn't test on Mac though; I'll try later if it still doesn't work. Without loading ML, is the Canon menu still working?

Yeah, looks like there is a Mac issue, but only with patches.gdb. Running ML with debugmsg.gdb does show the firmware signature and it matches what I'm getting in camera. It was just that the commit you pointed out was on patches.gdb so I thought it was necessary to run it with patches.gdb.

One other observation - on Mac it pauses for user input while on WSL it doesn't:

Code: [Select]
---Type <return> to continue, or q <return> to quit---
I merged in the new-dryos-task-hooks a while back but maybe I screwed it up. I'll try it again and see if I can track down the bogus stubs.

..a tiny hack in menu.c to bring menu in QEMU (not needed for camera), and if there are any buttons not recognized, just print their codes.

A tiny hint on how to print out the button codes?
5D3.* 7D.* 700D.115 EOSM.* EOSM2.103

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10704
  • 5D Mark Free
Re: ML on EOS-M2
« Reply #214 on: January 17, 2018, 09:36:25 AM »
Quote
Yeah, looks like there is a Mac issue, but only with patches.gdb.

Reproduced on Mac. With just patches.gdb, it didn't work before that commit either...

However, running with patches.gdb and with -d debugmsg.gdb brings the GUI. Must be a timing issue, and the additional debug messages are slowing it down; in the end, that slowdown ends up helping. These timing issues are why many of the tests are still failing (nondeterministically; in many cases just giving slightly different screenshots, not what the test suite expects).

Reproduced on Linux with -icount 1 or 2 (this gives deterministic execution). Any other number between 3 and 10 is working.

BTW, debugmsg.gdb always includes patches.gdb, and adds additional debug messages.

Quote
One other observation - on Mac it pauses for user input while on WSL it doesn't:

I only get the prompt when the terminal window is too small. It doesn't interfere with the "-ex quit" added recently; that's good.

Quote
A tiny hint on how to print out the button codes?

Debug -> Show GUI events.

chrissul13

  • Just arrived
  • *
  • Posts: 2
Re: ML on EOS-M2
« Reply #215 on: Yesterday at 02:36:06 AM »
I'm not saying i'm squealing like a little girl, but....well, focus peaking would be awesome.  I'm getting to know the camera and that's like my only weakness with it. 

Goodluck, can't wait for more