Getting started with development

Started by a1ex, June 07, 2012, 12:55:48 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

philmoz

Quote from: dpjpandone on August 12, 2014, 07:12:48 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

Try deleting the snapshot.  The box will maintain previous configuration.

sacda1

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

5D3 1.2.3 is in a separate branch. What is the error you are getting?

mkrjf

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


Gerhard34

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
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

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

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

All of your modules are failing to build.

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

Gerhard34

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

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

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

If you're on OS X: Have you tried dfort's setup instruction?

nikfreak

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.
[size=8pt]70D.112 & 100D.101[/size]

gph

@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

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)...
[size=8pt]70D.112 & 100D.101[/size]

gph

@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

that's great to hear. Keep us updated on the 5Dc thread about your progress.
[size=8pt]70D.112 & 100D.101[/size]

dfort

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.

nikfreak

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.
[size=8pt]70D.112 & 100D.101[/size]

DeafEyeJedi

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.* | 50D.109

a1ex

Quote from: gph on November 26, 2015, 10:31:31 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

@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

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!