Magic Lantern Forum

Developing Magic Lantern => General Development Discussion => Topic started by: a1ex on June 07, 2012, 12:55:48 PM

Title: Getting started with development
Post by: a1ex on June 07, 2012, 12:55:48 PM
Step 1. Get the source code
hg clone -u unified https://bitbucket.org/hudson/magic-lantern (https://bitbucket.org/hudson/magic-lantern)


Step 2. Get a compiler


2a -> pre-built toolchain (https://launchpad.net/gcc-arm-embedded) from gcc-arm-embedded (preferred 5_4-2016q3, but any other version should work)

Manual toolchain setup should be straightforward on Linux, Mac and Windows Subsystem for Linux.

General instructions:

Either unzip the downloaded toolchain in your HOME directory (for example, you may get ~/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-gcc), or install a package that provides arm-none-eabi-gcc and make sure it's in your executable PATH. That way, the compiler will be picked up by our Makefiles without additional tweaking.

Ubuntu: package gcc-arm-none-eabi (older) or gcc-arm-embedded from ppa:team-gcc-arm-embedded/ppa (latest). Or just unzip the downloaded toolchain into your HOME directory if you prefer to avoid a system-wide installation.

Mac: the easiest way is probably this tutorial from Daniel Fort (http://www.magiclantern.fm/forum/index.php?topic=16012), but manual setup should work just as well.

Windows 10 WSL is known to require some tweaking (https://www.magiclantern.fm/forum/index.php?topic=20214.0) (such as installing an X server for QEMU), but generally works well.

Windows (native, without WSL): you may install Cygwin (http://www.magiclantern.fm/forum/index.php?topic=15894[/url) (but make sure there are no spaces in your username). For Windows XP you will have to use an older version of Cygwin, but other than that, it should work without much trouble.




2b -> QEMU installation script (https://bitbucket.org/hudson/magic-lantern/src/qemu/contrib/qemu/) will download the recommended toolchain and install it for you.

This method is recommended for Ubuntu, Mac and Win10 WSL; other Linux distros may require additional tweaking.

Besides setting up and compiling QEMU, this script also installs the ARM compiler and debugger, and will provide an environment to run your camera firmware and Magic Lantern in the emulator (very useful for debugging and reverse engineering - check out the guide (https://bitbucket.org/hudson/magic-lantern/src/qemu/contrib/qemu/README.rst)).

Videos: for Ubuntu (https://twitter.com/autoexec_bin/status/913530810686418944) and Mac (https://www.magiclantern.fm/forum/index.php?topic=16012.msg191686#msg191686) (todo: WSL and native Windows).

(http://a1ex.magiclantern.fm/bleeding-edge/qemu/install/91-qemu-5D3-ml-menu.png)

To run QEMU install script:
Code: [Select]
hg clone https://bitbucket.org/hudson/magic-lantern
cd magic-lantern
hg up qemu -C
cd contrib/qemu
./install.sh



2c -> Linaro bare-metal toolchain (https://releases.linaro.org/components/toolchain/binaries/latest/arm-eabi/) should also work (use ARM_ABI=eabi in Makefile.user).



2d -> pre-built VM (http://nanomad.magiclantern.fm/Development%20Box/) if you feel lazy (Kudos to Anton2707 (http://www.magiclantern.fm/forum/index.php?action=profile;u=450)) (User/Root password is 123456)

Also, nikfreak has a VM available here (http://www.magiclantern.fm/forum/index.php?topic=7579.msg134989#msg134989) (with ARM-console preinstalled).

Note: these VMs are old and do not have the latest bells and whistles (QEMU etc), but these should be easy to install.



2e -> Docker (https://bitbucket.org/hudson/magic-lantern/pull-requests/599/docker-environment/diff) (experimental, feedback welcome if you decide to try it)



2f -> Build the compiler yourself (http://www.magiclantern.wikia.com/wiki/Build_instructions/Unified).



Step 3. Start hacking

Code: [Select]
hg up unified -C
cd platform/550D.109
make clean && make zip
make install
make install_qemu

Useful branches

- unified (mainline)
- Experiments (https://builds.magiclantern.fm/experiments.html) section on the download page (WIP stuff)
- Pull requests (https://bitbucket.org/hudson/magic-lantern/pull-requests/) on Bitbucket (same)
- All branches (https://bitbucket.org/hudson/magic-lantern/branches/) (lots of unfinished work and experiments)
- crop_rec_4k (https://www.magiclantern.fm/forum/index.php?topic=19300) (4K recording and lossless compression, very bleeding edge)
- dm-spy-experiments (http://www.magiclantern.fm/forum/index.php?topic=2388) (logging tools for reverse engineering)
- iso-research (http://www.magiclantern.fm/forum/index.php?topic=10111.0) (CMOS/ADTG ISO experiments, adtg_gui, raw_diag)
- qemu (http://www.magiclantern.fm/forum/index.php?topic=2864) (camera firmware emulation)
- new-sound-system (experimental audio controls for DIGIC 5)
- 1200D, 1300D, 100D_merge_fw101, 70D_merge_fw112, 5Ds_experiments etc (ports in progress)
- vxworks (450D, 40D, other oldies are welcome); vxworks-dm-spy (logging)
- digic6-dumper (80D, 750D, 7D2 etc)
- recovery (experiments running from bootloader context, mostly diagnostics or ROM dumping)

Useful stuff

- Writing modules tutorial #1: Hello, World! (https://www.magiclantern.fm/forum/index.php?topic=19232.0)
- How can I run Magic Lantern in QEMU? (https://bitbucket.org/hudson/magic-lantern/src/qemu/contrib/qemu/README.rst) (aka QEMU guide)
- EOS firmware in QEMU - development and reverse engineering guide (https://bitbucket.org/hudson/magic-lantern/src/qemu/contrib/qemu/HACKING.rst) (must read for understanding how the firmware works)
- Notes on old wiki: http://www.magiclantern.wikia.com/wiki/For_Developers (http://www.magiclantern.wikia.com/wiki/For_Developers)
- Using WiFi SD (FlashAir (https://www.magiclantern.fm/forum/index.php?topic=17041.0) and Transcend (https://www.magiclantern.fm/forum/index.php?topic=8234.0)) to avoid swapping the card back and forth
- Speed up compilation:
   export MAKEFLAGS="-j8"  # parallel build
   make install ML_MODULES="lua ettr"  # only compile the modules you are interested in
- Examine ASM code: tag a function with DUMP_ASM, then run: make dump_asm
- Stack trace (http://www.magiclantern.fm/forum/index.php?topic=19933) in crash logs
- Submitting a pull request (https://www.magiclantern.fm/forum/index.php?topic=7940.0)
Title: Re: Getting started with development
Post by: miyake on July 23, 2012, 05:29:36 PM
deleted
Title: Re: Getting started with development
Post by: Alia5 on July 23, 2012, 11:10:39 PM
I'm a litte bit scared of this line of the wiki
Run make and keep your fingers crossed!
make

This will compile a new autoexec.bin, which contains unencrypted ARM code, ready to brick your camera (God forbid...) See Build_instructions for next steps.

But on the Link wich leads me further I cant read anything that would help...

so it wont brick my camera? or what?
Title: Re: Getting started with development
Post by: a1ex on July 23, 2012, 11:17:28 PM
When you alter the source code you need to be much more careful that with things already tested for hundreds or thousands of hours.

See also http://magiclantern.wikia.com/wiki/Unbricking - it contains my mistakes and how I've fixed them.
Title: Re: Getting started with development
Post by: Alia5 on July 23, 2012, 11:25:49 PM
Alright, thanks a lot!
Title: Re: Getting started with development
Post by: miyake on July 24, 2012, 04:39:38 AM
I'm understanding that is ML advantage is not changing boot sequence constantly.
Most cell phones hack is every time build boot sequence , So the brick risk is very high.
But ML change a boot sequence only one time which is installing.

So my understanding:
It's nothing to brick which is broken boot sequence installing with  changing only autoexec.bin .
BTW Cannon firmware does not solve invalid NVRAM config. So If we write a invalid config value from custom autoexec.bin , Canon firmware will not boot.(but recovery method available)

Anyway, anybody not guaranteed . At your own risk when you built your own built.
So you do not take a this risk. Use release version of ML
Title: Re: Getting started with development
Post by: a1ex on July 24, 2012, 07:43:42 AM
That's right. Except that ML does never overwrite executable bootloader code, it just sets a flag in the bootloader data area by calling a Canon function. This is a feature probably used by them for troubleshooting (hint: EOS_DEVELOP).
Title: Re: Getting started with development
Post by: scrax on November 09, 2012, 07:06:50 AM
Windows user how-to: http://www.magiclantern.fm/forum/index.php?topic=2899.msg14021#msg14021
Title: Re: Getting started with development
Post by: dpham23 on December 05, 2012, 09:20:56 PM
How come I don't see a branch for the 5d Mark 3?
Title: Re: Getting started with development
Post by: scrax on December 05, 2012, 10:57:55 PM
it's all in the unified
Title: Re: Getting started with development
Post by: NerveGas on March 03, 2013, 04:16:13 AM
I have my own build compiled, before I turn on the boot flat with this file: how do i turn it off later on?
Title: Re: Getting started with development
Post by: littlefooch on April 15, 2013, 02:44:42 PM
Is anyone using Eclipse for ML development? 

Thanks

R
Title: Re: Getting started with development
Post by: nanomad on April 15, 2013, 03:32:24 PM
I tried but there are so many platform-specific defines it's almost impossible. You need to use a custom makefile builder and specify the correct target
Title: Re: Getting started with development
Post by: deletedAcc.0021 on May 03, 2013, 02:31:19 PM
any idea what is wrong here?  this is what I get when I run "make 600d"

C:\MLnew\magic-lantern>make 600d
process_begin: CreateProcess(NULL, date +%Y-%m-%d, ...) failed.
/usr/bin/sh: date: command not found
process_begin: CreateProcess(NULL, pwd, ...) failed.
make -C /platform/600D.102
make: *** /platform/600D.102: No such file or directory.  Stop.
make: *** [600d] Error 2
Title: Re: Getting started with development
Post by: scrax on May 03, 2013, 02:33:51 PM
try:
make 600D

with the uppercase D

and are you in the source folder when launcing this command? I've no experience on win so not sure if that's the problem
Title: Re: Getting started with development
Post by: nanomad on May 03, 2013, 02:46:19 PM
any idea what is wrong here?  this is what I get when I run "make 600d"

C:\MLnew\magic-lantern>make 600d
process_begin: CreateProcess(NULL, date +%Y-%m-%d, ...) failed.
/usr/bin/sh: date: command not found
process_begin: CreateProcess(NULL, pwd, ...) failed.
make -C /platform/600D.102
make: *** /platform/600D.102: No such file or directory.  Stop.
make: *** [600d] Error 2

Windows, good luck :P
Title: Re: Getting started with development
Post by: deletedAcc.0021 on May 03, 2013, 03:33:41 PM
tried the upper case D .. same error.  I think it might be an error in Makefile.user

my windows path to yagarto is: c:/yagarto, so would it be the same in makefile.user or with the ~


# Path-related stuff
# for yagarto or the official ARM toolchain use ARM_ABI=none-eabi otherwise use ARM_ABI=elf
CCACHE=ccache
ARM_ABI=none-eabi
ARM_PATH=~/yagarto
ARM_BINPATH=$(ARM_PATH)/bin/arm-none-eabi-gcc-4.7.2
#GCC_VERSION=4.7.2
#OBJCOPY=$(ARM_BINPATH)/arm-$(ARM_ABI)-objcopy
#AR=$(ARM_BINPATH)/arm-$(ARM_ABI)-ar
#RANLIB=$(ARM_BINPATH)/arm-$(ARM_ABI)-ranlib
#READELF=$(ARM_BINPATH)/arm-$(ARM_ABI)-readelf
Title: Re: Getting started with development
Post by: scrax on May 03, 2013, 03:38:33 PM
yes, try to put the full address with c: instead of the ~
Title: Re: Getting started with development
Post by: deletedAcc.0021 on May 03, 2013, 03:42:36 PM
tried both ways, no difference.

double checked the ARM path, BINPath and version ... all correct.

Title: Re: Getting started with development
Post by: deletedAcc.0021 on May 03, 2013, 03:45:19 PM
I also installed Yagarto Tools, so I would have "make" ... should that path be in the Makefile.user also? And if so where?
Title: Re: Getting started with development
Post by: RenatoPhoto on May 03, 2013, 04:20:19 PM
I also installed Yagarto Tools, so I would have "make" ... should that path be in the Makefile.user also? And if so where?

Here is the link to the windows installation guide by Pel

http://www.magiclantern.fm/forum/index.php?topic=2899.msg14021#msg14021

Also note my Makefile.user user for windows here

http://www.magiclantern.fm/forum/index.php?topic=2899.msg31741#msg31741
Title: Re: Getting started with development
Post by: dlrpgmsvc on May 17, 2013, 05:44:59 PM
Now i can compile ! But what is the procedure to put my modifications online as a "pull request" ? Many thanks !  :P
Title: Re: Getting started with development
Post by: nanomad on May 18, 2013, 02:03:08 AM
Now i can compile ! But what is the procedure to put my modifications online as a "pull request" ? Many thanks !  :P
After you fork the repo on bitbucket.org you can push your changes to it and then click on the pull request button
Title: Re: Getting started with development
Post by: dlrpgmsvc on May 18, 2013, 02:02:51 PM
Many thanks, Nanomad ! But now I cannot find how to sync my pc local sources with BitBucket sources on my fork repository. I have found "download" but it's for only one file at-a-time. I found "Import/Export" but it's only for "issues". How can I proceed ? Many thanks again !
Title: Re: Getting started with development
Post by: nanomad on May 18, 2013, 02:05:36 PM
http://mercurial.selenic.com/wiki/Tutorial :)
Title: Build failure help (Windows)
Post by: stevefal on May 21, 2013, 12:10:58 AM
Any idea why building is failing for me?

Makefile.user: http://popspring.com/mldrop/Makefile.txt (http://popspring.com/mldrop/Makefile.txt)

Output: http://popspring.com/mldrop/mlfail.txt (http://popspring.com/mldrop/mlfail.txt)
Title: Re: Getting started with development
Post by: Andy600 on May 25, 2013, 01:53:34 PM
After a few days of playing with cygwin I'm fairly comfortable with compiling.

I'm now getting started with mercurial so that I can keep up to date with @smeangol and make my own changes to the 50d build but I want to check if I have the correct mercurial workflow for Bitbucket in mind, so is this correct?:-

1) make my own fork of magic lantern on Bitbucket
2) clone magic lantern to my local drive
3) pull @smeangol's changes and merge with my local copy

If I change something (after thoroughly testing) where do I push it? back to magic lantern or smeangol
Title: Re: Getting started with development
Post by: AgentJJ on June 29, 2013, 03:15:10 AM
Code: [Select]
../../picoc/library_ml.c: In function 'LibPress':
../../picoc/library_ml.c:132:14: error: 'BGMT_PRESS_FULLSHUTTER' undeclared (first use in this function)
../../picoc/library_ml.c:132:14: note: each undeclared identifier is reported only once for each function it appears in
../../picoc/library_ml.c: In function 'LibUnpress':
../../picoc/library_ml.c:158:14: error: 'BGMT_PRESS_FULLSHUTTER' undeclared (first use in this function)
In file included from ../../picoc/pico.c:13:0:
../../picoc/pico.c: In function 'PlatformExit':
../../picoc/platform_ml.c:62:1: warning: 'noreturn' function does return [enabled by default]
make: *** [pico.o] Error 1

This is the error I get in the latest 650D platform build with 4.7.3 prebuilt GCC ARM toolchain on Ubuntu 12.10.
It ('BGMT_PRESS_FULLSHUTTER') appears to be declared in the file.  Any thoughts?
Title: Re: Getting started with development Mac OSX
Post by: mkrjf on June 30, 2013, 04:30:26 AM
Is there post outlining building on Mac?
I saw one post referencing yagarto toolchain - but link was to product not how to use.
Thx
Title: Re: Build failure help (Windows)
Post by: AndyPost on July 15, 2013, 10:22:43 PM
For me as well.  Just bought spanking new MKIII.  Install is not working.  Mine came with the newest Firmware, 1.2.1.  Thought I'd try it.  It would claim that the firmware update was starting, the screen goes blank then the red light would just blink every so often. 

Also Tried backgrading to Firmware 1.1.3 and still no joy.  It claims the firmware update process is starting seems to do a quick card test, the red light blinks a few times then nothing.....

Any ideas would be greatly appreciated
Title: Re: Getting started with development
Post by: vicnaum on July 21, 2013, 09:41:05 PM
How can I compile raw2dng.c?

Already downloaded cygwin, but makefiles under modules don't do anything, and raw2dng.c requires raw.h and chdk-dng.h
Title: Re: Getting started with development
Post by: a1ex on July 21, 2013, 09:49:16 PM
make raw2dng.exe
Title: Re: Getting started with development
Post by: vicnaum on July 22, 2013, 10:18:23 AM
Thanks! But what do you recommend to build it under windows?

There seems to be a problem with 'fseeko':

Cygwin gives me this:
Quote
$ make raw2dng
[ GCC      ]   raw2dng
[ GCC      ]   raw2dng
raw2dng.c: In function 'main':
raw2dng.c:60:5: warning: implicit declaration of function 'fseeko' [-Wimplicit-function-declaration]
[ GCC      ]   raw2dng
raw2dng.o:raw2dng.c:(.text.startup+0x58): undefined reference to `fseeko'
collect2: ld returned 1 exit status
Makefile:14: recipe for target `raw2dng' failed
make: *** [raw2dng] Error 1

MINGW this:
Quote
$ make raw2dng
[ GCC      ]   raw2dng
[ GCC      ]   raw2dng
raw2dng.c: In function 'main':
raw2dng.c:60:5: warning: implicit declaration of function 'fseeko' [-Wimplicit-function-declaration]
[ GCC      ]   raw2dng
raw2dng.o:raw2dng.c:(.text.startup+0x58): undefined reference to `fseeko'
collect2: ld returned 1 exit status
make: *** [raw2dng] Error 1

Google tells me that MinGW doesn't support big files (http://stackoverflow.com/questions/9026896/get-large-file-size-in-c)

What should I use to get it right?
Title: Re: Getting started with development
Post by: vicnaum on July 22, 2013, 11:27:04 AM
Heh, installing all and everything from Devel in Cygwin (4Gb!) - did the trick :)

But anyway, it's interesting to know which cygwin module was required...
Title: Re: Getting started with development
Post by: John Kesl on August 09, 2013, 06:34:10 PM
 ;D almost there. 8)
Title: Re: Getting started with development
Post by: John Kesl on August 10, 2013, 02:25:35 PM
Hi,
I've got it figured out to some extent now. I'm running osx 10.7.5 and am only compiling. I am using yagarto. I've configured my makefile. and am trying to compile 7D. I get the following error. I  hg clone -r unified. and hg pull before make clean and then make 7D. (There was also an error for a missing menuindex file. I think menuindex.h, I corrected it by putting a menu index.h file so I think it's what is missing)

debug.o: In function `run_test':
debug.c:(.text+0xb9c): undefined reference to `edmac_memcpy_res_lock'
debug.c:(.text+0xbe0): undefined reference to `edmac_copy_rectangle_adv'
debug.c:(.text+0xc30): undefined reference to `edmac_copy_rectangle_adv'
debug.o: In function `mem_test_edmac_copy_rectangle':
debug.c:(.text+0xc94): undefined reference to `edmac_copy_rectangle_adv'
debug.o: In function `mem_benchmark_task':
debug.c:(.text+0x358c): undefined reference to `edmac_memcpy'
collect2: error: ld returned 1 exit status
make[1]: *** [magiclantern] Error 1
make: *** [7D] Error 2
Johns-Mac-Pro:magic-lantern johnkesl$

can anyone please help.
Title: Re: Getting started with development
Post by: John Kesl on August 10, 2013, 04:54:46 PM
Hi,
I've got it figured out to some extent now. I'm running osx 10.7.5 and am only compiling. I am using yagarto. I've configured my makefile. and am trying to compile 7D. I get the following error. I  hg clone -r unified. and hg pull before make clean and then make 7D. (There was also an error for a missing menuindex file. I think menuindex.h, I corrected it by putting a menu index.h file so I think it's what is missing)

debug.o: In function `run_test':
debug.c:(.text+0xb9c): undefined reference to `edmac_memcpy_res_lock'
debug.c:(.text+0xbe0): undefined reference to `edmac_copy_rectangle_adv'
debug.c:(.text+0xc30): undefined reference to `edmac_copy_rectangle_adv'
debug.o: In function `mem_test_edmac_copy_rectangle':
debug.c:(.text+0xc94): undefined reference to `edmac_copy_rectangle_adv'
debug.o: In function `mem_benchmark_task':
debug.c:(.text+0x358c): undefined reference to `edmac_memcpy'
collect2: error: ld returned 1 exit status
make[1]: *** [magiclantern] Error 1
make: *** [7D] Error 2
Johns-Mac-Pro:magic-lantern johnkesl$

can anyone please help.

The answer is to insert edmac-memcpy.o to /src/Makefile.src in the following place (line 127)

ML_SRC_OBJS = \
 boot-hack.o \
 ico.o \
 edmac.o \
 menu.o \
 edmac-memcpy.o \
 debug.o \

I mustve been drunk


Title: Re: Getting started with development
Post by: Marsu42 on August 25, 2013, 11:59:05 AM
Concerning Windows compilation w/o a vm under cygwin or msys/mingw:

I see there are tutorials for setting up a vm and even a link to a pre-built vm, but imho this really isn't necessary since ml compiles under plain windows just fine and there is no noticeable speed degradation since ml is such a small project.

Would it make sense to make a pre-built cygwin environment available with a compilation script, pre-set Makefile.user and such & shortcut to a script that pulls the ml source (updates), runs make & drops the autoexec.bin & modules somewhere? This would be a "one click" windows solution for people who want to do minor changes to the trunk source and don't have the time or experience or set up the compilation environment for themselves.

I don't know if the nightly buiild script can/should be used for this since it's really just hg pull & make ... anyone interested in this, any objections to the idea?
Title: Re: Getting started with development
Post by: primeone on August 25, 2013, 09:53:12 PM
Speaking as someone who's just wrestled with Cygwin and compiling ML, I vote yes :)

Title: Re: Build failure help (Windows)
Post by: primeone on August 25, 2013, 10:01:07 PM
If it's still relevant : I fixed this exact build problem by upgrading to the 4.7.4 version.

http://www.magiclantern.fm/forum/index.php?topic=2899.msg69446#msg69446
Title: Re: Getting started with development
Post by: Marsu42 on October 20, 2013, 01:39:14 PM
Here's a reference what int types to use, I'll cross-reference it here so it's easier to find:

http://www.magiclantern.fm/forum/index.php?topic=7122.msg83922#msg83922

https://bitbucket.org/hudson/magic-lantern/commits/f2660b2263c4ad7129e2f622056d924db6565cbb

Quote from g3gg0:

Quote
in general i say:

use uint32_t everywhere.

in cases you need signed integers, use int32_t.

dont use uint16_t or uint8_t for arithmetics, just for constructing structs. reason: compilers often add code after every arithmetic instruction to variables of this type to ensure the result is 0x00-0xFF only this will slow down code for no reason.

if you just have a iterating loop, your counter can be int of course. (a la: "i dont care about its width, 16 bit is enough")

if uint32_t isnt enough for your arithmetics, choose 64 bit of course :)

remember:

in C you get only the guarantee that char is 1 bits or more (no typo!)

short is 16 bits or more, but at least the same width as char.

int is 16 bit or more, but at least the same width as short

long is 32 bit or more, but at ... as int

long long is 64 bi.... and so on
Title: Re: Getting started with development
Post by: g3gg0 on October 20, 2013, 02:51:10 PM
see http://en.wikipedia.org/wiki/C_data_types
there you see the type widths that C compilers guarantee.
Title: Re: Getting started with development
Post by: Marsu42 on October 20, 2013, 04:46:41 PM
see http://en.wikipedia.org/wiki/C_data_types there you see the type widths that C compilers guarantee.

For ml code on the camera - does it make any sense at all trying to reduce the memory used by going for smaller data types, or is this absolutely negligible vs. the camera's memory and general ml memory overhead? Is this tradeoff the reason why you suggested simply using uint32_t unless used in structs that are duplicated a lot?
Title: Re: Getting started with development
Post by: pompeiisneaks on November 07, 2013, 12:28:01 AM
Question on my failed build, if someone can make sense of this.  I did the summon-arm and its TARGET=arm-elf but when I tried to compile first time, the ARM_ABI=none-eabi

instead I changed it to match my elf setup:

ARM_ABI=elf.

In the howto docs it does somewhat contradict.  It talks about none-eabi and elf both.  this is from: http://magiclantern.wikia.com/wiki/Build_instructions/Unified

Example, early on, after summon-arm it says:

This will install arm-elf-gcc under ~/arm-toolchain462/bin.

Okay, elf-gcc.

I even tested the .c file and got a .o that with 'file' showed it was arm executable. 

Later, though it talks about:

If you are using the official ARM toolchain in the same file also set ARM_ABI=none-eabi and ARM_PATH as appropriate.

which is it, none-eabi or elf?  If I do elf it starts compiling, if I leave it at none-eabi it won't run because the arm compiler doesn't have a file named arm-eabi* at all.   (this may just be a red herring, but trying to understand.)

but then when I compile the source, using elf not none-eabi, it runs for a while and errors out:

Code: [Select]
[ VERSION  ]   ../../platform/60D.111/version.bin
[ VERSION  ]   ../../platform/60D.111/version.c
[ CC       ]   version.o
make -C ../../tcc
make[2]: Entering directory `/home/pdavis/src/magiclantern/magic-lantern/tcc'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/pdavis/src/magiclantern/magic-lantern/tcc'
[ LD       ]   magiclantern
/home/pdavis/arm-toolchain462/lib/gcc/arm-elf/4.6.2/../../../../arm-elf/bin/ld: error: version.o uses VFP instructions, whereas magiclantern does not

so I'm confused.  What could I be doing wrong?  Or is there some new error in the recent commits to the tree? 

Any help would be greatly appreciated.  Also I'm on a fedora linux build and I installed the required deps listed, but I still ended up having to install the following RPM's:

gcc
patch
texinfo

another note is when installing the perl modules on redhat you don't need to use CPAN for most.  I was able to install File::Slurp with:

yum install perl-File-Slurp. Those things could help clarify a bit on the redhat/fedora build processes.  (maybe its assumed that if I'm building anything, I'd already have gcc, patch and texinfo, but just in case)

I am on an older fedora, 11 I think, that may be part of the issue?  The gcc I have locally is 4.4.1 but the one used by the arm toolchain seems to be 4.6.2. 

~Phil 
Title: Re: Getting started with development
Post by: pompeiisneaks on November 07, 2013, 12:38:16 AM
Oh I should have included at the end of the error after many repeated lines of the VFP type errors, it ends with:

Code: [Select]
/home/pdavis/arm-toolchain462/lib/gcc/arm-elf/4.6.2/../../../../arm-elf/bin/ld: failed to merge target specific data of file newlib-libc.a(lib_a-memset.o)
boot-hack.o: In function `my_assert_handler':
boot-hack.c:(.text+0x48): relocation truncated to fit: R_ARM_PC24 against symbol `get_current_task' defined in *ABS* section in magiclantern
boot-hack.o: In function `my_init_task':
boot-hack.c:(.text+0xd8): relocation truncated to fit: R_ARM_PC24 against symbol `get_current_task' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x144): relocation truncated to fit: R_ARM_PC24 against symbol `init_task' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x1f4): relocation truncated to fit: R_ARM_PC24 against symbol `msleep' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x21c): relocation truncated to fit: R_ARM_PC24 against symbol `msleep' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x22c): relocation truncated to fit: R_ARM_PC24 against symbol `msleep' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x26c): relocation truncated to fit: R_ARM_PC24 against symbol `msleep' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x2e0): relocation truncated to fit: R_ARM_PC24 against symbol `task_create' defined in *ABS* section in magiclantern
boot-hack.o: In function `my_big_init_task':
boot-hack.c:(.text+0x338): relocation truncated to fit: R_ARM_PC24 against symbol `call' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x370): relocation truncated to fit: R_ARM_PC24 against symbol `msleep' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x38c): additional relocation overflows omitted from the output
collect2: ld returned 1 exit status

There were also some errors like so:

Code: [Select]
ld: error: Source object dietlibc.a(strrchr.o) has EABI version 5, but target magiclantern has EABI version 0
Title: Re: Getting started with development
Post by: 1% on November 07, 2013, 12:39:56 AM
why not run the launchpad pre-built compiler? you just extract it and add the path to makefile.user
Title: Re: Getting started with development
Post by: pompeiisneaks on November 07, 2013, 05:12:59 AM
why not run the launchpad pre-built compiler? you just extract it and add the path to makefile.user
because I'm following the wiki on how to build it and nowhere did it mention a launchpad pre-built compiler or how to get it.  Do you have a reference on the wiki to that somewhere?
Title: Re: Getting started with development
Post by: pompeiisneaks on November 07, 2013, 05:16:21 AM
Oh I see it in the first post, I was following the third method of compiling it. I'll give the prebuilt one a try.

Title: Re: Getting started with development
Post by: pompeiisneaks on November 07, 2013, 05:24:30 AM
Nope that doesn't help either.  Same types of compile errors:

Code: [Select]
ld: error: Source object ../../platform/60D.111/stubs.o has EABI version 5, but target magiclantern has EABI version 0
but it seems to happen in a different place.  Right before the errors:
Code: [Select]
CC       ]   edmac-memcpy.o
[ AR       ]   strrchr.o
[ AR       ]   dietlibc.a
[ AR       ]   lib_a-setjmp.o
[ AR       ]   newlib-libc.a
[ LD       ]   magiclantern

and then just after a ton of those EABI version 5 vs 0 errors:

Code: [Select]
../../tcc/libtccx.o: In function `strcat_printf':
arm-gen.c:(.text+0xfc): relocation truncated to fit: R_ARM_PC24 against symbol `vsnprintf' defined in *ABS* section in magiclantern
../../tcc/libtccx.o: In function `error1':
arm-gen.c:(.text+0x2d8): relocation truncated to fit: R_ARM_PC24 against symbol `vsnprintf' defined in *ABS* section in magiclantern
collect2: error: ld returned 1 exit status
make[1]: *** [magiclantern] Error 1
make[1]: Leaving directory `/home/pdavis/src/magiclantern/magic-lantern/platform/60D.111'
make: *** [60D] Error 2

No love.  This is just pulled from recent mercury via: hg clone -r unified https://bitbucket.org/hudson/magic-lantern/

Title: Re: Getting started with development
Post by: 1% on November 07, 2013, 05:35:26 AM
You changed the eabi back?
Title: Re: Getting started with development
Post by: pompeiisneaks on November 07, 2013, 05:40:24 AM
Not sure I follow.  I tried both the arm-elf-gcc and the arm-none-eabi-gcc and neither builds, both fail with similar errors.  Is it my os that's causing this?  Too old of libs or something?
Title: Re: Getting started with development
Post by: 1% on November 07, 2013, 06:54:48 AM
Maybe, look at requirements for TCC or try to compile without it and see if there are errors.
Title: Re: Getting started with development
Post by: pompeiisneaks on November 07, 2013, 07:30:55 PM
Sorry, everything I find on this forum about the Tiny C Compiler is not helpful, I tried disabling it and it still fails to build with this error:

Code: [Select]
[ CC       ]   menuindex.o
[ CC       ]   focus.o
[ CC       ]   notify_box.o
[ CC       ]   dialog_test.o
[ CC       ]   vram.o
[ CC       ]   aj_port.o
[ CC       ]   fps-engio.o
[ CC       ]   shoot.o
../../src/shoot.c:519:60: warning: initialization makes pointer from integer without a cast [enabled by default]
../../src/shoot.c:519:1: error: initializer element is not constant
../../src/shoot.c:521:53: warning: initialization makes pointer from integer without a cast [enabled by default]
../../src/shoot.c:521:1: error: initializer element is not constant
make[1]: *** [shoot.o] Error 1
make[1]: Leaving directory `/home/pdavis/src/magiclantern/magic-lantern/platform/5D3.113'
make: *** [5D3] Error 2

Why would the arm linker complaining about eabi mismatches have anything to do with the tiny c compiler?
Title: Re: Getting started with development
Post by: pompeiisneaks on November 07, 2013, 11:31:41 PM
Okay I'm pretty sure its just due to how old this machine's Fedora is.  I'll figure something else out.  Right now its failing to compile the docq target due to missing pandoc which isn't available in fedora until 18.  I'm on like 11 or 13, sorry its an old host I had sitting around as my router I figured I could dual purpose.  I'll give it a go on a more modern OS.

~Phil
Title: Re: Getting started with development
Post by: pompeiisneaks on November 08, 2013, 02:36:20 AM
Well look at that, I can build 5D3 now on my fedora 19 laptop.  It fails with the 60D when I just try and build all, but success with my camera at any rate.  Oddly trying to build the arm toolkit from source fails due to texinfo 5.0 on fedora not being happy with the docs.  I did some reading on how to fix it on a linux from scratch thread but gave up after an hour of mucking about and not getting the right lines fixed.  (I have no idea how to fix texinfo files.)  At any rate, I'm down that road now, thanks!

~Phil
Title: Re: Getting started with development
Post by: 1% on November 08, 2013, 03:28:07 AM
Quote
Why would the arm linker complaining about eabi mismatches have anything to do with the tiny c compiler?

Why? Because its a lot of PI code going into the binary and thats where it failed. Either way probably like you said, old libs, old gcc.
Title: Re: Getting started with development
Post by: pompeiisneaks on November 08, 2013, 05:57:02 PM
Yup, thanks, I appreciate your help.

~Phil
Title: Re: Getting started with development
Post by: Scoutman on February 02, 2014, 06:48:44 PM
Hi!

I always get this error:

Code: [Select]
username@ubuntu:~/daten/ml/magic-lantern/platform/50D.109$ make clean && make
[ RM ]  *.o *.d autoexec autoexec.bin magiclantern magiclantern.bin
[ RM ]  50D_109.sym magiclantern.sym
[ RM ]  magiclantern.bin autoexec autoexec.map location.map
[ RM ]  autoexec-fir autoexec-fir.bin
[ RM ]  magiclantern.lds
[ RM ]  newlib-libc.a lib_a-setjmp.o lib_a-memcpy.o lib_a-memcpy-stub.o lib_a-memccpy.o lib_a-memset.o  dietlibc.a
[ RM ]  version.c version.bin
[ RM dir ]  zip
[ RM ]  *.zip
[ VERSION  ]   ../../platform/50D.109/version.bin
[ CPP      ]   magiclantern.lds
/bin/sh: 1: /home/username/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc-4.7.3: Permission denied
make: *** [magiclantern.lds] Error 1

I use Ubutuntu 12.04 and gcc 4.7.3. I have tried to use sudo but it didn't helped. All files have the same owner/group. I didn't understand the "Permission denied"!?

Any idea?  :)
Title: Re: Getting started with development
Post by: Marsu42 on February 02, 2014, 07:25:41 PM
/bin/sh: 1: /home/username/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc-4.7.3: Permission denied

Your gcc file doesn't seem to be executable, try "chmod 755 /home/username/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc-4.7.3"
Title: Re: Getting started with development
Post by: Scoutman on February 02, 2014, 07:39:46 PM
Thanks.

Now I get this error??

Code: [Select]
username@ubuntu:~/daten/ml/magic-lantern/platform/50D.109$ make clean && make
[ RM ]  *.o *.d autoexec autoexec.bin magiclantern magiclantern.bin
[ RM ]  50D_109.sym magiclantern.sym
[ RM ]  magiclantern.bin autoexec autoexec.map location.map
[ RM ]  autoexec-fir autoexec-fir.bin
[ RM ]  magiclantern.lds
[ RM ]  newlib-libc.a lib_a-setjmp.o lib_a-memcpy.o lib_a-memcpy-stub.o lib_a-memccpy.o lib_a-memset.o  dietlibc.a
[ RM ]  version.c version.bin
[ RM dir ]  zip
[ RM ]  *.zip
[ VERSION  ]   ../../platform/50D.109/version.bin
[ CPP      ]   magiclantern.lds
/bin/sh: 1: /home/username/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc-4.7.3: not found
make: *** [magiclantern.lds] Error 1

Title: Re: Getting started with development
Post by: Marsu42 on February 02, 2014, 08:48:24 PM
Now I get this error??

Omg, you're 100% sure "/home/username/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc-4.7.3" exists, has the correct usership and permissions? Try to view it in less to be sure, you should be getting a binary elf file.
Title: Re: Getting started with development
Post by: Pelican on March 20, 2014, 10:44:10 PM
Is there an easy way to make minimalist autoexec.bin and put more and more stuff into it if everything is OK?
I mean I've made an autoexec.bin for 7D 2.0.5 but it's freezing so how can I start to check what's wrong with it?
(https://bitbucket.org/Pelican/7d.205/commits/all)
Title: Re: Getting started with development
Post by: nanomad on March 20, 2014, 11:04:44 PM
Well, most of ML features are defined inside all-features.h. I'd start by undefining them all then working my way up
Title: Re: Getting started with development
Post by: a1ex on March 20, 2014, 11:19:26 PM
You can go even earlier in the boot process, boot-hack.c, simply do nothing from my_big_init_task. If you do that, you'll only have the GUI task overriden.

If you still have problems, comment out the GUI task too; if not, start enabling stuff from my_big_init_task.
Title: Re: Getting started with development
Post by: Pelican on March 21, 2014, 12:04:21 AM
Thanks for the hints guys!
Title: Re: Getting started with development
Post by: CraigularB on April 26, 2014, 05:38:59 AM
Omg, you're 100% sure "/home/username/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc-4.7.3" exists, has the correct usership and permissions? Try to view it in less to be sure, you should be getting a binary elf file.

Thanks.

Now I get this error??

Code: [Select]
username@ubuntu:~/daten/ml/magic-lantern/platform/50D.109$ make clean && make
[ RM ]  *.o *.d autoexec autoexec.bin magiclantern magiclantern.bin
[ RM ]  50D_109.sym magiclantern.sym
[ RM ]  magiclantern.bin autoexec autoexec.map location.map
[ RM ]  autoexec-fir autoexec-fir.bin
[ RM ]  magiclantern.lds
[ RM ]  newlib-libc.a lib_a-setjmp.o lib_a-memcpy.o lib_a-memcpy-stub.o lib_a-memccpy.o lib_a-memset.o  dietlibc.a
[ RM ]  version.c version.bin
[ RM dir ]  zip
[ RM ]  *.zip
[ VERSION  ]   ../../platform/50D.109/version.bin
[ CPP      ]   magiclantern.lds
/bin/sh: 1: /home/username/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc-4.7.3: not found
make: *** [magiclantern.lds] Error 1

I know these are old, but I hit the same issue tonight on a clean install of Ubuntu 14.04 64-bit LTS. It has to do with running a 32-bit app on a 64-bit machine. I could see the files in the folder, I could run 'ls' and have it return the files, but trying to run any of them would result in bash saying it didn't exist. If you reinstall the 32-bit libs it fixes it:

Code: [Select]
sudo apt-get install --reinstall libc6-i386
This comes from an old bug that was supposedly fixed: Launchpad bug report (https://bugs.launchpad.net/ubuntu/+source/ia32-libs/+bug/852101?comments=all)

On an older version of Ubuntu you may also be able to do
Code: [Select]
sudo apt-get install ia32-libs
per this Superuser question (http://superuser.com/questions/344533/no-such-file-or-directory-error-in-bash-but-the-file-exists) but I can't verify that.

Hope this helps anybody who may be stumped.
Title: Re: Getting started with development
Post by: Rewind on June 12, 2014, 04:03:02 PM
Guys, what am I doing wrong?
(http://savepic.ru/5168730.jpg)
Title: Re: Getting started with development
Post by: dslrrookie2 on June 12, 2014, 04:10:06 PM
Guys, what am I doing wrong?
(http://savepic.ru/5168730.jpg)

I had the same issue ... resolved by installing docutils

Also, I had to run Make for the platform builds prior to building modules.

http://pkgs.org/ubuntu-12.04/ubuntu-main-i386/python-docutils_0.8.1-4ubuntu1_all.deb.html (http://pkgs.org/ubuntu-12.04/ubuntu-main-i386/python-docutils_0.8.1-4ubuntu1_all.deb.html)
Title: Re: Getting started with development
Post by: Rewind on June 12, 2014, 05:36:12 PM
... resolved by installing docutils

Thanks a lot! It works now.
Title: Re: Getting started with development
Post by: stoopkid on August 03, 2014, 01:22:35 AM
I get this error...

Code: [Select]
nick@nick-mint ~/magic-lantern/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
[ CPP      ]   magiclantern.lds
/bin/sh: /home/nick/gcc-arm-none-eabi-4_8-2014q2/bin/arm-none-eabi-gcc-4.8.4: No such file or directory
make: *** [magiclantern.lds] Error 1

However the file is there and executable...

Code: [Select]
nick@nick-mint ~/magic-lantern/platform/550D.109 $  ls -l /home/nick/gcc-arm-none-eabi-4_8-2014q2/bin/arm-none-eabi-gcc-4.8.4
-rwxr-xr-x 2 nick nick 676756 Jun  8 12:12 /home/nick/gcc-arm-none-eabi-4_8-2014q2/bin/arm-none-eabi-gcc-4.8.4

I don't really know how to troubleshoot this any further.
Title: Re: Getting started with development
Post by: ayshih on August 03, 2014, 05:08:18 AM
It sounds like you may be having the same 32-bit/64-bit issue discussed earlier in this thread.  See the solution a few posts above yours: http://www.magiclantern.fm/forum/index.php?topic=991.msg112954#msg112954
Title: Re: Getting started with development
Post by: stoopkid on August 04, 2014, 12:25:20 AM
Thanks it works now.
Title: Re: Getting started with development
Post by: dpjpandone on August 11, 2014, 05:40:48 PM
I'm trying to use the prebuilt at work and when I try to launch the Magic Lantern machine,  I keep getting this:

Failed to open a session for the virtual machine MagicLantern.

The virtual machine 'MagicLantern' has terminated unexpectedly during startup with exit code 1.

Result Code: E_FAIL (0x80004005)
Component: Machine
Interface: IMachine {480cf695-2d8d-4256-9c7c-cce4184fa048}

Title: Re: Getting started with development
Post by: philmoz on August 11, 2014, 09:49:37 PM
I'm trying to use the prebuilt at work and when I try to launch the Magic Lantern machine,  I keep getting this:

Failed to open a session for the virtual machine MagicLantern.

The virtual machine 'MagicLantern' has terminated unexpectedly during startup with exit code 1.

Result Code: E_FAIL (0x80004005)
Component: Machine
Interface: IMachine {480cf695-2d8d-4256-9c7c-cce4184fa048}

On Windows, any error code ending in 005, is usually a permission problem (access denied).

The machine may be locked down preventing VirtualBox (or whatever hypervisor you are using) from gaining enough access to the hardware.

Have you tried running it as administrator?

Phil.
Title: Re: Getting started with development
Post by: 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?
Title: Re: Getting started with development
Post by: philmoz 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 (https://forums.virtualbox.org/viewtopic.php?f=6&t=62615)

Phil.
Title: Re: Getting started with development
Post by: Audionut on August 13, 2014, 12:42:30 AM
Try deleting the snapshot.  The box will maintain previous configuration.
Title: Re: Getting started with development
Post by: sacda1 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
Title: Re: Getting started with development
Post by: dmilligan on November 23, 2014, 06:21:11 PM
5D3 1.2.3 is in a separate branch. What is the error you are getting?
Title: Re: Getting started with development / MAC
Post by: mkrjf 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
Title: Re: Getting started with development
Post by: dmilligan on February 13, 2015, 10:15:58 PM
Yes, it is possible.
Title: Getting started with development
Post by: Gerhard34 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$
Title: Re: Getting started with development
Post by: dmilligan 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.
Title: Getting started with development
Post by: Gerhard34 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 (https://www.dropbox.com/sh/k5m67ao87l0ds5o/AABYHC4YbWf4R7iSi7sPuxZea?dl=0)
Title: Re: Getting started with development
Post by: Audionut 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?
Title: Getting started with development
Post by: Gerhard34 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!! 
Title: Re: Getting started with development
Post by: SztupY 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
Title: Re: Getting started with development
Post by: gph 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?
Title: Re: Getting started with development
Post by: Walter Schulz on November 26, 2015, 10:37:32 PM
If you're on OS X: Have you tried dfort's setup instruction?
Title: Re: Getting started with development
Post by: nikfreak on November 26, 2015, 10:49:36 PM
GCC 4.9.X will break the builds for some cams (http://www.magiclantern.fm/forum/index.php?topic=15515.0) 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.
Title: Re: Getting started with development
Post by: gph 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.
Title: Re: Getting started with development
Post by: nikfreak 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)...
Title: Re: Getting started with development
Post by: gph 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.
Title: Re: Getting started with development
Post by: nikfreak on November 27, 2015, 12:57:19 AM
that's great to hear. Keep us updated on the 5Dc thread about your progress.
Title: Re: Getting started with development
Post by: dfort 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.
Title: Re: Getting started with development
Post by: nikfreak 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.
Title: Re: Getting started with development
Post by: DeafEyeJedi 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.
Title: Re: Getting started with development
Post by: a1ex 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 (http://www.magiclantern.fm/forum/index.php?topic=13070.0)
- run the code in QEMU (http://www.magiclantern.fm/forum/index.php?topic=2864) (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
Title: Re: Getting started with development
Post by: gph 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.
Title: Re: Getting started with development
Post by: mathias 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!
Title: Re: Getting started with development
Post by: Alex_Palomo on January 13, 2017, 01:36:51 PM
Where do you find the virtual machine? I've tried to downlaod the VM of the front page but it is not available anymore.
Thank you!
Title: Re: Getting started with development
Post by: Licaon_Kter on January 13, 2017, 04:16:05 PM
Guess it's easier to make one from scratch, say using Lubuntu and these: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads

BTW, do you want to build something new or to test those in the works?  Did you see the new page with experiments builds: https://builds.magiclantern.fm/experiments.html ?
Title: Re: Getting started with development
Post by: Audionut on January 14, 2017, 01:29:06 AM
What about this one:  http://www.magiclantern.fm/forum/index.php?topic=7579.msg134989#msg134989
Title: Re: Getting started with development
Post by: reddeercity on January 14, 2017, 05:33:06 AM
Yea that one works it's the one I use to compile on VM in Win7 started a thread here (http://www.magiclantern.fm/forum/index.php?topic=18259.msg175475#msg175475) with a short video tutorial .
Title: Re: Getting started with development
Post by: Alex_Palomo on January 16, 2017, 03:55:38 PM
Thank you guys! You've been such a great help!!! Now that I can compile ML, it's time to dev.
Your video has been very useful to me reddeercity.
Licaon_Kter, my idea is to build something that I've been investigating. Sure that I will let you know!
Have a good day!
Title: Re: Getting started with development
Post by: henrus on November 18, 2017, 05:40:03 PM
http://mercurial.selenic.com/wiki/Tutorial :)

Replying to an old post, but in case anyone is reading them, this link is no longer working. A good Mercurial Tutorial can be found here: http://hginit.com/ (http://hginit.com/)
Title: Re: Getting started with development
Post by: a1ex on December 03, 2017, 12:44:38 AM
Preparing to update the build system, with the goal of making the environment setup as painless as possible, on all major operating systems. I need some help with testing this PR (https://bitbucket.org/hudson/magic-lantern/pull-requests/873/makefile-updates-to-use-any-valid-arm/commits).

The stuff I've been tweaking lately includes:
- Mac fixes (seems like it's impossible not to break this one, even with apparently minor changes)
- parallel build fixes (make -j8)
- fixing minor quirks

New features from the PR:
- top-level build rules (zip, 5D3_zip, 60D_install_qemu etc)
- compiler autodetection (use any arm-none-eabi-gcc from your executable path, or any gcc-arm-none-eabi from your home directory, without editing the Makefiles)
- Linaro arm-gcc support (experimental, see PR description for details)
- nicer error messages, toolchain suggestions if none is installed

There was good feedback on the PR from veterans around here, but some things have changed and I'm still finding OS-specific issues, so I'd like to encourage more users (newcomers too!) to give it a try. Just compile from the "makefile-updates" branch instead of unified, and let me know how it goes:
Code: [Select]
hg clone -u makefile-updates https://bitbucket.org/hudson/magic-lantern
cd magic-lantern
make
# follow error messages, install dependencies and so on

In particular, I'm looking for cases where the error message is unclear when some build tool is not found and has to be installed. Or, for the build process not working on some widely used operating system (even if it didn't work before). Or, to suggest better ways of doing things (I'm far from being a Makefile expert - mostly copy/pasting from Stack Overflow).

You should be able to build ML under any recent Linux distro, Mac and Windows (both Cygwin and WSL). Would be nice to know if it works on BSD as well :)

Just FYI: there were some attempts to automate the environment preparation for various operating systems, but they are beyond the scope of this PR. One such attempt is in QEMU's install.sh (http://www.magiclantern.fm/forum/index.php?topic=2864.msg190596#msg190596) (Mac demo (http://www.magiclantern.fm/forum/index.php?topic=16012.msg191686#msg191686)), others are in various sticky topics on this forum. The former is also waiting to be merged into mainline, so feel free to give it a try as well.
Title: Re: Getting started with development
Post by: dfort on December 03, 2017, 06:55:06 PM
The stuff I've been tweaking lately includes:
- Mac fixes (seems like it's impossible not to break this one, even with apparently minor changes)
- parallel build fixes (make -j8)
- fixing minor quirks

It is working great on this Mac.

Glad to see you addressed one of my pet peeves - when compiling in the camera directory, running "make clean" wouldn't clean out build_tools/xor_chk so I kept having to run "make clean" from the top directory which takes a lot longer.

Using "make -j8" speeds things up on this system:

make zip __ 44 sec.
make -j8 zip __ 31 sec.

On the Compiling Magic Lantern on a Macintosh (http://www.magiclantern.fm/forum/index.php?topic=16012.0) Quick installation script I'm doing this:

Code: [Select]
make -j`grep -c processor /proc/cpuinfo 2> /dev/null || sysctl -n hw.ncpu 2> /dev/null || echo 1`
Wouldn't it work in a Makefile by applying what you've got in src/Makefile.src to automatically detect the number of processors and make parallel builds as the default? (You probably already thought of that and decided against it, right?)
Title: Re: Getting started with development
Post by: a1ex on December 03, 2017, 07:46:03 PM
Overriding -j directly in the Makefile apparently worked in some older versions, but stopped working in newer ones. Found this workaround (https://stackoverflow.com/a/44478416), but seemed too complicated - ended up just printing a suggestion.

I compile often without modules, or with a single module enabled (for example, make 5D3.113_install_qemu ML_MODULES=silent). That's where you'll see the biggest speed-up. Modules are compiled sequentially (there are some unsolved dependencies) - that's what's slowing down the build process. After make clean, and after having all the files cached (i.e. not the first run), my times are:
- For the above command: 10s with -j1, 4.2s with -j4 and 3.6s with -j8.
- Without compiling any modules (make 5D3.113_install_qemu ML_MODULES=): 9.2, 3.3 and 2.7
- With the default set of modules (make 5D3.113_install_qemu): 33, 22, 21.

Enabling parallel build for modules (comment out .NOTPARALLEL in modules/Makefile) drops the last number to 9.5 seconds. Unfortunately this relies on a bug in the build system to work out the dependencies between modules (e.g. mlv_snd depends on mlv_rec, but mlv_snd compiles quicker, being simpler). For some reason, the modules are compiled twice (couldn't figure it out yet), and that happens to fix the missed dependencies for mlv_snd.

In any case, parallel build is not able to make things 4x as fast, as you would expect for a quad-core CPU, but it's getting close.

There's also CONFIG_CCACHE=y, which makes the build process *really* fast (0.3 seconds for make 5D3.113), although I didn't experiment much with it, and I'm unable to tell whether this caching is safe or not. It was broken before this PR.

For modules, the slowest step is getting its last changeset from Mercurial (each module is tagged with the last changeset that affected it directly).
Title: Re: Getting started with development
Post by: dfort on December 03, 2017, 08:08:24 PM
Figured you already thought of it. I thought running though the modules twice was a feature, not a bug. Guess it is necessary for parallel processing because of module dependencies.

Is this a good place for a feature request?

When running "make install" please also copy the ML-SETUP.FIR to the card.

That's another pet peeve of mine. Just now I installed ML on a card that I didn't realize didn't have the boot flag enabled on the card. Fortunately I found out before heading out because I wasn't taking my computer and card reader with me.
Title: Re: Getting started with development
Post by: a1ex on December 03, 2017, 09:53:25 PM
Good catch - solved that too (along with some other minor quirks).
Title: Re: Getting started with development
Post by: dfort on December 03, 2017, 10:37:08 PM
Another feature request -- make firmware update. Automatically updates the camera and ML to the latest Canon firmware.  :P
Title: Re: Getting started with development
Post by: a1ex on December 03, 2017, 11:21:22 PM
CHDK has it (http://chdk.wikia.com/wiki/CHDK-PT_:_A_tool_for_porting_CHDK_to_different_firmware_versions_of_the_same_camera) :D
Title: Re: Getting started with development
Post by: dfort on December 04, 2017, 12:06:07 AM
You know I was just kidding but someone did it--well almost. Some things still need to be found.

Code: [Select]
makefile.inc: MEMISOSTART will need updating if the size of canon DATA + BSS has changed. Hopefully that will not be the case across different version of firmware on the same camera
Sounds like what happened on the 5D3.135 update.

In any case, back on topic -- nice improvements on the build system.
Title: Re: Getting started with development
Post by: Danne on December 05, 2017, 04:31:37 PM
Ran the latest environment fixes:
Code: [Select]
hg clone -u makefile-updates https://bitbucket.org/hudson/magic-lantern
cd magic-lantern
make
# follow error messages, install dependencies and so on
Seemed to work:
https://bitbucket.org/Dannephoto/magic-lantern/downloads/Make.txt

But when trying to compile cr2hdr on my mac I get the same issues as before if not fixing the makefile.user file:
https://bitbucket.org/Dannephoto/magic-lantern/downloads/dual_iso.txt
Title: Re: Getting started with development
Post by: a1ex on December 05, 2017, 05:06:17 PM
Alright, so the build system itself is fine (hopefully not only on my system). You could try additional stuff, like "make install", "make zip", check if it builds the same thing as the "unified" branch (a bit hard to check, as we don't have fully reproducible builds - at least the date/time of each build will be different).

The warnings or errors you've got are not from the Makefiles.
Title: Re: Getting started with development
Post by: Danne on December 06, 2017, 07:02:45 AM
The issue is related to "Host compiler settings" on mac. Created a Makefile.user with following changes and cr2hdr compiles just fine:

source:
http://www.magiclantern.fm/forum/index.php?topic=16012.0

Code: [Select]
#
# Host compiler settings
#
HOST_CC=$(shell which gcc)
HOST_LD=$(shell which ld)
HOST_AR=$(shell which ar)

Code: [Select]
#
# Host compiler settings
#
HOST_CC=gcc-5
HOST_LD=gcc-5
HOST_AR=$(shell which ar)

cr2hdr is created and in terminal:
Code: [Select]
dans-MBP:dual_iso dan$ make cr2hdr
Using ~/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-gcc (preferred).
[ gcc-5    ]   cr2hdr
dans-MBP:dual_iso dan$

Will do some more testing make zip etc and post findings in this post.


Make zip
Code: [Select]
cd magic-lantern
time make -j8 zip

real 2m36.460s
user 3m38.229s
sys 0m40.887s
https://bitbucket.org/Dannephoto/magic-lantern/downloads/Make_J8.txt
vs
Code: [Select]
cd magic-lantern
time make zip
real 3m59.816s
user 3m13.599s
sys 0m40.220s
https://bitbucket.org/Dannephoto/magic-lantern/downloads/Make_zip.txt
Title: Re: Getting started with development
Post by: a1ex on December 06, 2017, 07:16:25 PM
Errors from "make zip" fixed in a289367.

Also checked whether "make -j8", both with old and new makefiles, compiles the same thing - the trick was to rename the branch so the metadata header has the same length as with unified, then compare the binaries with vbindiff. From my side, it's ready for including in mainline.

edit: merged!
Title: Re: Getting started with development
Post by: dfort on December 07, 2017, 10:19:21 PM
Finally got a chance to try it at work - HP Z840 running Windows 7 and Cygwin:

Code: [Select]
Tip: to compile faster, try one of these:
    make -j32
    export MAKEFLAGS='-j32'

Yeah, it is a monster.

From the top directory:
Code: [Select]
make EOSM      - 25 sec.
make -j32 EOSM -  4 sec.

Just running my phone as a stopwatch so it isn't very accurate.

So how about a full build?
Code: [Select]
make EOSM_zip      - 2 min. 24 sec.
make -j32 EOSM_zip - 1 min. 35 sec.

Not as dramatic but a big improvement. Cygwin isn't fast but it is super easy to setup and fairly non intrusive. I've run it on everything from an old 32-bit Vista laptop to this monster.



Title: Re: Getting started with development
Post by: Danne on December 07, 2017, 10:28:55 PM
Cool, speedy!
Has cygwin time installed? If so run i.e:
Code: [Select]
time make -j32 EOSMTo get specific processing times
Title: Re: Getting started with development
Post by: dfort on December 08, 2017, 12:00:42 AM
Nice trick!

Code: [Select]
time make EOSM
...
real    0m4.319s
user    0m0.733s
sys     0m2.750s

time make -j32 EOSM
...
real    0m3.697s
user    0m2.068s
sys     0m9.598s

time make EOSM_zip
...
real    2m23.027s
user    0m32.539s
sys     1m5.425s

time make -j32 EOSM_zip
...
real    1m34.908s
user    0m33.797s
sys     1m13.671s

So what does this mean? Looks like I was only measuring the "real" time.

Oh--wait. Seems there's some memory caching going on. Even though I was running "make clean" between builds these times are very different. Look at what happens if I run this in a new terminal:

Code: [Select]
time make -j32 EOSM_zip
...
Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x0000e0 0x0009e1e0 0x0009e1e0 0x656c8 0x78a34 RWE 0x100

[ CP       ]   EOSM_202.sym
[ CC       ]   version.o


[ CP       ]   install
../../platform/EOSM.202/version.c:5:12: error: redefinition of 'build_id'
 const char build_id[] = "97b73e7a781e (unified)";
            ^
../../platform/EOSM.202/version.c:2:12: note: previous definition of 'build_id' was here
 const char build_id[] = "97b73e7a781e (unified)";
            ^
../../platform/EOSM.202/version.c:6:12: error: redefinition of 'build_date'
 const char build_date[] ="2017-12-07 22:56:23 UTC";
            ^
../../platform/EOSM.202/version.c:3:12: note: previous definition of 'build_date' was here
 const char build_date[] ="2017-12-07 22:56:23 UTC";
            ^
../../platform/EOSM.202/version.c:7:12: error: redefinition of 'build_user'
 const char build_user[] = "dfort@QANTAS";
            ^
../../platform/EOSM.202/version.c:4:12: note: previous definition of 'build_user' was here
 const char build_user[] = "dfort@QANTAS";
            ^
make[2]: *** [../../Makefile.filerules:23: version.o] Error 1
make[2]: *** Waiting for unfinished jobs....
cp ML-SETUP.FIR /home/dfort/magic-lantern/platform/EOSM.202/zip/
[ VERSION  ]   ../../platform/EOSM.202/version.bin
[ OBJCOPY  ]   magiclantern.bin
[ STAT     ]   magiclantern.bin
magiclantern.bin: 415432 bytes
make[2]: Leaving directory '/home/dfort/magic-lantern/installer/EOSM.202'
make[1]: *** [../../platform/Makefile.platform.extras:52: installer_check] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/dfort/magic-lantern/platform/EOSM.202'
make: *** [Makefile:24: EOSM.202_zip] Error 2

real    0m4.113s
user    0m1.507s
sys     0m6.026s
Title: Re: Getting started with development
Post by: dfort on December 10, 2017, 03:49:24 AM
I discovered a slight issue with the new Makefile system. Doing a "make clean" in either the platform or the top directory will not clean out the installer directory. Not a big deal but it shows up in the SourceTree app which beginners like me are using:

(https://farm5.staticflickr.com/4568/38062103675_6fb9b511bf_z.jpg) (https://flic.kr/p/ZZqemP)
Title: Re: Getting started with development
Post by: a1ex on January 31, 2018, 01:13:55 AM
Solved both, and a few others I've found meanwhile:

https://bitbucket.org/hudson/magic-lantern/pull-requests/898/makefile-updates-part-2
Title: Re: Getting started with development
Post by: digiboy on November 26, 2018, 10:32:29 PM
Hi,
I use ubuntu 18.04.
I try compile and receive error:
~/MagicLantern/magic-lantern/platform/550D.109$ make install
Using /usr/bin/arm-none-eabi-gcc (from PATH).
[ MKDIR    ]   ML directory structure...
mkdir: cannot create directory ‘/ML’: Permission denied
../../Makefile.setup:149: recipe for target 'prepare_install_dir' failed
make: * [prepare_install_dir] Error 1

Do you know why script want create folder in /ML ?
Where I can change this default folder "/ML" to something else?
Title: Re: Getting started with development
Post by: a1ex on November 27, 2018, 11:01:23 AM
It could not figure out where your card is mounted. True, this can be handled a little nicer.

Try this:
Code: [Select]
make install CF_CARD=/media/EOS_DIGITAL     # path where your card is mounted, or any other directory

Or, "make zip" followed by manual installation.
Title: Re: Getting started with development
Post by: blp042 on January 14, 2019, 05:42:19 AM
I am a Linux noob.

I have just tried configuring an Ubuntu development environment for ML.
I compiled for 6D.116 no errors.
I compiled cr2hdr, no errors, and then tried running it.
I get this error:
cr2hdr: error while loading shared libraries: libm.so.6: cannot stat shared object: Error 38

I found libm.so.6:


blp@localhost:/$ ls -l /libx32/libm*
-rw-r--r--. 1 root root 1648376 Apr 16  2018 /libx32/libm-2.27.so
lrwxrwxrwx. 1 blp  blp       12 Apr 16  2018 /libx32/libm.so.6 -> libm-2.27.so

blp@localhost:/$ ls -l /lib32/libm*
-rw-r--r--. 1 root root 824864 Apr 16  2018 /lib32/libm-2.27.so
lrwxrwxrwx. 1 blp  blp      12 Apr 16  2018 /lib32/libm.so.6 -> libm-2.27.so


I don't know why I get the shared library error.
Does anyone have any help for me?