@LeptoN - was replying to Monet with the previous post, yours wasn't up at the time I started writing! Your skillset suggests you could help a lot, if you're patient!
6D2 is Digic 7, like 200D. That should mean you can run arbitrary code, including flashing LEDs and drawing to the screen. However, it doesn't run full ML yet. I'm (slowly) working on 200D, where I can build full ML, load it, and it crashes after some early init code. I think some problem to do with tasks, but so far I've been unable to diagnose it. For some crashes it will log stack traces to disk, but not this one.
The outline of what to do is this:
- make your cam bootable using special firmware update earlier in this thread
- get ML building (to test you have correct toolchain etc)
- dump firmware from your cam using digic6-dumper
- find required stubs and consts to get full ML building
- build, it will crash, diagnose why, fix, repeat (this is where I am on 200D)
To get started, I would recommend this branch, digic6-dumper, it's easier to build than ML:
https://bitbucket.org/hudson/magic-lantern/branch/digic6-dumperYou'll need to get that building - Linux is probably easiest but I know people can build on Mac and WSL as well. You need an arm toolchain, obviously. I build by cd'ing to platform/200D then "make zip". This will fail if you have python3 first in your path. If you think it's time for python2 to die, I can point you at the changes required for python3 to work. Otherwise, just make sure "python" means "python2" on your system.
You'll need to get booting enabled on your cam. This is a small, persistent change to firmware (a bit flip in flash, I think) that instructs the cam to
try and do a firmware upgrade if a .FIR file run code from an autoexec.bin file if found on the card. This is a one-off task, find the magic firmware for 6D2, somewhere earlier in this thread I expect. ML hijacks the firmware update process to inject into the running OS - but note that no persistent changes are made; there's no firmware update, it's just how code gets injected into ram.
Build digic6-dumper for your cam. See if it works. If so, congratulations! You can run arbitrary code on your cam! Now it gets harder. Digic6-dumper is very bare bones. I think Alex found a minimum set of stubs and consts (more on those later) to get it working on most Digic 6/7/8 cams, but there's not enough to succeed loading full ML.
In order to hook the right functions, ML needs to know the fixed addresses where they are in ram. ML calls these "stubs", they're in platform/XXX/stubs.S. There are some scripts that try to guess these from a similar firmware, but I don't know how well these work since we don't have a working >= Digic 6 cam to base it on. In any case, the scripts aren't perfect, so you'll want something like Ghidra or IDA Pro for finding the stubs for your cam from a firmware dump. Digic6-dumper should have dropped that on the card for you. You also want to find some consts, to put in consts.h. For both these tasks it helps enormously if you a firmware dump from another model where the stubs are known. The code is surprisingly similar between models.
After you have what you think is a good set of stubs and consts you can try and build full ML. If you can't find some, you can ignore them, probably, and see what works and what is broken. For some stuff it won't compile and you may have to fake stuff out, for other stuff you can use obviously bad values if it compiles, but you'll have to go back and fix it later. You will also want to set some #defines so that ML doesn't try and dangerous code - this is important! I can't remember the define right now but it stops ML attempting dangerous writes (they're fine if we understand a given model, but here we don't, so...).
Here's the line in internals.h that prevents some ways of breaking your cam. You want it commented out as shown:
/** Properties are persistent (saved in NVRAM) => a mistake can cause permanent damage. Undefine this for new ports. */
//#define CONFIG_PROP_REQUEST_CHANGE
My repo here is probably the furthest along, but it's far from working:
https://bitbucket.org/stephen-e/ml_200d/src/master/I've tried to #ifdef stuff in a way that it might work on all Digic 6/7/8 cams, but I only have a 200D to test on. You can probably get some use out of reading my stubs.S as I comment my reasoning on how I found them. Firmware between 6D2 and 200D may be similar.
Good luck, and do please let me know if you'd like help with any of those stages. I think I'm the only person working on a Digic 6/7/8 port at the moment. Ilia is considering starting on the 5Ds. It would be nice to have people to share problems with!