Author Topic: Canon EOS 1300D / Rebel T6  (Read 19104 times)

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10180
  • 5D Mark Free
Re: Canon EOS 1300D / Rebel T6
« Reply #75 on: June 06, 2017, 05:29:55 PM »
I have some progress on 1300D emulation (will publish soon), but still no GUI. We might have to get the MPU conversation from a real camera for that (and the path of least resistance requires booting ML first).

Probably the best way to proceed would be to try a minimal hello world first (to validate the startup process), and then do the same with regular ML.

Feel free to merge the qemu branch in your 1300D fork, as it has some useful tools for debugging the boot process, and I'd like to include it in the mainline soon. For example, you can now simply call qprint/qprintn/qprintf whenever you want to print something to emulator console (example and results). These calls are only compiled with CONFIG_QEMU=y, so regular builds will not include these messages. The first two are available very early in the boot process; the third requires Canon's vsnprinf, which appears to require some initialization.

Also take look at other recent ports (EOS M2, 1200D, 100D, 70D) for a general idea.

Makky

  • Just arrived
  • *
  • Posts: 1
Re: Canon EOS 1300D / Rebel T6
« Reply #76 on: June 24, 2017, 03:55:13 PM »
Hi, I've just purchased my first canon(1300D) and found this forum. Thanks for all the work you are all doing, I have not much in the way of skills to help only do a bit of programing in c+ for arduino. But happy to help if I can. I don't know if this is possible but it would be great to be able to activate the wifi tethering to windows/laptop which is blocked.
Cheers
Makky

cbbrowne

  • Just arrived
  • *
  • Posts: 1
Re: Canon EOS 1300D / Rebel T6
« Reply #77 on: June 29, 2017, 09:12:14 PM »
Hi, I've just purchased my first canon(1300D) and found this forum. Thanks for all the work you are all doing, I have not much in the way of skills to help only do a bit of programing in c+ for arduino. But happy to help if I can. I don't know if this is possible but it would be great to be able to activate the wifi tethering to windows/laptop which is blocked.
Cheers
Makky

I'm in a similar boat; I bought a T6/1300D a few months ago, and noticed that efforts are ongoing to get MagicLantern working on it.

I have some C experience, so shouldn't be completely helpless, but I'm not at all sure what is useful to try to do.  Perhaps the best to say is "watching with interest".

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10180
  • 5D Mark Free
Re: Canon EOS 1300D / Rebel T6
« Reply #78 on: July 13, 2017, 10:39:11 PM »
Minor progress with emulation:

- SD also works in main firmware, not just bootloader
- found the HDMI status GPIO (but didn't help much, other than cleaning the debug messages)
- patched JPCORE to avoid an assertion

Here's how I've found what to patch for the assert:

Code: [Select]
b *0x3CBC
assert_log

Code: [Select]
./run_canon_fw.sh 1300D,firmware="boot=0" -d callstack -s -S & arm-none-eabi-gdb -x 1300D/debugmsg.gdb
...
Current stack: [158398-157398] sp=158238                                         at [ShootCapture:3cbc:3320]
0xFE2BE514(796b3c &"StageClass", fe2be514, 19980218, 19980218)                   at [ShootCapture:41fc:158388] (pc:sp)
 0xFE0CAAC4(796a70 &"ShootCapture", 0, 0, 0)                                     at [ShootCapture:fe2be570:158360] (pc:sp)
  0xFE2BE970(796ab8 &"StateObject", 796a70 &"ShootCapture", 0, 0)                at [ShootCapture:fe0caaf0:158348] (pc:sp)
   0xFE2BE9A8(796ab8 &"StateObject", 796a70 &"ShootCapture", 0, 0)               at [ShootCapture:fe2be9a0:158338] (pc:sp)
    0xFE12DB28(796a70 &"ShootCapture", 0, 0, fe12db28)                           at [ShootCapture:fe2bea28:158318] (pc:sp)
     0xFE3ABD84(4fb1c080, 80000, 1, 25335c)                                      at [ShootCapture:fe12db84:1582f0] (pc:sp)
      0xFE539194(0, 142240, 141dfc, 31170)                                       at [ShootCapture:fe3abdf0:1582a8] (pc:sp)
       0xFE2A0164(40797480, 4079bd60, 792e34, 25)                                at [ShootCapture:fe5391b4:158290] (pc:sp)
        0xFE2A16C8(0, 80000013, 4f550, 40000000)                                 at [ShootCapture:fe2a01e4:158280] (pc:sp)
         0xFE2A0088(7, 142240, 141dfc, 31170)                                    at [ShootCapture:fe2a16ec:158270] (pc:sp)
          0xFE4244FC(fe2a02c0 "JPEGICError", 0, 141dfc, 31170)                   at [ShootCapture:fe2a00d4:158260] (pc:sp)
           0x3270(0, 0, 141dfc, 31170)                                           at [ShootCapture:fe424510:158250] (pc:sp)
            0x3CBC(3340, 332c "SystemIF::KerSem.c", 13a, 31170)                  at [ShootCapture:331c:158238] (pc:sp)
[ShootCapture:0000331c ] [ASSERT] 0 at SystemIF::KerSem.c:314, 3320

Code: [Select]
# patch JPCORE (assert)
set *(int*)0xFE4244FC = 0xe12fff1e

With this, the emulation moved forward, but still no GUI.

What's missing:
Code: [Select]
[     Startup:fe0d4054 ] (00:03) [SEQ] NotifyComplete (Cur = 1, 0x20000002, Flag = 0x20000000)
[    PowerMgr:fe0d4054 ] (00:03) [SEQ] NotifyComplete (Cur = 1, 0x2, Flag = 0x2)
[     FileMgr:fe0d4054 ] (00:03) [SEQ] NotifyComplete (Cur = 2, 0x10, Flag = 0x10)
[     Startup:fe0d4054 ] (00:03) [SEQ] NotifyComplete (Cur = 3, 0xe0110, Flag = 0x40000)
[     Startup:fe0d4054 ] (00:03) [SEQ] NotifyComplete (Cur = 3, 0xa0110, Flag = 0x80000)
[     Startup:fe0d4054 ] (00:03) [SEQ] NotifyComplete (Cur = 3, 0x20110, Flag = 0x100)
[     FileMgr:fe0d4054 ] (00:03) [SEQ] NotifyComplete (Cur = 3, 0x20010, Flag = 0x10)

Notice the pattern? The startup code expects a bunch of things to complete, but it doesn't really care about their order. There are a bunch of binary flags that get cleared whenever some component finishes its initialization. When all these flags are reset, the startup code moves on to the next stage. Therefore, to push the emulation even further (and hopefully get the GUI), one needs to:

1) find out who calls NotifyComplete(Flag = 0x20000) - easy
2) understand why it doesn't get called - hard
3) adjust the emulation so it gets called - easy after solving 2.

The above is not required for porting ML; you already have everything you need to print Hello World. It just makes things a bit easier.

prvashisht

  • Just arrived
  • *
  • Posts: 1
Re: Canon EOS 1300D / Rebel T6
« Reply #79 on: July 17, 2017, 05:06:50 PM »
Just stumbled upon this link. I have a 1300D myself and wanted to thank you guys for all the efforts being put into the ML build for 1300D. I have had some coding experience too in C/C++/Java/JavaScript etc. Let me know if I can help in any way.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10180
  • 5D Mark Free
Re: Canon EOS 1300D / Rebel T6
« Reply #80 on: July 18, 2017, 12:09:07 AM »
Let me know if I can help in any way.

Of course. However, I'm afraid you'll have to... well... read the previous posts.

In particular, go to http://builds.magiclantern.fm/ and scroll to "Your camera is not listed?"

If you are waiting for me to port ML, it might not be the best choice. I'm providing tools, walkthroughs, tutorials, advice and so on, other community members did their part (in particular, this tutorial is very helpful), but it's up to somebody who owns the camera to go through all this and complete the port.

I expect this to be one of the easiest cameras for porting ML (it's DIGIC 4, but has some things borrowed from both D5 and D6). 1200D and EOSM2 are marginally easier, but that's just because the emulator is able to display the GUI.

adamnock

  • New to the forum
  • *
  • Posts: 33
Re: Canon EOS 1300D / Rebel T6
« Reply #81 on: July 19, 2017, 09:24:13 AM »
Ive put off coming back for too long (honestly I got quite lost but im still going to try and muddle my way through this).

a1ex / kennetrunner

Was there a branch of the project which included the QEMU hacks and currently identified stubs I can check out and work from?
I think I understand the project topology well enough now to compile a hello world test and run it on metal.


a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10180
  • 5D Mark Free
Re: Canon EOS 1300D / Rebel T6
« Reply #82 on: July 19, 2017, 12:08:12 PM »

adamnock

  • New to the forum
  • *
  • Posts: 33
Re: Canon EOS 1300D / Rebel T6
« Reply #83 on: July 19, 2017, 02:29:02 PM »
Yeah I checked out that branch earlier.
Realised id not backed up my ROM copies so ill redo that shortly.

Hoping some of kennetrunners stubs progress might have been recorded in one of the build branches, but no matter, still needs doing.

@anyone else. Dont expect rapid progress here. Im going to have to properly learn this stuff as I go, im no reverse engineering genius :)

anandhusajan

  • Just arrived
  • *
  • Posts: 1
  • CANON 1300D
Re: Canon EOS 1300D / Rebel T6
« Reply #84 on: July 23, 2017, 11:45:25 PM »
How to edit or extract firmware of canon 1300D  .FIR File format?

Is there any tool available?

Walter Schulz

  • Hero Member
  • *****
  • Posts: 5643
Re: Canon EOS 1300D / Rebel T6
« Reply #85 on: July 25, 2017, 05:14:33 AM »
Top of page -> Downloads -> Download Nightly Builds -> Scroll down to "ROM dumpers"