Hi all! .. Long post.I have worked the last couple of days to get a overview of the Canon 40D port which is born with the DIGIC III processor. All models with this processor have more or less stalled so getting one model ported should make it much easier to complete the others. It's the first processor in the DIGIC series to have 14 bits support and with the Canon 40D's LiveView support, we have all the possibilities for a great ML upgrade - it's just here around the corner.
I hope more people with a canon 40d (or 450d, 1100d = all DIGIC III) will come help me creating a experimental release of ML for Canon 40d before Christmas, that would be cool (if not - its gonna be a easter release). I know it and old camera, but it still a pretty cool camera no matter if you use it as your primary or backup camera. And in these days with mercurial "sunsetting" (what a shitty word) on bitbucket we need some development to move the focus away from this.
Here is a short status:
Rom dumperLink:
https://www.magiclantern.fm/forum/index.php?topic=16534.0The rom dumper work fine, but is victim of a power save mode and thus after 1-2 seconds after executing the rom dumper the screen goes dark. The rom dumper works, and you will need to wait for a minute or two before removing the battery. The ROM files are in ML\LOGS folder. Only ROM1.BIN has code, you can decompile/analyse it in Ghidra, specs are here (click image to expand):
Useable source repositories:1.
https://bitbucket.org/jmheder/vxworks_canon40d/src/vxworks/ (vxworks branch)
2.
https://bitbucket.org/hudson/magic-lantern/src/vxworks/ (vxworks branch)
3.
https://bitbucket.org/hudson/magic-lantern/unified (unified changeset 8159)
1. My working branch, properbly the best starting point atm. This is based on 2. with a some modifications (stubs,debug, defines, temporary static rbf fonts )
2. main "vxworks branch", rufustfirefly rework of 3. will load, but no font are loaded (so no text)
3. The branch vnd used, old menu, but with static font, so text is shown, missing cache_lock() call.
CompilersCompilers from launchpad, which I have been
lightly tested are listed below. If you are on a Linux you will need
multiverse for executing the old compilers (they are x86 compiled).
(4.6.2) ok, gcc-arm-none-eabi-4_6-2012q4-20121016.tar.bz2
(4.7.3) ok, gcc-arm-none-eabi-4_7-2012q4-20121208-linux.tar.bz2
(4.7.4) ok, gcc-arm-none-eabi-4_7-2014q2-20140408-linux.tar.bz2
(4.9.3) ok, gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2
(5.4.1) ok, gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2
(6.3.1) ok, arm-none-eabi-gcc (15:6.3.1+svn253039-1build1) 6.3.1 20170620 - Ubnutu standard
(8.3.1) bad, ML crashes at boot. gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2
Bootloader / Flipper:It works, but the code is not ready for releasing yet. It's based on the 5DC, but it does not work consistenly everytime, but so far it has'nt kill my 40D, so the errors are not fatal. This is my priority no.1 to get done.
Status, what works* Basic bootloader works
* Booting magic lantern works
* GUI menu system works
* Totals Clicks (in debug menu)
* Temperature partial works (only shows raw temperature, but changeset 8159 (unified) shows celcius)
* Showing edmac channels (we have 16 channels)
* Showing vxworks threads
* Dumping log via call("dumpf") works see end of post for example (unified changeset 8159)
What does'nt work* FIO_* system does not work and will result in somekind of file system lock* Camera will not save images after capture (FIO issue), busy spinning icon appears, when powering off.* Fonts are not loaded (FIO_ issue)* Modules are not found/loaded (FIO_ issue)* Dumping rom and does not work (?)* Small fonts is incorrect scaled, totally unreadable * Power off will sometimes result in crash * Menu/GUI system LiveView button (set) not recognised, after liveview press PLAY before going into MLQEMU emulation (QEMU branch)I'm building on vxworks, but using QEMU branch to run it. On my mini server (intel atom) QEMU is rather unstable, only using vnc or no display will get it running
properly with a properbility of 50%. The emulator plays more nice that the real camera. I don't have the same problems with file system (FIO). I can dump
rom and call("dumpf") without problems my working branch.
Digic IIIThe Digic III processor uses same address space like all others, yet since this is a older Digic processor it might miss out on some features. CF address space is same. EDMAC address space is same (but only have 16 channels) FPS_REGISTER_A and FPS_REGISTER_B are same as all others. DMA0 the same .. ect. Mainboard comparison 40D/50D/5DMKII can be seen here - they are quite similar (click to expand image)
Medium/Larger tasks (random listed)* Create a proper bootloader ("You may now remove the battery") (my priority 1)
* Fix FIO_* vxworks issue, file system lock (my priority 2)*
Get modules / Digic Poke working
(FIO fix needed)* Find free eDMAc channels and enable edmac_memcpy (channel 7,14,15 is reported as "unused?" in debug menu)
* Investigate how many dma channels we have, I have seen DMA0 is ghidra, but not DMA1.* Investigate liveView
* Iso register investigation* Bulb mode investigation* ect ..
Small (random listed)* Verify that we have 16 edmac channels* Find Base Clock Mhz and compute default fps in liveView* Compute FPS_REGISTER_B default (computed, see code at 0xFFFFA050) FPS_REGISTER_A = 0A070A07h (defined at 0xFFFFA130)* Implement take_screenshot
(FIO fix needed)* Perform benchmark with slow and fast CF cards (bench.mo - FIO fix needed)
* Use Digit Poke to check for CF UDMA 3/4 support
-> CFA3.0 is supported (string is present in FW)
-> cfSetTiming does not touch UDMA registers
-> 1Ds Mk III (DIGIC III) supports UDMA mode 3 - 45 MB/S
-> new 2019 CF disks just uses CFA3.0 80 ns access (pio mode I guess) - see dumpf log below
* Test arkanoid for a couple of hours (long term test - FIO fixed needed)* Investigate dump log (startup + enabling liveview), maybe the experts can find some interessing stuff in there ?Canon 40d "dumpf" log from camera (Properly from source 3.). I started the camera and went into LiveView and then disabled LiveView again.
https://drive.google.com/file/d/10SMuQdFO1qWTv7p5qGRpd0wwj211At_6/view?usp=sharing/heder