Author Topic: Getting started with development  (Read 123019 times)

philmoz

  • New to the forum
  • *
  • Posts: 24
Re: Getting started with development
« Reply #75 on: August 12, 2014, 09:53:13 PM »
yes phil, I right click on virtual box and select "run as administrator" any other hints?

Could be anti-virus conflict - see https://forums.virtualbox.org/viewtopic.php?f=6&t=62615

Phil.

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3565
  • Blunt and to the point
Re: Getting started with development
« Reply #76 on: August 13, 2014, 12:42:30 AM »
Try deleting the snapshot.  The box will maintain previous configuration.

sacda1

  • Just arrived
  • *
  • Posts: 1
Re: Getting started with development
« Reply #77 on: November 23, 2014, 05:24:08 PM »
Hi. I'm watching ML for a year or so now. Two weeks ago I installed ML on my 5D3 and am thrilled by the features. Today I wanted to use the dottune but found it doesn't work in the latest nightly build from August.
Luckily I do software development for a living and I would like to contribute to ML. I downloaded the VirtualBox VM, updated the sources via 'hg clone...' and could compile the 'all' target. But as soon as I try to compile a specific target I get errors.
Is there any help on how to proceed?
And most important: Is there a platform for 5D3 1.2.3? I can only find 1.1.3.

Thanks
5D3 1.2.3 w/ ML, 6D no ML

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Getting started with development
« Reply #78 on: November 23, 2014, 06:21:11 PM »
5D3 1.2.3 is in a separate branch. What is the error you are getting?

mkrjf

  • Freshman
  • **
  • Posts: 53
Re: Getting started with development / MAC
« Reply #79 on: February 13, 2015, 09:07:06 PM »
Is it possible to build on MAC for 5dmk3 raw code base?
I have asked previously but response has only been PM from others who have tried but not succeeded.
Thx yet again for ML
Mike

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Getting started with development
« Reply #80 on: February 13, 2015, 10:15:58 PM »
Yes, it is possible.

Gerhard34

  • New to the forum
  • *
  • Posts: 4
  • 550D/t2i
Getting started with development
« Reply #81 on: March 09, 2015, 10:29:10 PM »
This is the first time I try to compile my own ML code - so pls. be patient with me!

I followed the guideline in post #1 step by step; the GCC is version 4.9.3.

When the make clean && make was finished I replaced the old autoexec.bin on the SD card with the new one and tried to reboot my 550D.
>:( without success -  the LED was permanent ON; power off didn't work, so I had to remove the battery.

any suggestion what went wrong??? here is the compilation log
Code: [Select]
gerhard@T60:~/ML/platform/550D.109$ make clean && make
[ RM ]  *.o *.d autoexec autoexec.bin magiclantern magiclantern.bin
[ RM ]  550D_109.sym magiclantern.sym
[ RM ]  magiclantern.bin autoexec autoexec.map location.map
[ RM ]  autoexec-fir autoexec-fir.bin
[ RM ]  magiclantern.lds
[ RM ]  dietlibc.a newlib-libc.a newlib-libm.a gcc-libgcc.a
[ RM ]  version.c version.bin
[ RM dir ]  zip
[ RM ]  *.zip
[ VERSION  ]   ../../platform/550D.109/version.bin
Abbruch: Es gibt hier kein Mercurial-Archiv (.hg nicht gefunden)
[ CPP      ]   magiclantern.lds
[ AS       ]   entry.o
[ AS       ]   ../../platform/550D.109/stubs.o
[ VERSION  ]   ../../platform/550D.109/version.c
Abbruch: Es gibt hier kein Mercurial-Archiv (.hg nicht gefunden)
[ CC       ]   version.o
[ CC       ]   boot-hack.o
[ CC       ]   fio-ml.o
[ CC       ]   mem.o
[ CC       ]   ico.o
[ CC       ]   edmac.o
[ CC       ]   menu.o
[ CC       ]   debug.o
[ CC       ]   rand.o
[ CC       ]   posix.o
[ CC       ]   util.o
[ CC       ]   imath.o
[ CC       ]   electronic_level.o
[ CC       ]   cfn.o
[ CC       ]   gui.o
[ CC       ]   picstyle-noauto.o
[ CC       ]   exmem.o
[ CC       ]   bmp.o
[ CC       ]   rbf_font.o
[ CC       ]   config.o
[ CC       ]   stdio.o
[ CC       ]   bitrate.o
[ CC       ]   lcdsensor.o
[ CC       ]   tweaks.o
[ CC       ]   tweaks-eyefi.o
[ CC       ]   lens.o
[ CC       ]   property.o
[ CC       ]   propvalues.o
[ CC       ]   gui-common.o
[ CC       ]   chdk-gui_draw.o
[ CC       ]   movtweaks.o
[ CC       ]   menuhelp.o
[ CC       ]   menuindex.o
[ CC       ]   af_patterns.o
[ CC       ]   focus.o
[ CC       ]   notify_box.o
[ CC       ]   bootflags.o
[ CC       ]   dialog_test.o
[ CC       ]   vram.o
[ CC       ]   greenscreen.o
[ CC       ]   fps-engio.o
../../src/fps-engio.c:298:12: warning: 'fps_timer_b_method' defined but not used [-Wunused-variable]
 static int fps_timer_b_method = 0;
            ^
[ CC       ]   shoot.o
[ CC       ]   hdr.o
[ CC       ]   lv-img-engio.o
[ CC       ]   state-object.o
[ CC       ]   tasks.o
[ CC       ]   vsync-lite.o
[ CC       ]   tskmon.o
[ CC       ]   battery.o
[ CC       ]   imgconv.o
[ CC       ]   histogram.o
[ CC       ]   falsecolor.o
[ CC       ]   audio-ak.o
[ CC       ]   zebra.o
[ CC       ]   vectorscope.o
[ CC       ]   beep.o
[ CC       ]   crop-mode-hack.o
[ CC       ]   ph_info_disp.o
[ CC       ]   flexinfo.o
[ CC       ]   screenshot.o
[ CC       ]   fileprefix.o
[ CC       ]   lvinfo.o
[ CC       ]   builtin-enforcing.o
[ CC       ]   ml-cbr.o
[ CC       ]   raw.o
../../src/raw.c: In function 'raw_update_params_work':
../../src/raw.c:532:10: warning: #warning FIXME: are these values correct for 720p and crop modes? [-Wcpp]
         #warning FIXME: are these values correct for 720p and crop modes?
          ^
[ CC       ]   chdk-dng.o
[ CC       ]   edmac-memcpy.o
[ CC       ]   console.o
[ CC       ]   tcc-glue.o
make -C ../../tcc
make[1]: Verzeichnis »/home/gerhard/ML/tcc« wird betreten
make[1]: Für das Ziel »all« ist nichts zu tun.
make[1]: Verzeichnis »/home/gerhard/ML/tcc« wird verlassen
[ CC       ]   module.o
[ CC       ]   liveview.o
[ CC       ]   reloc.o
../../src/reloc.c: In function 'reloc':
../../src/reloc.c:203:22: warning: unused variable 'reg_dest' [-Wunused-variable]
             uint32_t reg_dest    = (instr >> 12) & 0xF;
                      ^
[ AR       ]   strrchr.o
[ AR       ]   dietlibc.a
[ AR       ]   lib_a-setjmp.o
[ AR       ]   newlib-libc.a
[ CP       ]   newlib-libm.a
[ CP       ]   gcc-libgcc.a
[ LD       ]   magiclantern
[ OBJCOPY  ]   magiclantern.bin
[ STAT     ]   magiclantern.bin
magiclantern.bin: 481036 bytes
[ CC       ]   reboot.o
[ LD       ]   autoexec

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  EXIDX          0x075804 0x00cd5804 0x00cd5804 0x00008 0x00008 R   0x4
  LOAD           0x000100 0x00c60100 0x00c60100 0x7570c 0x894d4 RWE 0x100
[ OBJCOPY  ]   autoexec.bin
[ STAT     ]   autoexec.bin
autoexec.bin: 481648 bytes
[ SYMBOLS  ]   magiclantern.sym
[ CP       ]   550D_109.sym
gerhard@T60:~/ML/platform/550D.109$
550D/t2i - nightly builds

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: Getting started with development
« Reply #82 on: March 10, 2015, 12:05:48 AM »
You need to update the .sym file in the modules folder too, it's best to either run 'make zip', or insert your card in the computer and run 'make install'. You can manually update everything, but it's a pita.

Gerhard34

  • New to the forum
  • *
  • Posts: 4
  • 550D/t2i
Getting started with development
« Reply #83 on: March 10, 2015, 01:16:38 AM »
Thank you dmilligan, for your help!

I did run 'make zip' ==> deleted the ML folder and autoexec.bin from the SD card ==> extracted the zip file to the SD card ==> boot the 550D ==> same problem.

here is the zip file and the build.log: https://www.dropbox.com/sh/k5m67ao87l0ds5o/AABYHC4YbWf4R7iSi7sPuxZea?dl=0
550D/t2i - nightly builds

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3565
  • Blunt and to the point
Re: Getting started with development
« Reply #84 on: March 10, 2015, 08:59:30 AM »
All of your modules are failing to build.

Just to be clear, the ML built nightly works fine?

Gerhard34

  • New to the forum
  • *
  • Posts: 4
  • 550D/t2i
Getting started with development
« Reply #85 on: March 11, 2015, 12:33:05 AM »
I assumed that the modules are not mandatory as long as they are not loaded - so I ignored the errors.
There is probably something wrong with my toolchain; may be the different version of gcc (4.9.3)?

So I switched from my Ubuntu Laptop to my Mac and decided to try the 'pre-build VM': It worked out of the box :D 

I could build the latest code and it ran perfect on my 550D. Now I'm trying to enable 'dm-spy' to see some log messages.


Thank you for your support!! 
550D/t2i - nightly builds

SztupY

  • Contributor
  • New to the forum
  • *****
  • Posts: 10
  • S2P
Re: Getting started with development
« Reply #86 on: June 16, 2015, 12:24:04 AM »
Had the same issue with GCC 4.9.3 (autoexec.bin builds fine, but cannot deploy to camera: LED will remain flashing, and you need to remove the battery). Reverted back to GCC 4.8.4 and the build works fine

gph

  • New to the forum
  • *
  • Posts: 4
Re: Getting started with development
« Reply #87 on: November 26, 2015, 10:31:31 PM »
I am having the same issue as others encountered in the above threads. Magic Lantern is built OK. But when desployed into my 5D camera, it fails that I even cannot bring up the default menu and have to take out the battery.

I will try to comment some code out and see if I can find the problem.

My question is, is there a way to debug this? Such as, is there a debug connection, such as a serial port, available? So I can output some debug information to see where it fails? How do you guys do the debugging?
5D (Classic)

Walter Schulz

  • Contributor
  • Hero Member
  • *****
  • Posts: 6794
Re: Getting started with development
« Reply #88 on: November 26, 2015, 10:37:32 PM »
If you're on OS X: Have you tried dfort's setup instruction?
Photogs and videographers: Assist in proof reading upcoming in-camera help!. Your input is wanted and needed!

nikfreak

  • Developer
  • Hero Member
  • *****
  • Posts: 1133
Re: Getting started with development
« Reply #89 on: November 26, 2015, 10:49:36 PM »
GCC 4.9.X will break the builds for some cams but not all! You might try the dm-spy-experiments branch from bitbucket source to start debugging. You could also implement some blinks (led) to see where it hangs. From the conversation between marsu42 and me linked it's clear that it has to do with the boot hacks and newer devices using cache hacks don't seem to have the problem. I've seen bug reports and some detailed information regarding fixes that suggest taking a look at .bss _start /_end & _main.

Would ofc be nice to get it fixed so we can use latest gcc-embedded release. Guess that's something to be solved by a1ex or g3gg0.

At least keep me updated if anyone starts working on it. Still got the idea to simplify source code and use newlib-nano. My goal is / was to be able to use also an IDE instead of pure console.
70D.112 & 100D.101

gph

  • New to the forum
  • *
  • Posts: 4
Re: Getting started with development
« Reply #90 on: November 26, 2015, 10:57:09 PM »
@Walter Schulz: No, I am using Ubuntu 14.04

@nikfreak: I am actually using a gcc 4.8.x version of gcc-arm-none-eabi-4_8-2013q4.

But I am looking at an unmaintained model (5Dc). The latest release, ML-5Dc-Beta4, was released back in Oct 2012. So there may well be some compiler/library incompatibilities there.
5D (Classic)

nikfreak

  • Developer
  • Hero Member
  • *****
  • Posts: 1133
Re: Getting started with development
« Reply #91 on: November 26, 2015, 11:04:44 PM »
Hmm a1ex brought back 5Dc to life a felt ages ago but vxworks is out of my scope atm as I don't own any cam using it. You might want to have a look at https://github.com/400plus/400plus/commits/master and with some luck / intuition you might find something useful.

if all fails: try to compile a simple "Hello World". If you get there you might use some blink code as suggested earlier to see where you get stuck. Alternative: use an even older gcc for your tests (4.6 / 4.7)...
70D.112 & 100D.101

gph

  • New to the forum
  • *
  • Posts: 4
Re: Getting started with development
« Reply #92 on: November 27, 2015, 12:14:05 AM »
@nikfreak: Thanks a lot for the good suggestions. It works now. Somehow the code I checked out was an incorrect version. Probably I haven't fully understood some of the hg revision number tricks. After simply hg updating the same tip revision, the code was changed (magically) to the correct verison, and then built and run on my 5D wonderfully.
5D (Classic)

nikfreak

  • Developer
  • Hero Member
  • *****
  • Posts: 1133
Re: Getting started with development
« Reply #93 on: November 27, 2015, 12:57:19 AM »
that's great to hear. Keep us updated on the 5Dc thread about your progress.
70D.112 & 100D.101

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3721
Re: Getting started with development
« Reply #94 on: November 27, 2015, 04:50:00 AM »
Interesting.

The Mac (Homebrew) instructions I posted is using gcc 5.2.0 and I haven't heard of any problems. In fact for a while I was using the clang compiler that is included in OS-X but I had to change because it wasn't working with the command line tools like cr2hdr, mlv_dump and raw2dng.

As far as I know only thing that the host compiler needs to build is xor_chk and everything else is handled by the ARM cross compiler so it is surprising to hear that some platforms are experiencing build issues.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

nikfreak

  • Developer
  • Hero Member
  • *****
  • Posts: 1133
Re: Getting started with development
« Reply #95 on: November 27, 2015, 01:56:34 PM »
It's not really build issues. Compilation will complete w/o any error. But the created autoexec binary will simply refuse to boot on some older digic4/5) cams (blank screen with continuous led light).
70D / 6D / 100D don't suffer that problem. Unsure for the rest. Funny thing is we are talking about the pre-compiled downloadable gcc from launchpad from official source https://launchpad.net/gcc-arm-embedded.

Side note: I wasn't ever affected personally as it would always work for me (previously owning a 6D) and I need to try out latest release, too. It's been a while once the discussion with marsu42 came up.
70D.112 & 100D.101

DeafEyeJedi

  • Hero Member
  • *****
  • Posts: 3200
  • 5D3 / M1 / 7D / 70D / SL1 / M2
Re: Getting started with development
« Reply #96 on: November 27, 2015, 05:54:47 PM »
Loving this discussion so far. Great to know that it's still being actively updated w the cross compiler.
5D3.113 • 5D3.123 • EOSM.203 • 7D.203 • 70D.112 • 100D.101 • EOSM2.*

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12258
  • Emergencies only
Re: Getting started with development
« Reply #97 on: November 27, 2015, 06:03:17 PM »
My question is, is there a way to debug this? Such as, is there a debug connection, such as a serial port, available? So I can output some debug information to see where it fails? How do you guys do the debugging?

For low-level debugging, here are some suggestions:
- plain old LED blinks
- if you have a second camera that runs ML, you can blink debug messages
- run the code in QEMU (with many limitations, mainly because Canon code talks to a lot of hardware, including a second CPU)

Once you have things like display and file i/o, things get a lot easier, for example: http://magiclantern.wikia.com/wiki/Debugging_Magic_Lantern

gph

  • New to the forum
  • *
  • Posts: 4
Re: Getting started with development
« Reply #98 on: November 28, 2015, 03:02:08 AM »
@alex: Thanks a lot for the very informative suggestions. I will definitely try them out.

The second method is especially interesting. I am thinking of maybe I will convert the receiver end to an iPhone app, thus eliminating the requirement of a second camera (which presumably requires movie function), which I don't have.

BTW, I am quite amazed how friendly and helpful the Magic Lantern community are.
5D (Classic)

mathias

  • New to the forum
  • *
  • Posts: 29
Re: Getting started with development
« Reply #99 on: May 17, 2016, 11:56:47 PM »
Finally I've donwloaded the vm wich works  8)

now I could buid everything, I have my firmware dumped as file name (AS), dissasembled correctly

I've downloaded a fork from jfriosp who has already found almost all stubs and I asume some const.h and internals.h. So I want to run it in QEMU.
I downloaded version 1.6, created a folder sdcard and i've copied my AS file in there, wich files of ML build I need to copy there? how do I run it?

Thank you all for your help!