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

critix

  • Contributor
  • Member
  • *****
  • Posts: 160
Re: Canon EOS 1300D / Rebel T6
« Reply #300 on: January 28, 2019, 09:33:27 AM »
Okay ... a small step forward in working with logs ... but ... other problems ...
A1ex, can you help me?
Code: [Select]
[boot] copy_and_restart 0xc80000 (13107200)
[BOOT] changing init_task from 0xfe1296c8 (-32336184) to 0xc804b0 (13108400)
 [BOOT] autoexec.bin loaded at C80000 - CFCE40.
[BOOT] calling local pre_init_task C803E4...
[BOOT] changing AllocMem end address: D00000 -> C80000.
0xfe0c1b74:  e3a0160d      mov  r1, #13631488   ; 0xd00000
0xfe0c1b78:  e3a0082d      mov  r0, #2949120    ; 0x2d0000
0xfe0c1b74:  e3a018c8      mov  r1, #13107200   ; 0xc80000
0xfe0c1b78:  e3a0082d      mov  r0, #2949120    ; 0x2d0000
[BOOT] calling pre_init_task C80CA8...
[BOOT] installing task dispatch hook at 0x35924 (219428)
[BOOT] reserved 524288 bytes for ML (used 511552)
ICache: 8192b, idx=7e0 tag=fffff800 word=1c seg=c0000000
Jump range error: cf37a0 -> fe2993b8
Patch error at fe2993b4 (jump out of range)
Jump range error: cf37a0 -> fe10fa74
Patch error at fe10fa70 (jump out of range)
[BOOT] starting init_task 14B70C...
K404 READY
< Error Exception >
 TYPE : undefined
 ISR  : FALSE
 TASK ID   : 00020002
 TASK Name : init
 R 0  : 00000000
 R 1  : 00000001
 R 2  : fe123d6c
 R 3  : 00000001
 R 4  : 00031e44
 R 5  : 00000000
 R 6  : 00c804b0
 R 7  : 19980218
 R 8  : 19980218
 R 9  : 19980218
 R10  : 19980218
 R11  : 19980218
 R12  : 0014bb40
 R13  : 0014b6d8
 R14  : fe123c98
 PC   : fccc1a34
 CPSR : 80000093
[****] Starting task fe2bafd0(0) PowerMgr
Canon 1300D, 500D, EOS M, EOS M2

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Canon EOS 1300D / Rebel T6
« Reply #301 on: January 28, 2019, 12:56:47 PM »
I'll try, but the solution is not straightforward.

Previously covered in replies #120 and #239.

Edit: confirmed the dm-spy-experiments branch is not working, even with minimal logging options (dm_spy_extra* commented out).

Need to use a long jump for patching DebugMsg. It started to work - to some extent - with this:
Code: [Select]
        int err = patch_instruction(DebugMsg_addr, MEM(DebugMsg_addr), FAR_CALL_INSTR, "dm-spy: log all DebugMsg calls");
        err |= patch_instruction(DebugMsg_addr + 4, MEM(DebugMsg_addr + 4), &my_DebugMsg, "dm-spy: log all DebugMsg calls");

The semaphore error appears to come from beep() - somebody's calling that before beep_init. Disabled beeps, it went further.

When trying to save the log, it fails with:
Code: [Select]
[dm-spy] captured 128kB of messages
[NotifyBox] Pretty-printing... (128kB)
[     CtrlSrv:fe49c7fc ] (83:02) DlgShootOlc.c LOCAL_DIALOG_REFRESH
qemu: fatal: Trying to execute code outside RAM or ROM at 0x87274218

That was because I've patched two instructions from DebugMsg, to implement the long call, but when uninstalling the logging hook, I should have "unpatched" both instructions. Rookie mistake.

Now, the hard part - clean up the code and commit it :D

Still need to find a general solution for patching arbitrary functions in Canon code (i.e. to implement long jump support in the patch manager).

Leon51

  • Just arrived
  • *
  • Posts: 1
Re: Canon EOS 1300D / Rebel T6
« Reply #302 on: March 07, 2019, 11:51:01 AM »
Hi! When will compile “hello world” or memory benchmark to run on hardware?  :)
I have EOS 1300D and i’m very wait ML on this camera.

Rebel99

  • Just arrived
  • *
  • Posts: 1
Re: Canon EOS 1300D / Rebel T6
« Reply #303 on: March 07, 2019, 07:56:10 PM »
Hello i have a 1300d and i have watched this thread for 2 years
Theres unfortunatelly still no magic lantern available for my cam.
So i wanted to ask when it will be available.
And i am new here but do you think that i can help you. If yes how
Can i do it?
Thanks for your reply beforly

Walter Schulz

  • Contributor
  • Hero Member
  • *****
  • Posts: 7913
Re: Canon EOS 1300D / Rebel T6
« Reply #304 on: March 07, 2019, 09:11:52 PM »
So i wanted to ask when it will be available.

ML project has no schedule, no master plan, no release dates, no milestones. Therefore your question doesn't make sense.

And i am new here but do you think that i can help you. If yes how
Can i do it?

Begin with sticky tweet: https://twitter.com/autoexec_bin

critix

  • Contributor
  • Member
  • *****
  • Posts: 160
Re: Canon EOS 1300D / Rebel T6
« Reply #305 on: March 20, 2019, 12:07:48 PM »
I'll try, but the solution is not straightforward.
....
Now, the hard part - clean up the code and commit it :D

Still need to find a general solution for patching arbitrary functions in Canon code (i.e. to implement long jump support in the patch manager).
Alex, you have not succeeded to find solution for patching arbitrary functions?
It seems that without being able to solve this part, it can not go further with ML to 1300D, 2000D ...
Thanks
Canon 1300D, 500D, EOS M, EOS M2

three_legs

  • Just arrived
  • *
  • Posts: 1
Re: Canon EOS 1300D / Rebel T6
« Reply #306 on: March 22, 2019, 06:05:06 AM »
Just found out about this project. I'll see what I can do about the patcher. Any info on the CPU ?

calle2010

  • Contributor
  • New to the forum
  • *****
  • Posts: 47

cbbrowne

  • New to the forum
  • *
  • Posts: 6
Re: Canon EOS 1300D / Rebel T6
« Reply #308 on: April 08, 2019, 11:30:47 PM »
Hello i have a 1300d and i have watched this thread for 2 years
Theres unfortunatelly still no magic lantern available for my cam.
So i wanted to ask when it will be available.
And i am new here but do you think that i can help you. If yes how
Can i do it?
Thanks for your reply beforly

Well, given that the project takes place based on the efforts of volunteers, the straight answer is that ML/1300D will be available whenever it is ready, and not before.

There is certainly no schedule to be expected on the matter.

The recent discussions are showing that there are some peculiarities about the 1300D platform leading to confusing results.  It sure would be nice if some "silver bullet" falls out that solves problems for this as well as other cameras, but it isn't going to happen until it all gets figured out. 

alawiggle

  • New to the forum
  • *
  • Posts: 24
Re: Canon EOS 1300D / Rebel T6
« Reply #309 on: April 23, 2019, 07:53:02 PM »
I have qemu installed in Windows 10 WSL, Ubuntu - trying to run ./run_canon_fw.sh 1300D

without sudo it just says can't find ROM0.BIN

with sudo it says this:

Quote
DebugMsg=0xFE11F394 (from GDB script)
Lockdown read 1
Lockdown read 1
Lockdown read 0
Lockdown read 0
Lockdown read 2
Lockdown read 2
Lockdown read 3
Lockdown read 3
Lockdown read 4
Lockdown read 4
Lockdown read 5
Lockdown read 5
00000000 - 00000FFF: eos.tcm_code
40000000 - 40000FFF: eos.tcm_data
00001000 - 0FFFFFFF: eos.ram
40001000 - 4FFFFFFF: eos.ram_uncached
F0000000 - F1FFFFFF: eos.rom0
F2000000 - F3FFFFFF: eos.rom0_mirror
F4000000 - F5FFFFFF: eos.rom0_mirror
F6000000 - F7FFFFFF: eos.rom0_mirror
F8000000 - F9FFFFFF: eos.rom1
FA000000 - FBFFFFFF: eos.rom1_mirror
FC000000 - FDFFFFFF: eos.rom1_mirror
FE000000 - FFFFFFFF: eos.rom1_mirror
C0000000 - CFFFFFFF: eos.mmio
[EOS] loading './1300D/ROM0.BIN' to 0xF0000000-0xF1FFFFFF
[EOS] mirrored data; unique 0x4 bytes repeated 0x800000 times
qemu-system-arm: /home/test/qemu-eos/qemu-2.5.0/hw/arm/../eos/eos.c:407: check_rom_mirroring: Assertion `0' failed.
./run_canon_fw.sh: line 153:   988 Aborted                 (core dumped) env QEMU_EOS_DEBUGMSG="$QEMU_EOS_DEBUGMSG" $QEMU_PATH/arm-softmmu/qemu-system-arm -drive if=sd,format=raw,file=sd.img -drive if=ide,format=raw,file=cf.img -chardev socket,server,nowait,path=qemu.monitor$QEMU_JOB_ID,id=monsock -mon chardev=monsock,mode=readline -name $CAM -M $*

I'm not sure how to fix this. Any ideas?

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Canon EOS 1300D / Rebel T6
« Reply #310 on: April 24, 2019, 08:38:35 AM »
Very good catch; there's no ROM0 on 1300D. Why did I think otherwise?! [my old dump has some valid strings, apparently copied or shadowed from ROM1, that's why.]

Comment out rom0_size in model_list.c. Will fix ASAP.

Regarding sudo - check permissions of your ROM files. Maybe something happens when copying them from the card (or when they cross the Windows/Linux barrier). I've only tested WSL on virtual machines, without giving them access to a real SD card.

alawiggle

  • New to the forum
  • *
  • Posts: 24
Re: Canon EOS 1300D / Rebel T6
« Reply #311 on: April 24, 2019, 04:39:19 PM »
Very good catch; there's no ROM0 on 1300D. Why did I think otherwise?! [my old dump has some valid strings, apparently copied or shadowed from ROM1, that's why.]

Comment out rom0_size in model_list.c. Will fix ASAP.

Regarding sudo - check permissions of your ROM files. Maybe something happens when copying them from the card (or when they cross the Windows/Linux barrier). I've only tested WSL on virtual machines, without giving them access to a real SD card.

Okay, now I get this - does this seem correct for where I'm at?

Quote
./run_canon_fw.sh 1300D &

DebugMsg=0xFE11F394 (from GDB script)
Lockdown read 1
Lockdown read 1
Lockdown read 0
Lockdown read 0
Lockdown read 2
Lockdown read 2
Lockdown read 3
Lockdown read 3
Lockdown read 4
Lockdown read 4
Lockdown read 5
Lockdown read 5
00000000 - 00000FFF: eos.tcm_code
40000000 - 40000FFF: eos.tcm_data
00001000 - 0FFFFFFF: eos.ram
40001000 - 4FFFFFFF: eos.ram_uncached
F8000000 - F9FFFFFF: eos.rom1
FA000000 - FBFFFFFF: eos.rom1_mirror
FC000000 - FDFFFFFF: eos.rom1_mirror
FE000000 - FFFFFFFF: eos.rom1_mirror
C0000000 - CFFFFFFF: eos.mmio
[EOS] loading './1300D/ROM1.BIN' to 0xF8000000-0xF9FFFFFF
[MPU] warning: non-empty spell #11 (PROP_CARD2_STATUS) has duplicate(s): #52
[MPU] warning: non-empty spell #20 (PROP_TFT_STATUS) has duplicate(s): #37 #38 #75
[MPU] warning: non-empty spell #35 (PROP_VIDEO_MODE) has duplicate(s): #36
[MPU] warning: non-empty spell #43 (PROP_TFT_STATUS) has duplicate(s): #41 #42 #44 #46

[MPU] Available keys:
- Arrow keys   : Navigation
- [ and ]      : Main dial (top scrollwheel)
- SPACE        : SET
- DELETE       : guess (press only)
- M            : MENU (press only)
- P            : PLAY (press only)
- I            : INFO/DISP (press only)
- Q            : guess (press only)
- L            : LiveView (press only)
- A            : Av
- Z/X          : Zoom in/out
- Shift        : Half-shutter
- 0/9          : Mode dial (press only)
- V            : Movie mode (press only)
- B            : Open battery door
- C            : Open card door
- F10          : Power down switch
- F1           : show this help

gtk initialization failed
[MPU] WARNING: forced shutdown.

For clean shutdown, please use 'Machine -> Power Down'
(or 'system_powerdown' in QEMU monitor.)

critix

  • Contributor
  • Member
  • *****
  • Posts: 160
Re: Canon EOS 1300D / Rebel T6
« Reply #312 on: April 24, 2019, 04:54:26 PM »
You need Xming installed in windows and turned on.
https://sourceforge.net/projects/xming/
or
http://www.straightrunning.com/XmingNotes/
Then run again.
Canon 1300D, 500D, EOS M, EOS M2

alawiggle

  • New to the forum
  • *
  • Posts: 24
Re: Canon EOS 1300D / Rebel T6
« Reply #313 on: April 24, 2019, 06:42:26 PM »
You need Xming installed in windows and turned on.
https://sourceforge.net/projects/xming/
or
http://www.straightrunning.com/XmingNotes/
Then run again.

Nice thanks - I'm gonna reread the thread and try and catch up to where it currently is - or is this where it currently is?

alawiggle

  • New to the forum
  • *
  • Posts: 24
Re: Canon EOS 1300D / Rebel T6
« Reply #314 on: April 30, 2019, 02:19:40 AM »
What's the next move on this? I'm willing to do whatever on my T6 - I bought it specifically as a camera that I don't have to worry about (I already had the T6i). I got the GUI up and working in QEMU, wondering what to do next though.

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3751
Re: Canon EOS 1300D / Rebel T6
« Reply #315 on: April 30, 2019, 04:22:42 AM »
What's the next move on this?

This camera is stuck on trying to generate a startup log. Something to do with making "long jumps" in ARM code. Read replies #120, #230 and #297 to get a deeper understanding of the problem.

Seems like every camera has its own particular quirks. Read through the ML on EOS-M2 topic for some good tips. Note that we ran into several issues on that camera. At one point I was ready to give up but eventually we (well mostly a1ex) got it working on the camera.

Also note that we had some "long jump" issues recently on the 7D so you might want to check out how that one was solved on the 12-bit (and 10-bit) RAW video development discussion.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

alawiggle

  • New to the forum
  • *
  • Posts: 24
Re: Canon EOS 1300D / Rebel T6
« Reply #316 on: April 30, 2019, 08:14:11 AM »
This camera is stuck on trying to generate a startup log. Something to do with making "long jumps" in ARM code. Read replies #120, #230 and #297 to get a deeper understanding of the problem.

Seems like every camera has its own particular quirks. Read through the ML on EOS-M2 topic for some good tips. Note that we ran into several issues on that camera. At one point I was ready to give up but eventually we (well mostly a1ex) got it working on the camera.

Also note that we had some "long jump" issues recently on the 7D so you might want to check out how that one was solved on the 12-bit (and 10-bit) RAW video development discussion.

Mine can move through the menus, is that about right? I guess I'm trying to see how i get to that post someone had of hello world showing on the screen? or is that even relevant at the moment

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3751
Re: Canon EOS 1300D / Rebel T6
« Reply #317 on: April 30, 2019, 02:09:27 PM »
Yes, all that works--emulation in QEMU, Hello World. The problem is when trying to create a startup log using ML. Without being able to do that is it not possible to get some of the addresses needed to continue the port. Read through the EOSM2 discussion to see why that is so important. I'm currently away from home on a vacation and don't have time to re-read all of it and point out specific posts.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

alawiggle

  • New to the forum
  • *
  • Posts: 24
Re: Canon EOS 1300D / Rebel T6
« Reply #318 on: April 30, 2019, 04:29:18 PM »
Yes, all that works--emulation in QEMU, Hello World. The problem is when trying to create a startup log using ML. Without being able to do that is it not possible to get some of the addresses needed to continue the port. Read through the EOSM2 discussion to see why that is so important. I'm currently away from home on a vacation and don't have time to re-read all of it and point out specific posts.

How do I get hello world working? I've read this entire thread, but feel like I'm missing a step - it seems to hinge on using another branch to form off of? Or it hints at having magic lantern already installed?

Sorry, I really have read the guides - they seem to, understandably, focus on cameras where ML already works and I don't have another camera to see how it's "supposed" to work

critix

  • Contributor
  • Member
  • *****
  • Posts: 160
Re: Canon EOS 1300D / Rebel T6
« Reply #319 on: April 30, 2019, 05:13:46 PM »
For run "Hello Word" try this (of course, from qemu):
Hopefully done; I could finally compile the installer and other minimal examples!

Code: [Select]
cd minimal/hello-world
make MODEL=1300D clean
make MODEL=1300D install_qemu CONFIG_QEMU=y
Canon 1300D, 500D, EOS M, EOS M2

alawiggle

  • New to the forum
  • *
  • Posts: 24
Re: Canon EOS 1300D / Rebel T6
« Reply #320 on: April 30, 2019, 06:03:01 PM »
For run "Hello Word" try this (of course, from qemu):

I tried that, but I get this:

Quote
test@Nicolas:~/magic-lantern/minimal/hello-world$ make MODEL=1300D clean
../../platform/Makefile.platform.base:19: FW_VERSION for 1300D is not defined
../../platform/Makefile.platform.base:60: *** ROMBASEADDR is not defined.  Stop.
test@Nicolas:~/magic-lantern/minimal/hello-world$

I'm thinking I need to make a directory called 1300D.110 in platform, but unsure what should go into it.

critix

  • Contributor
  • Member
  • *****
  • Posts: 160
Re: Canon EOS 1300D / Rebel T6
« Reply #321 on: April 30, 2019, 06:11:12 PM »
Yes, create directory 1300D in minimal, and in this directory create file "Makefile" with this:
Code: [Select]
MODEL=1300D
include ../Makefile.minimal
Then run again.
Canon 1300D, 500D, EOS M, EOS M2

alawiggle

  • New to the forum
  • *
  • Posts: 24
Re: Canon EOS 1300D / Rebel T6
« Reply #322 on: April 30, 2019, 06:50:51 PM »
Yes, create directory 1300D in minimal, and in this directory create file "Makefile" with this:
Code: [Select]
MODEL=1300D
include ../Makefile.minimal
Then run again.

Same error - it doesn't have anything to do with Makefile.platform.base ?

Is there code I could just pull that has all this up to that point?

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3751
Re: Canon EOS 1300D / Rebel T6
« Reply #323 on: May 01, 2019, 02:23:17 PM »
@alawiggle - looks to me like you are not on the right branch. Make sure you are using the 1300D branch:

Code: [Select]
cd ~/magic-lantern
hg update 1300D
cd minimal/hello-world
make MODEL=1300D

Next copy the autoexec.bin from the onto the QEMU sd card. I'm on a Mac so I just double click qemu-eos/sd.img, drag in autoexec.bin into the root directory, eject the virtual card and run it.

Code: [Select]
cd ~/qemu-eos
./run_canon_fw.sh 1300D,firmware="boot=1" -d debugmsg

@critix - I've been meaning to getting around to merging your pull requests for the 1300D and 4000D but want to come up with a strategy. What do you think, make a new 4000D branch or a new digic4+ branch? Just adding the 4000D code into the 1300D branch would probably be confusing.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

critix

  • Contributor
  • Member
  • *****
  • Posts: 160
Re: Canon EOS 1300D / Rebel T6
« Reply #324 on: May 01, 2019, 02:46:16 PM »
I think it would be better to create a new digic4+ branch because the 1300D is not the only digic4+.
Canon 1300D, 500D, EOS M, EOS M2