Magic Lantern Forum

Developing Magic Lantern => General Development => Topic started by: Strahlex on September 26, 2012, 07:12:54 PM

Title: Gettings started as developer
Post by: Strahlex on September 26, 2012, 07:12:54 PM
Hello ML developers,

I'm a hobby open source developer and electronic engineering student. As I'm quite familiar with C development and embedded systems, I wan't to join the ML development team. I have a EOS 7D, so I'm especially interested in porting ML to this DSLR. I already got ML classic to compile, but then I found out that ML Unified is the way to go. So can anybody please introduce my to the development community and help me getting started with development and testing?

Strahlex
Title: Re: Gettings started as developer
Post by: Marsu42 on September 26, 2012, 07:15:47 PM
Hello ML developers,

I'm a hobby open source developer and electronic engineering student. As I'm quite familiar with C development and embedded systems, I wan't to join the ML development team. I have a EOS 7D, so I'm especially interested in porting ML to this DSLR. I already got ML classic to compile, but then I found out that ML Unified is the way to go. So can anybody please introduce my to the development community and help me getting started with development and testing?

Strahlex

Just code away (maybe after getting feedback for your idea) and then do a mercurial pull request, that's what I just did with focus bracketing. But it's easier for me since ml already works on my 60d, little chance to brick it at this stage.
Title: Re: Gettings started as developer
Post by: a1ex on September 26, 2012, 07:22:08 PM
For 7D, you need to wait until G3gg0 publishes the boot hack. For other cameras, just compile and run.
Title: Re: Gettings started as developer
Post by: Strahlex on September 27, 2012, 12:40:34 AM
Yes, boot hack will be there in time (i hope).  Started by setting up the compiler and trying to compile ML. Got the following error:
Code: [Select]
boot-hack.o: In function `my_init_task':
boot-hack.c:(.text+0x14): relocation truncated to fit: R_ARM_PC24 against symbol `get_current_task' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x4c): relocation truncated to fit: R_ARM_PC24 against symbol `init_task' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x100): relocation truncated to fit: R_ARM_PC24 against symbol `msleep' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x128): relocation truncated to fit: R_ARM_PC24 against symbol `msleep' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x138): relocation truncated to fit: R_ARM_PC24 against symbol `msleep' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x154): relocation truncated to fit: R_ARM_PC24 against symbol `msleep' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x16c): relocation truncated to fit: R_ARM_PC24 against symbol `msleep' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x1e8): relocation truncated to fit: R_ARM_PC24 against symbol `task_create' defined in *ABS* section in magiclantern
boot-hack.o: In function `my_assert_handler':
boot-hack.c:(.text+0x234): relocation truncated to fit: R_ARM_PC24 against symbol `get_current_task' defined in *ABS* section in magiclantern
boot-hack.o: In function `my_big_init_task':
boot-hack.c:(.text+0x2b8): relocation truncated to fit: R_ARM_PC24 against symbol `call' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x2e8): additional relocation overflows omitted from the output
collect2: ld returned 1 exit status
make[1]: *** [magiclantern] Error 1
make[1]: Leaving directory `/home/alexander/projects/magic-lantern/platform/60D.111'
make: *** [60D] Error 2
Title: Re: Gettings started as developer
Post by: nanomad on September 27, 2012, 01:24:50 AM
It's a "feature" of magic lantern, do a make clean and re-compile :P
Title: Re: Gettings started as developer
Post by: adijiwa on September 27, 2012, 05:26:28 AM
Yes, boot hack will be there in time (i hope).  Started by setting up the compiler and trying to compile ML. Got the following error:
Code: [Select]
boot-hack.o: In function `my_init_task':
boot-hack.c:(.text+0x14): relocation truncated to fit: R_ARM_PC24 against symbol `get_current_task' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x4c): relocation truncated to fit: R_ARM_PC24 against symbol `init_task' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x100): relocation truncated to fit: R_ARM_PC24 against symbol `msleep' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x128): relocation truncated to fit: R_ARM_PC24 against symbol `msleep' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x138): relocation truncated to fit: R_ARM_PC24 against symbol `msleep' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x154): relocation truncated to fit: R_ARM_PC24 against symbol `msleep' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x16c): relocation truncated to fit: R_ARM_PC24 against symbol `msleep' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x1e8): relocation truncated to fit: R_ARM_PC24 against symbol `task_create' defined in *ABS* section in magiclantern
boot-hack.o: In function `my_assert_handler':
boot-hack.c:(.text+0x234): relocation truncated to fit: R_ARM_PC24 against symbol `get_current_task' defined in *ABS* section in magiclantern
boot-hack.o: In function `my_big_init_task':
boot-hack.c:(.text+0x2b8): relocation truncated to fit: R_ARM_PC24 against symbol `call' defined in *ABS* section in magiclantern
boot-hack.c:(.text+0x2e8): additional relocation overflows omitted from the output
collect2: ld returned 1 exit status
make[1]: *** [magiclantern] Error 1
make[1]: Leaving directory `/home/alexander/projects/magic-lantern/platform/60D.111'
make: *** [60D] Error 2

It seems you're using 64 bit compiler (CMIIW). You have to pass -mlong-calls parameter to compiler.
Title: Re: Gettings started as developer
Post by: Strahlex on September 27, 2012, 11:34:55 AM
It seems you're using 64 bit compiler (CMIIW). You have to pass -mlong-calls parameter to compiler.
You mean when compiling the arm-toolchain with gcc or when compiling ML with the arm-toolchain?
Title: Re: Gettings started as developer
Post by: nanomad on September 27, 2012, 11:54:33 AM
You compiled arm-toolchain on a 64 bit environment, try using a pre-built toolchain like https://launchpad.net/gcc-arm-embedded (it works on every major linux distribution)
Title: Re: Gettings started as developer
Post by: Strahlex on September 27, 2012, 02:41:18 PM
Where can I set what toolchain is used? I already would have a CodeSourcery arm toolchain installed for embedded systems development, maybe it would work. The prebuilt toolchain on launchpad has the same names, it probably would make problems to have them both installed.
Title: Re: Gettings started as developer
Post by: nanomad on September 27, 2012, 02:48:38 PM
Make a copy of Makefile.user.defaults, rename it to Makefile.user and edit the paths.
 There's no conflict between the toolchains as long as you keep them in separate folders (on the ML server I've got 3 and I can switch between them by editing the Makefile.user file)
Title: Re: Gettings started as developer
Post by: Strahlex on September 27, 2012, 08:58:28 PM
Well it seems to work, but now I get following errors:
Code: [Select]
[ CC       ]   ltablib.o
[ CC       ]   ltm.o
[ CC       ]   lundump.o
[ CC       ]   lvm.o
[ CC       ]   lzio.o
[ CC       ]   lua-handler.o
[ LD       ]   lua
[ OBJCOPY  ]   lua.bin.reloc
[ SYMTBLG  ]   lua.bin
sh: /home/alexander/arm-toolchain462/bin/arm-none-eabi-readelf: No such file or directory
Found 0 symbols
rm lua.bin.reloc
make[2]: Leaving directory `/home/alexander/projects/magic-lantern/plugins/lua'
make[2]: Entering directory `/home/alexander/projects/magic-lantern/plugins/testplug'
[ CC       ]   testplug.o
[ LD       ]   testplug
[ OBJCOPY  ]   testplug.bin.reloc
[ SYMTBLG  ]   testplug.bin
sh: /home/alexander/arm-toolchain462/bin/arm-none-eabi-readelf: No such file or directory
Found 0 symbols
rm testplug.bin.reloc
make[2]: Leaving directory `/home/alexander/projects/magic-lantern/plugins/testplug'
make[1]: Leaving directory `/home/alexander/projects/magic-lantern/plugins'
/home/alexander/arm-toolchain462/bin/ was my old directory
Title: Re: Gettings started as developer
Post by: Marsu42 on September 27, 2012, 09:07:28 PM
Well it seems to work, but now I get following errors

You have to edit plugins/symtblgen.rb too for the correct path to the toolchain. And please come up with a smart way for symtblgen.rb to pull the path from Makefile.user in the root directory and submit the solution as a pull request asap :->
Title: Re: Gettings started as developer
Post by: nanomad on September 27, 2012, 09:22:18 PM
You people are too lazy :P

Just kidding, I somehow overlooked a really simple solution  ::)

Do a hg pull && hg update and you're ready to go
Title: Re: Gettings started as developer
Post by: Marsu42 on September 27, 2012, 09:48:37 PM
Just kidding, I somehow overlooked a really simple solution  ::)

Thanks, and you're indeed correct, I was too lazy to look how the vars are relayed to the ruby script :-p
Title: Re: Gettings started as developer
Post by: Pelican on October 01, 2012, 04:01:50 PM
I'm trying to setup my computer to compile ML source again.
Once it worked fine I was able to compile ML code before but now I cannot.

I installed cygwin 1.7.16-1 with the setup.exe.
Installed yagarto-bu-2.21_gcc-4.6.2-c-c++_nl-1.19.0_gdb-7.3.1_eabi_20111119
Downloaded latest source code from bitbucket.
I changed Makefile.user.default ARM_ABI=none-eabi

$ make
make -C /home/Pel/magic-lantern/platform/60D.111
make[1]: Entering directory `/home/Pel/magic-lantern/platform/60D.111'
[ CPP      ]   magiclantern.lds
[ AS       ]   ../../src/entry.o
../../Makefile.inc:159: recipe for target `../../src/entry.o' failed
make[1]: *** [../../src/entry.o] Error 1
make[1]: Leaving directory `/home/Pel/magic-lantern/platform/60D.111'
Makefile:30: recipe for target `60D' failed
make: *** [60D] Error 2

What's wrong? Did I forget something?
Title: Re: Gettings started as developer
Post by: nanomad on October 01, 2012, 04:39:52 PM
- Never edit Makefile.user.default, place your custom settings in Makefile.user. This avoids conflicting changes in the repository
- Make sure that:
ARM_ABI and ARM_PATH are correct. You may have to edit the paths of the other executables too if cygwin expects windows-slash notation
If the build still fails it may be an incompatibility with cygwin. Paste the output of make V=1 in a code bbtag here and I'll see what I can do
Title: Re: Gettings started as developer
Post by: Pelican on October 01, 2012, 07:44:52 PM
Paste the output of make V=1 in a code bbtag here and I'll see what I can do

Code: [Select]
$ make V=1
make -C /home/Pel/magic-lantern/platform/60D.111
make[1]: Entering directory `/home/Pel/magic-lantern/platform/60D.111'
~/arm-toolchain462/bin/arm-none-eabi-gcc-4.6.2 -Wp,-MMD,../../src/.entry.o.d  -Wp,-MT,../../src/entry.o  -nostdlib  -fomit-frame-pointer  -fno-strict-aliasing -DCONFIG_MAGICLANTERN=1  -DCONFIG_60D=1  -DRESTARTSTART=0x0005f000  -DROMBASEADDR=0xFF010000  -DVERSION=\"v2.3.NEXT.2012Oct01.60D111\"  -DCONFIG_DEBUGMSG=0 -c -o ../../src/entry.o ../../src/entry.S
../../Makefile.inc:159: recipe for target `../../src/entry.o' failed
make[1]: *** [../../src/entry.o] Error 1
make[1]: Leaving directory `/home/Pel/magic-lantern/platform/60D.111'
Makefile:30: recipe for target `60D' failed
make: *** [60D] Error 2
Thanks in advance!

What is the recommended developing tool under Windows 7 x64?
Title: Re: Gettings started as developer
Post by: nanomad on October 01, 2012, 10:50:22 PM
I don't think anyone of us works under windows
Title: Re: Gettings started as developer
Post by: Pelican on October 02, 2012, 10:16:49 AM
I'm a little bit further now...

"make" cannot extract the neccessary objects from libc.a but I've extracted them manually and copy them to the specific folder.
The menuindex.py cannot open menuindex.txt but I could build an autoexec.bin for my 7D... and it's WORKING!!!
 
[/b]
Code: [Select]
$ make V=1
( echo const char build_version[] = v2.3.NEXT.2012Oct02.7D203
/bin/sh:  ; echo const: command not found
/bin/sh:  ; echo const: command not found
/bin/sh:  ; echo const: command not found
/bin/sh:  ; ) > ../../platform/7D.203/version.c: No such file or directory
~/arm-toolchain462/bin/arm-none-eabi-gcc-4.6.2 -Wp,-MMD,./.version.o.d  -Wp,-MT,version.o  -nostdlib  -fomit-frame-pointer  -fno-strict-aliasing  -DCONFIG_MAGICLANTERN=1  -DCONFIG_7D=1  -DRESTARTSTART=0xC80100  -DROMBASEADDR=0xFF010000  -DVERSION=\"v2.3.NEXT.2012Oct02.7D203\"  -DCONFIG_DEBUGMSG=0    -Os  -Wall  -W  -mstructure-size-boundary=32  -Wno-unused-parameter  -Wno-implicit-function-declaration  -Wno-unused-function  -Wno-missing-field-initializers  -Wno-format  -std=gnu99  -D__ARM__  -I.  -I../../src    -c -o version.o ../../platform/7D.203/version.c
cd ../../doc; python2 menuindex.py
Could not open menuindex.txt
mkdir: cannot create directory `cam': File exists
~/arm-toolchain462/bin/arm-none-eabi-gcc-4.6.2 -Wp,-MMD,./.menuindex.o.d  -Wp,-MT,menuindex.o  -nostdlib  -fomit-frame-pointer  -fno-strict-aliasing  -DCONFIG_MAGICLANTERN=1  -DCONFIG_7D=1  -DRESTARTSTART=0xC80100  -DROMBASEADDR=0xFF010000  -DVERSION=\"v2.3.NEXT.2012Oct02.7D203\"  -DCONFIG_DEBUGMSG=0    -Os  -Wall  -W  -mstructure-size-boundary=32  -Wno-unused-parameter  -Wno-implicit-function-declaration  -Wno-unused-function  -Wno-missing-field-initializers  -Wno-format  -std=gnu99  -D__ARM__  -I.  -I../../src    -c -o menuindex.o ../../src/menuindex.c
~/arm-toolchain462/bin/arm-none-eabi-gcc-4.6.2 -o magiclantern -N -nostdlib -mthumb-interwork -march=armv5te -T magiclantern.lds ../../src/entry.o boot-hack.o stubs.o version.o bmp.o font-dyn.o config.o menu.o debug.o stdio.o audio.o bitrate.o property.o propvalues.o gui.o gui-common.o misc.o tweaks.o lens.o picstyle.o cfn.o zebra.o shoot.o chdk-gui_draw.o movtweaks.o my_memset.o menuhelp.o menuindex.o af_patterns.o focus.o notify_box.o bootflags.o dialog_test.o vram.o morse.o aj_port.o fps-engio.o hdr.o lv-img-engio.o state-object.o tasks.o beep.o ptp.o ptp-ml.o ptp-chdk.o libstdio.a -lm -lgcc -Xlinker -Map=location.map
~/arm-toolchain462/bin/arm-none-eabi-objcopy -O binary magiclantern magiclantern.bin
~/arm-toolchain462/bin/arm-none-eabi-gcc-4.6.2 -Wp,-MMD,./.reboot.o.d  -Wp,-MT,reboot.o  -nostdlib  -fomit-frame-pointer  -fno-strict-aliasing  -DCONFIG_MAGICLANTERN=1  -DCONFIG_7D=1  -DRESTARTSTART=0xC80100  -DROMBASEADDR=0xFF010000  -DVERSION=\"v2.3.NEXT.2012Oct02.7D203\"  -DCONFIG_DEBUGMSG=0    -Os  -Wall  -W  -mstructure-size-boundary=32  -Wno-unused-parameter  -Wno-implicit-function-declaration  -Wno-unused-function  -Wno-missing-field-initializers  -Wno-format  -std=gnu99  -D__ARM__  -I.  -I../../src    -c -o reboot.o ../../src/reboot.c
~/arm-toolchain462/bin/arm-none-eabi-gcc-4.6.2 -o autoexec -nostdlib -march=armv5te -e _start -Ttext 0x40800000 reboot.o -Xlinker --cref -Xlinker -Map=autoexec.map
autoexec.bin: 315392 bytes

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000060 0x00c80100 0x00c80100 0x4a8bd 0x55d8b RWE 0x10

~/arm-toolchain462/bin/arm-none-eabi-objcopy -O binary autoexec autoexec.bin

Edit:

Code: [Select]
$ ~/arm-toolchain462/bin/arm-none-eabi-ar x /home/Pel/arm-toolchain462/arm-none-eabi/lib/libc.a lib_a-setjmp.o
/home/Pel/arm-toolchain462/arm-none-eabi/lib/libc.a: No such file or directory
D:\util\cygwin\home\Pel\arm-toolchain462\bin\arm-none-eabi-ar.exe:

$ ls /home/Pel/arm-toolchain462/arm-none-eabi/lib/libc.a                           
/home/Pel/arm-toolchain462/arm-none-eabi/lib/libc.a
Title: Re: Gettings started as developer
Post by: Pelican on October 07, 2012, 04:54:51 PM
For those who want to develop under Windows:


Download cygwin http://cygwin.com/setup.exe (http://cygwin.com/setup.exe)

Install cygwin for windows
- Check the following packages:
Archive: unzip, zip
Base: Everything
Devel: automake, autoconf, binutils, bison, byacc, gcc, gcc-core, gcc-g++, libtool, make, nasm, patchutils, subversion
Libs: libbz2-devel
Perl: perl
Python: python
Utils: bzip2, cygutils, diffutils, patch, patchutils
Web: wget
- confirm to download the dependencies too

Get http://sourceforge.net/projects/yagarto/files/YAGARTO%20for%20Windows/20111119/yagarto-bu-2.21_gcc-4.6.2-c-c%2B%2B_nl-1.19.0_gdb-7.3.1_eabi_20111119.exe/download (http://sourceforge.net/projects/yagarto/files/YAGARTO%20for%20Windows/20111119/yagarto-bu-2.21_gcc-4.6.2-c-c%2B%2B_nl-1.19.0_gdb-7.3.1_eabi_20111119.exe/download) file and run it
Install it to "yourcygwindir"/home/"yourusername"/arm-toolchain462

Download http://mercurial.selenic.com/release/windows/mercurial-2.3.2-x64.msi (http://mercurial.selenic.com/release/windows/mercurial-2.3.2-x64.msi) and install it.
 (If you have a 32-bit Windows then download the 32 bit mercurial here : http://mercurial.selenic.com/release/windows/mercurial-2.3.2-x86.msi (http://mercurial.selenic.com/release/windows/mercurial-2.3.2-x86.msi) )
Start cygwin, go to your home folder ("yourcygwindir"/home/"yourusername") and get the source:

hg clone -r unified https://bitbucket.org/hudson/magic-lantern (https://bitbucket.org/hudson/magic-lantern)

Go to the magic-lantern folder and create Makefile.user
Edit Makefile.user:
ARM_ABI=none-eabi
ARM_LIBC_A=../../../arm-toolchain462/arm-none-eabi/lib/libc.a
PYTHON=python2.6

Run make to compile your own autoexec.bin
Title: Re: Gettings started as developer
Post by: ilguercio on October 07, 2012, 07:14:28 PM
So basically, if i follow these guidelines i can build my own autoexec.bin without knowing a thing about developing?
Title: Re: Gettings started as developer
Post by: ilguercio on October 07, 2012, 11:42:13 PM
I still haven't finished with the installing. Meanwhile, you or any mod could merge your post to the thread in sticky so any windows user can find this bit of precious info in a second.
;)
Title: Re: Gettings started as developer
Post by: ilguercio on October 07, 2012, 11:50:45 PM
By the way, i'm lost.
I installed cygwin, downloaded all the packages and waited for it to complete (a loooong time) .
After the installation was completed i installed mercurial and then i installed yagarto.
As it asked me for the directory i entered what you said even though there wasn't any directory yet (so i guess i had to create it for some reason) .
Now i am in the terminal and can't go on, i need some help, maybe a step to step tutorial.
(https://www.magiclantern.fm/forum/proxy.php?request=https%3A%2F%2Fdl.dropbox.com%2Fu%2F1087972%2FML%2Fcygwin.jpg&hash=a029c59938cedb32a5730232315128e8)
Title: Re: Gettings started as developer
Post by: ilguercio on October 08, 2012, 12:09:17 AM
Ok, i made sure i was running the application as admin.
Downloaded source code.
Now i created makefile.user and set the stuff pelican said.
has ARM_LIBC_A= to be the complete windows path?
I entered C:/cygwin/home/Giovanni/arm-toolchain462/arm-none-eabi/lib/libc.a
Now i try to make and it says there's no operation to make.
What am i doing wrong?
$ make magic-lantern/Makefile.user
Title: Re: Gettings started as developer
Post by: ilguercio on October 09, 2012, 09:45:46 PM
Ok, command "cd" worked to enter ML folder but now i get an error as i try to "make"

$ make
make -C /home/Giovanni/magic-lantern/platform/60D.111
make[1]: ingresso nella directory "/home/Giovanni/magic-lantern/platform/60D.111"
../../Makefile.inc:258: *** il modello dell'obiettivo non contiene alcun "%".  Arresto.
make[1]: uscita dalla directory "/home/Giovanni/magic-lantern/platform/60D.111"
Makefile:30: recipe for target `60D' failed
make: *** [60D] Error 2

It's in italian, if anybody knows how to revert it to english it would be better for me as well.
Title: Re: Gettings started as developer
Post by: 1% on October 09, 2012, 10:28:21 PM
Save headaches and performance issues and just run a VM of 32 bit linux.

https://www.virtualbox.org/wiki/Downloads

Then download pre built arm compiler
https://launchpad.net/gcc-arm-embedded

I think 4.6

Its more shit to download/setup but cygwin always gives me headaches.

Also, do you have 60D? Just do make for your camera. make 60D, make 550D, make 600D, etc

*** il modello dell'obiettivo non contiene alcun "%".  Arresto.

This says some file not found. Do you have all the stuff in ML folder. I know sometimes mercurial just downloads the "source" and not the whole tree. Should be like 16-30mb
Title: Re: Gettings started as developer
Post by: ilguercio on October 09, 2012, 10:39:33 PM
Tried to compile for 50D only but got the same error.
It's not a problem for me to install a linux distro but it would take time to get used to it.
ML folder is 26.6MB so it should be ok.
Title: Re: Gettings started as developer
Post by: 1% on October 09, 2012, 10:45:23 PM
Pastebin your makefile.user.default and makefile.user
Title: Re: Gettings started as developer
Post by: ilguercio on October 09, 2012, 10:46:23 PM
http://dl.dropbox.com/u/1087972/ML/Makefile.user

http://dl.dropbox.com/u/1087972/ML/Makefile.user.default

Ok, found the error, the path was written in a wrong manner. It's compiling now.
ARM_LIBC_A=cygwin/home/Giovanni/arm-toolchain462/arm-none-eabi/lib/libc.a
Got me a little further but i still have some errors. What about the drive letter?
Title: Re: Gettings started as developer
Post by: 1% on October 09, 2012, 10:50:29 PM
You never set the path to the compiler:

ARM_PATH=~/arm-toolchain462 << wherever that is goes here.

I see... path structure is the same:

~/arm-toolchain462/arm-none-eabi/lib/libc.a

or keep  $(ARM_PATH)/arm-$(ARM_ABI)/lib/libc.a
Title: Re: Gettings started as developer
Post by: ilguercio on October 09, 2012, 10:56:38 PM
You never set the path to the compiler:

ARM_PATH=~/arm-toolchain462 << wherever that is goes here.

I see... path structure is the same:

~/arm-toolchain462/arm-none-eabi/lib/libc.a

or keep  $(ARM_PATH)/arm-$(ARM_ABI)/lib/libc.a
So it's like this

ARM_ABI=none-eabi
$(ARM_PATH)/arm-$(ARM_ABI)/lib/libc.a
ARM_LIBC_A=c/cygwin/homeGiovanni/arm-toolchain462/arm-none-eabi/lib/libc.a
PYTHON=python2.6

But what about the line in red? Is it right given that the path is correct? What's the correct syntax?
I just followed pelican's guidelines. If something is missing, please tell me.
Also, do i have to put the entire directory like C:/....?
Title: Re: Gettings started as developer
Post by: 1% on October 09, 2012, 11:00:31 PM
Don't set either of those and try it. If it finds the compiler, it should find libc

just do:
ARM_ABI=none-eabi
PYTHON=python2.6
Title: Re: Gettings started as developer
Post by: ilguercio on October 09, 2012, 11:03:25 PM
Nope, it doesn't work.

Giovanni@Giovanni-PC ~/magic-lantern
$ make 50D
make -C /home/Giovanni/magic-lantern/platform/50D.109
make[1]: ingresso nella directory "/home/Giovanni/magic-lantern/platform/50D.109                                                                                                    "
[ VERSION  ]   ../../platform/50D.109/version.c
[ CC       ]   version.o
cd ../../doc; python2.6  menuindex.py
Could not open menuindex.txt
mkdir: impossibile creare la directory "cam": File exists
[ CC       ]   menuindex.o
[ AR       ]   lib_a-setjmp.o
/home/Giovanni/arm-toolchain462/arm-none-eabi/lib/libc.a: No such file or direct                                                                                                    ory
C:\cygwin\home\Giovanni\arm-toolchain462\bin\arm-none-eabi-ar.exe: ../../Makefil                                                                                                    e.inc:259: recipe for target `lib_a-setjmp.o' failed
make[1]: *** [lib_a-setjmp.o] Error 9
make[1]: uscita dalla directory "/home/Giovanni/magic-lantern/platform/50D.109"
Makefile:42: recipe for target `50D' failed
make: *** [50D] Error 2
Title: Re: Gettings started as developer
Post by: 1% on October 09, 2012, 11:06:53 PM
It looks like its looking in the right folder. But is there a libc.a in that folder?
Title: Re: Gettings started as developer
Post by: ilguercio on October 09, 2012, 11:10:19 PM
Yes, there is, that's why i can't understand it.
:S
http://dl.dropbox.com/u/1087972/ML/libc.jpg
I did a make clean and then a make, it did something then but the same error pops up.
Title: Re: Gettings started as developer
Post by: 1% on October 09, 2012, 11:12:33 PM
Try:

ARM_LIBC_A=/home/Giovanni/arm-toolchain462/arm-none-eabi/lib/libc.a

then

ARM_LIBC_A=../../../arm-toolchain462/arm-none-eabi/lib/libc.a

then

ARM_LIBC_A=../../arm-toolchain462/arm-none-eabi/lib/libc.a

Could also do:

ARM_LIBC_A=../arm-toolchain462/arm-none-eabi/lib/libc.a

if only 1 level deep
Title: Re: Gettings started as developer
Post by: ilguercio on October 09, 2012, 11:20:53 PM
Same stuff, the directories are right but i always end up with

make[1]: ***  Nessuna regola per generare l'obiettivo "../arm-toolchain462/arm-none-eabi/lib/libc.a", necessario per "lib_a-setjmp.o".  Arresto.
make[1]: uscita dalla directory "/home/Giovanni/magic-lantern/platform/50D.109"
Makefile:42: recipe for target `50D' failed
make: *** [50D] Error 2
Title: Re: Gettings started as developer
Post by: ilguercio on October 09, 2012, 11:49:36 PM
Now:

$ make 50D
make -C /home/Giovanni/magic-lantern/platform/50D.109
make[1]: ingresso nella directory "/home/Giovanni/magic-lantern/platform/50D.109                                                                                                    "
[ VERSION  ]   ../../platform/50D.109/version.c
[ CC       ]   version.o
cd ../../doc; python2.6  menuindex.py
Could not open menuindex.txt
mkdir: impossibile creare la directory "cam": File exists
[ CC       ]   menuindex.o
[ AR       ]   lib_a-setjmp.o
[ AR       ]   libstdio.a
[ LD       ]   magiclantern
[ OBJCOPY  ]   magiclantern.bin
[ CC       ]   reboot.o
[ LD       ]   autoexec
stat: impossibile eseguire stat di "autoexec.bin": No such file or directory

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000060 0x0004b000 0x0004b000 0x46931 0x523d4 RWE 0x10

[ OBJCOPY  ]   autoexec.bin
make[1]: uscita dalla directory "/home/Giovanni/magic-lantern/platform/50D.109"

 ???
Title: Re: Gettings started as developer
Post by: ilguercio on October 09, 2012, 11:55:42 PM
Well, looks like it was ok.
Autoexec was generated, i'm running it.
Thanks Pelican and 1% for the support.
If you copy exactly what Pelican posted you should be fine.
;)
What is the command if i just want to update ML folder?
I can't use hg clone again.
Title: Re: Gettings started as developer
Post by: nanomad on October 10, 2012, 01:29:37 AM
hg pull (download changes from bitbucket)
then
hg update (merge all changes with your current code)
Title: Re: Gettings started as developer
Post by: ilguercio on October 10, 2012, 01:41:06 AM
Thanks, now i'm perfectly comfortable with building an autoexec.
I should boost my poor knowledge in C and see if i can do someting simple or just understand the code. This whole thing is interesting.
Title: Re: Gettings started as developer
Post by: ilguercio on October 11, 2012, 02:02:00 PM
Here i am, bothering you again.
Since i made a bit of a mess with the code yesterday, trying to solve a bug with A1ex, i decided to do a clean copy of the repo. Kept my makefile.user. but now i get quite a few errors at compiling.
They're not strictly related to the compiler, i guess...

http://dl.dropbox.com/u/1087972/ML/compile_errors.jpg
Title: Re: Gettings started as developer
Post by: nanomad on October 11, 2012, 02:12:38 PM
There are no errors in your screen, just warnings (beacuse we are lazy developers)
Title: Re: Gettings started as developer
Post by: ilguercio on October 11, 2012, 02:16:47 PM
There are no errors in your screen, just warnings (beacuse we are lazy developers)
Ok, nice, i shouldn't be worried since it compiled, in fact.
Are those recent stuff? I bet those warnings weren't there yesterday.
:P
Title: Re: Gettings started as developer
Post by: nanomad on October 11, 2012, 02:29:53 PM
They disappear if you don't do a make clean or don't edit the corresponding .c file since Make is smart enough not to recompile them
Title: Re: Gettings started as developer
Post by: ilguercio on October 11, 2012, 02:35:05 PM
Yeah, just noticed that  ;D
Title: Re: Gettings started as developer
Post by: Pelican on October 13, 2012, 11:09:18 PM
ilguercio: Sorry, I didn't check this thread... but you finally solved the problem.
(The correct format to the directory drive:\dir1\dir2 => /cygdrive/drive/dir1/dir2)


I have questions too:
Is there any way to copy the autoexec.bin directly to the card inside the camera?
If I change something how can I commit/merge it to the main source?
And what about quality checking? Is there anybody who checks the code? Are there any rules for the developers?

Title: Re: Gettings started as developer
Post by: ilguercio on October 13, 2012, 11:18:22 PM
No problem, Pel, i just copied everything as you posted it and it worked.
Title: Re: Gettings started as developer
Post by: a1ex on October 13, 2012, 11:23:36 PM
@Pel:

1: http://magiclantern.wikia.com/wiki/PTP-CHDK (there are newer patches on this forum)

2: if you change something, you can create your own fork, and submit pull requests (recommended method - you also get proper credit on the repo).

3: there are built-in tests in debug menu, and anyone can review the code as it's posted. Basically, interfere as little as you can with Canon tasks (don't make them wait, for example), return quickly from prop handlers (don't take semphores and stuff from there), avoid buffer overflows, be careful with properties (they are saved in ROM and could brick the camera - see http://magiclantern.wikia.com/wiki/Unbricking for my mistakes)...
Title: Re: Gettings started as developer
Post by: 1% on October 13, 2012, 11:48:33 PM
Quote
Is there any way to copy the autoexec.bin directly to the card inside the camera?

Miyake tried to make something like this w/ PTP but it wouldn't transfer everything. Never figured out why, the thread is on here somewhere.
Title: Re: Gettings started as developer
Post by: Pelican on October 14, 2012, 12:28:29 AM
2: if you change something, you can create your own fork, and submit pull requests (recommended method - you also get proper credit on the repo).
Thank you.
- I've made my fork, and clone it with hg clone https://Pelican@bitbucket.org/Pelican/magic-lantern-pel (https://Pelican@bitbucket.org/Pelican/magic-lantern-pel)
to my computer but I've got the original ML source even if I set Fork at: unified
then get  with hg clone -r unified https://Pelican@bitbucket.org/Pelican/magic-lantern-pel (https://Pelican@bitbucket.org/Pelican/magic-lantern-pel)
- edit platform/7D.203/misc.c
- make autoexec.bin, checked in my camera, it was OK
- hg push: it says no changes found
What am I doing wrong? How to push my changes?
Title: Re: Gettings started as developer
Post by: a1ex on October 14, 2012, 12:32:41 AM
You need to commit first.
Title: Re: Gettings started as developer
Post by: Pelican on October 14, 2012, 12:47:03 AM
You need to commit first.
Thanks. I figured out meanwhile...  :) 

Title: Re: Gettings started as developer
Post by: Pelican on October 14, 2012, 10:54:14 AM
There was a property change monitor in an older ML version.

How can I activate that function in my fork?
I want to know the AF points values.
Edit: I've got it. I changed a wrong source until now... ::) 
Title: Re: Gettings started as developer
Post by: Pelican on October 14, 2012, 03:26:50 PM
Can I undo commit?
I forgot to remove the debug messages at first...
Title: Re: Gettings started as developer
Post by: g3gg0 on October 14, 2012, 03:51:07 PM
you cann 'rollback' the last commit you made to your local repository.
if that doesnt work anymore, just commit the reverted file afterwards.
Title: Re: Gettings started as developer
Post by: g3gg0 on October 14, 2012, 03:55:02 PM
nice changes!

btw i recommend *not* to alter that spaces in blank lines.
some text editors treat it this, others the other way.

so we would change it forth and back all the time :)
and this makes the patches unreadable.
Title: Re: Gettings started as developer
Post by: nanomad on October 14, 2012, 04:14:47 PM
As an unwritten rule, ML uses 4 spaces soft-tab indenting (except for Makefiles), so no real tab characters. Remove any trailing white-spaces if you find any :P
Title: Re: Gettings started as developer
Post by: g3gg0 on October 14, 2012, 04:24:47 PM
As an unwritten rule, ML uses 4 spaces soft-tab indenting (except for Makefiles), so no real tab characters. Remove any trailing white-spaces if you find any :P

basically true, but i would not mix that with code changes in one commit, as it will make merging harder.
Title: Re: Gettings started as developer
Post by: Pelican on October 14, 2012, 04:30:49 PM
I've made a mess, so I've created another fork and start over. I think I can survive now.
My editor deleted all the trailing spaces but I agree with g3gg0, it's hard to follow the changes if every line changed...

Maybe we can do a big cleaning, just to remove all of them.
Title: Re: Gettings started as developer
Post by: nanomad on October 14, 2012, 04:44:50 PM
Yeah, I'd love to do that  ::)
Title: Re: Gettings started as developer
Post by: Pelican on October 14, 2012, 04:57:08 PM
I can do that if everybody agree...


One thing is still not so clear for me.
If I have a fork and during I change something in my code somebody else commit a change to the main repository then what should I do?
I tried to merge the change but the mercurial treated that as my developing and when I commit it put as my change.
Title: Re: Gettings started as developer
Post by: nanomad on October 14, 2012, 05:18:41 PM
That's how it works, every time you merge, you commit because you arrived "late"
Title: Re: Gettings started as developer
Post by: a1ex on October 14, 2012, 05:25:59 PM
To avoid those merges, you need to remember to pull the latest changes before you commit anything.
Title: Re: Gettings started as developer
Post by: ilguercio on November 08, 2012, 06:50:36 PM
Giovanni@Giovanni-PC ~/magic-lantern
$ make 50D
make -C /home/Giovanni/magic-lantern/platform/50D.109
make[1]: ingresso nella directory "/home/Giovanni/magic-lantern/platform/50D.109                                                                                                    "
[ VERSION  ]   ../../platform/50D.109/version.c
[ CC       ]   version.o
cd ../../doc; python2.6  menuindex.py
Could not open menuindex.txt, will not rewrite help index files
[ CC       ]   menuindex.o
[ LD       ]   magiclantern
boot-hack.o: In function `my_big_init_task':
boot-hack.c:(.text+0x36c): undefined reference to `_init_funcs_start'
boot-hack.c:(.text+0x370): undefined reference to `_init_funcs_end'
boot-hack.c:(.text+0x37c): undefined reference to `_tasks_start'
boot-hack.c:(.text+0x380): undefined reference to `_tasks_end'
boot-hack.o: In function `my_task_dispatch_hook':
boot-hack.c:(.text+0x3f0): undefined reference to `_task_overrides_end'
boot-hack.c:(.text+0x3f4): undefined reference to `_task_overrides_start'
boot-hack.o: In function `copy_and_restart':
boot-hack.c:(.text+0x514): undefined reference to `_bss_end'
boot-hack.c:(.text+0x518): undefined reference to `_bss_start'
config.o: In function `config_save_file':
config.c:(.text+0x218): undefined reference to `_config_vars_start'
config.c:(.text+0x21c): undefined reference to `_config_vars_end'
config.o: In function `config_parse':
config.c:(.text+0x4f4): undefined reference to `_config_vars_end'
config.c:(.text+0x4f8): undefined reference to `_config_vars_start'
config.o: In function `get_config_vars_start':
config.c:(.text+0x5a4): undefined reference to `_config_vars_start'
config.o: In function `get_config_vars_end':
config.c:(.text+0x5b0): undefined reference to `_config_vars_end'
property.o: In function `prop_init':
property.c:(.text+0xc8): undefined reference to `_prop_handlers_start'
property.c:(.text+0xcc): undefined reference to `_prop_handlers_end'
property.o: In function `global_property_handler':
property.c:(.text+0x160): undefined reference to `_prop_handlers_start'
property.c:(.text+0x164): undefined reference to `_prop_handlers_end'
collect2: ld returned 1 exit status
../../Makefile.inc:266: recipe for target `magiclantern' failed
make[1]: *** [magiclantern] Error 1
make[1]: uscita dalla directory "/home/Giovanni/magic-lantern/platform/50D.109"
Makefile:44: recipe for target `50D' failed
make: *** [50D] Error 2

Same old makefile, i have just pulled the latest changesets and now i can't compile anymore.
Why?
Usual cygwin on 7 x64.
Title: Re: Gettings started as developer
Post by: nanomad on November 08, 2012, 06:56:17 PM
Have tried doing a make clean + make again?
Title: Re: Gettings started as developer
Post by: ilguercio on November 08, 2012, 07:01:29 PM
Have tried doing a make clean + make again?
Uhm, i did that yesterday and didn't help.
Now it seems to be working. Sorry boys.
 :-\
Just a question, since you're here. If i happen to make any change to code on my copy of source and later i want to pull the changesets from the repo what should i do? I will be encountering conflicts and it tells me to just hg resolve -- mark.
Is that enough?
Also, now:
Code: [Select]
Giovanni@Giovanni-PC ~/magic-lantern
$ make 50D
make -C /home/Giovanni/magic-lantern/platform/50D.109
make[1]: ingresso nella directory "/home/Giovanni/magic-lantern/platform/50D.109"
../../Makefile.inc:145: *** separatore  mancante.  Arresto.
make[1]: uscita dalla directory "/home/Giovanni/magic-lantern/platform/50D.109"
Makefile:44: recipe for target `50D' failed
make: *** [50D] Error 2
Title: Re: Gettings started as developer
Post by: nanomad on November 08, 2012, 07:13:47 PM
You need to merge the changes (hg merge after update)
Title: Re: Gettings started as developer
Post by: ilguercio on November 08, 2012, 07:15:52 PM
You need to merge the changes (hg merge after update)
Code: [Select]
$ hg merge
abortito: branch 'unified' has one head - please merge with an explicit rev
(run 'hg heads' to see all heads)
I know you're hating me, i will understand a bit more after this.
 :D
Title: Re: Gettings started as developer
Post by: nanomad on November 08, 2012, 07:29:28 PM
Yeah because you already marked conflicts as resolved without resolving them...which probably means you screwed up your local copy
Title: Re: Gettings started as developer
Post by: a1ex on November 08, 2012, 07:32:35 PM
Maybe you could export your changes as a patch (hg diff > my.patch) and then apply them on a fresh clone (patch -p1 < my.patch).
Title: Re: Gettings started as developer
Post by: ilguercio on November 08, 2012, 07:44:03 PM
Yeah because you already marked conflicts as resolved without resolving them...which probably means you screwed up your local copy
Did everything from scratch again.
Nice suggestion a1ex, i'm starting to understand the whole thing bit by bit and i guess eventually i will have a decent amount of control over it.
Thanks to you all for the help, i know i'm being the black sheep working on Windows 7 :D
Title: Re: Gettings started as developer
Post by: scrax on November 09, 2012, 07:04:51 AM
I'm used to always compile my test with:
Code: [Select]
make clean; make 600D; cp ~/magic-lantern/platform/600D.102/autoexec.bin /Volumes/EOS_DIGITAL ; hdiutil unmount /Volumes/EOS_DIGITAL/
can someone, please, explain me when just use:
Code: [Select]
make 600;instead of
Code: [Select]
make clean; make 600D;
Title: Re: Gettings started as developer
Post by: nanomad on November 09, 2012, 10:13:55 AM
Clean deletes object files (.o) and starts from scratch while make alone tries to compile only the .c files that were modified since the last make was run. It's always best to run make clean when you pull a new revision or when you edit a file that's not a .c one
Title: Re: Gettings started as developer
Post by: Pelican on January 01, 2013, 02:48:12 PM
Until now I can use my fork to develop but now when my commits merged manually to the main repo I've lost.
I've just started a new fork, because cannot fix the old one.
Could somebody write here the whole process of mercurial?
I'm starting with how I did until now and I will update this reply with your comments to make a tutorial for beginners (like me).
----------------------
Step 1. Get your fork to your local folder (don't forget "-r unified" and go to your personal folder first)
hg clone -r unified https://"USERNAME"@bitbucket.org/"USERNAME"/"FORKNAME"
(obviously write your username and forkname instead of "USERNAME" and "FORKNAME")
(maybe you can use https://bitbucket.org/ (https://bitbucket.org/)"USERNAME"/"FORKNAME", I'm not sure)
Step 2. Develop the code

Step 3. Get the latest changes

hg pull -r unified https://bitbucket.org/hudson/magic-lantern (https://bitbucket.org/hudson/magic-lantern)
hg update
If any conflicts there you should fix that first.  (Is there an easy way?)
Step 4. Commit your changes

hg commit -u "USERNAME" -m "Short description about your changes"
Step 5. Update your fork with your commited changes

hg push -r unified https://bitbucket.org/ (https://bitbucket.org/)"USERNAME"/"FORKNAME"
It will ask your username and password.


Until now I can work with these commands but now I couldn't push my changes.
There is a command, hg merge which I never used. When I should use it?
Title: Re: Gettings started as developer
Post by: scrax on January 01, 2013, 04:26:04 PM
I have problem too in understanding how mercurial works, specially for the pull request.
After a first period using terminal only i've switched to a gui app

On osx I use Source Tree as GUI for hg.
Step 1
From bitbucket on ML pages press clone button and chose clone in SourceTree, and then i select "tip" as the branch to update when cloning.
ST will fork and update the fork
Step 2 Make changes
Step 3 Commit changes, pull from ML, update the fork, merge ML code with the one of the fork
Step 4 If the Merge has conflicts to solve them I select resolve with external merger tool in SourceTree and it will load the two version in FileMerge (a gui app that shows diff). 90% of times FileMerge solves the conflicts without the need to make nothing.
Step 5 Pull Request.

The problem I have is that so far I can't make a pull request of only some commits I did to my fork, leaving out things that I use but are not good in the stable release, or because there is something that don't works good and so on. As a workaround I've started to make a clone for each feat request i'll do, and then manually add to it only those commits from my principal fork I want to pull.
Title: Re: Gettings started as developer
Post by: nanomad on January 01, 2013, 04:41:32 PM
You are supposed to make forks (or patch queques as bitbucket calls them) for each feature and ask for a pull request on that
Title: Re: Gettings started as developer
Post by: scrax on January 01, 2013, 04:59:35 PM
You are supposed to make forks (or patch queques as bitbucket calls them) for each feature and ask for a pull request on that

This is ok but my problem is that I'm not always working on a feat at time, for example CUSTOM_MODES and DIALOG_OPTION are related since they share some part of code (since what they do and show change when one of the two is not active).
Also during the develop could happen that I'll make minor changes like renaming a label, that are unrelated at all with the feat.
This will bring me to a fork that to be pulled needs to be divided in 2 or 3 pull request.
Actually I have to make two other fork, and manually go back on my fork looking at each commit and redo it manually on the new fork.
WIth small changes it's not a problem, but for example for pull request #39, how can i separe things from it?

Another problem is with the differences growing until the pull request is accepted. After the pull request i've done other changes to the function pulled and also ML code changes, so this could make conflict with the pull request and having the pull request in another fork is blocking me from updating the changes that are on my main forkthat has also other new features I'm tring to add (so they have not to be pulled yet).

I can't work on 3 fork with 3 different feat being developed, since I'll not know if the feat are working good together.

For me it will be more easy if there is a way to pull request only some commit I did, instead of the diff from my fork and the main tree. Maybe saving the commit as a patch and the use that for the pull request but don't know how.
Title: Re: Gettings started as developer
Post by: scrax on January 01, 2013, 06:08:47 PM
... ML code changes, so this could make conflict with the pull request...

Seems i've called it  :-\ ,
pull request #39 now is conflicting with main tree cause the fix merged from mee ok. So i have to remove it again, make a new fork, make all the changes again manually and then again submit it, hoping that tomorrow no one changes somethings once more...
Is this the right procedure?
Because if it is for me looks easier to go on with my changes on my fork and don't pull request nothing, and solve conflict when mergin with main tree.
Then if main devs likes what i did they can bring it from my fork.

By the way, are the custom_mode and dialog_option features so bad that they didn't get pulled like others requests?
I'm asking me if I should make that pull request for the third time or give up, since seems it's not interesting or don't know what enough.
Title: Re: Gettings started as developer
Post by: nanomad on January 01, 2013, 07:22:43 PM
They are not bad, they are quite big and potentially dangerous so I didn't feel like pulling it myself (and sorry for the conflict). As I wrote, I was waiting for more feedbacks (like it happpened with the help-to-vram pull request)
Title: Re: Gettings started as developer
Post by: scrax on January 01, 2013, 07:29:55 PM
They are not bad, they are quite big and potentially dangerous so I didn't feel like pulling it myself (and sorry for the conflict). As I wrote, I was waiting for more feedbacks (like it happpened with the help-to-vram pull request)
nanomad, I was not blaming your work, I know it was waiting more revision, but what I'm trying to find is a way to separe the changes into more fork easily, so they can be better managed when added to the main tree.
The problem is that i can't use well hg for how i work (for lack of experience I suppose), so need to find a better workflow for my edits.

I'm now trying to make diff files from the commits in my main fork, and then add them to the fork i'll use for submitting pull request.
Let's see if this can make the job easier for me.  :)

EDIT: I've submitted a small pull request with some of the changes that were in #39, now will try to make another one for the 600D photo info  display.
With those two merged making one for custom mode and dialog options should be easier and cleaner.
Title: Re: Gettings started as developer
Post by: Pelican on January 02, 2013, 04:41:28 PM
Still don't know when should I use hg merge (and exactly how)...

Could anybody give me a clear direction?
Thanks in advance.

I've just pushed my changes and I can definitely write more code if I need to do every development only once and not getting lost in the source managing and resolving conflicts and waiting my code pulled. Now I have several copies of ML in my laptop and copy pasting code pieces from one to another. How do you manage this?
And who will pull my code to the main? Is it Alex's daily routine (I mean when no holiday)?



Title: Re: Gettings started as developer
Post by: nanomad on January 02, 2013, 04:55:35 PM
I usually pull small stuff that looks fine at a quick glance or after testing it (mostly bug fixes and small features).

About confilcts/merge: I'm under the impression that the author of the pull request has to keep it up to date (that's why you have a fork/patch queque for each one) with the main tree.
Title: Re: Gettings started as developer
Post by: Pelican on January 02, 2013, 06:08:07 PM
So, now I pushed my changed to my fork and made a pull request.
When should I merge or pull the changes from the main?
Title: Re: Gettings started as developer
Post by: scrax on January 02, 2013, 07:17:54 PM
So, now I pushed my changed to my fork and made a pull request.
When should I merge or pull the changes from the main?
I think you can pull from the main and then merge it and fix eventual conflicts, if you make more changes to your fork you can update the pull request if it is not yet merged. But all what you change go in the updated pull request.
Title: Re: Gettings started as developer
Post by: RenatoPhoto on January 08, 2013, 04:11:21 PM
I am trying to install the full featured 5D3 and having problems.

Baiscally here is where I am.

I have installed Cygwin, Yagarto, Mercurial

I have done:

hg clone -r unified https://bitbucket.org/hudson/magic-lantern

I created Makefile.user

Now I can run Make 5D3 and I think I have succesfully compliled autoexec.bin.  I can find it under /../ platform\5D3.113

Here is the text from cyGwin:

$ make 5D3
make -C /home/PH/magic-lantern/platform/5D3.113
make[1]: se ingresa al directorio `/home/PH/magic-lantern/platform/5D3.113'
[ VERSION  ]   ../../platform/5D3.113/version.c
[ CC       ]   version.o
[ MENU IDX ]   menuindexentries.h
No menuindex.txt not running "python2.6 menuindex.py"
[ CC       ]   menuindex.o
[ LD       ]   magiclantern
[ OBJCOPY  ]   magiclantern.bin
[ CC       ]   reboot.o
[ LD       ]   autoexec
autoexec.bin: 334288 bytes

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000060 0x00069500 0x00069500 0x51755 0x616e4 RWE 0x10

[ OBJCOPY  ]   autoexec.bin
make[1]: se sale del directorio `/home/PH/magic-lantern/platform/5D3.113'

-----------------

The rest of the process is UNCLEAR AND NEED HELP.

1. I downloaded "5D3-113-bootflag.fir" form Alex post on 5D3 + Dev Kit
2. Where do I get the ML folder for the card?
3.  Do I get the autoexec.bin from /home/PH/magic-lantern/platform/5D3.113'?

Do I copy 1, 2 and 3 to my SD card and boot according to Unified instructions?

Thanks for your help.
Renato




Title: Re: Gettings started as developer
Post by: a1ex on January 08, 2013, 04:34:52 PM
1. download it again
2. you should already have it
3. yes
Title: Re: Gettings started as developer
Post by: RenatoPhoto on January 08, 2013, 04:57:52 PM
Thanks for your reply.

I did all of it, updated the firmware and the camera boots to firmaware update.  When I press trash button there is no ML menue.

In Canon Firmware Menue it appears that has loaded...  But still there is something wrong.

Thanks
Title: Re: Gettings started as developer
Post by: a1ex on January 08, 2013, 05:00:17 PM
The developer FIR does not make the card bootable, you should do that manually.
Title: Re: Gettings started as developer
Post by: RenatoPhoto on January 08, 2013, 05:42:03 PM
Ok, here is a summary of process:

1. Copied ML folder from Alpha 3
2. Copied autoexec.bin from Cygwin/home/PH/magic-lantern/platform/5D3.113  after compiling
3. Downloaded new 5D3-113-bootflag.fir" form Alex post on 5D3 + Dev Kit

With the card (SD 32GB) in card reader

Used EOScard.exe to make boot card.
Run EOScard.exe
Check EOS_DEVELOP checkbox
Check BOOTDISK checkbox
Click on Save

Inserted card into 5D3 and now camera boots normally and ML is enabled.  Hurray!

I will try not to damage the new cam.  I am aware of the dangers.

Thanks for your help.

Renato
Title: Re: Gettings started as developer
Post by: sarnoff on January 20, 2013, 11:21:14 AM
nevermind, I'm sleepy
Title: Re: Gettings started as developer
Post by: vstrglv on March 25, 2013, 10:13:18 PM
I have compiled autoexec.bin for 5Dmark3 many times. Last time on 3/11/2013.
I used commands:
cd magic-lantern
hg pull
hg update
make -C /home/vXXXX/magic-lantern/platform/5D3.113
But I have got an error today:

$ make -C /home/vXXXX/magic-lantern/platform/5D3.113
make: Entering directory `/home/vXXXX/magic-lantern/platform/5D3.113'
[ CC       ]   boot-hack.o
/bin/sh: /home/vXXXX/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc-4.7.3.exe: No such file or directory
../../Makefile.inc:672: recipe for target `boot-hack.o' failed
make: *** [boot-hack.o] Error 127
make: Leaving directory `/home/vXXXX/magic-lantern/platform/5D3.113'

There are only two dir in vXXXX :magic-lantern and arm-toolchain462
What is a problem?
Then... :
installed gcc-4.7.3,
made dir gcc-arm-none-eabi-4_7-2012q4 in vXXXX
copied all from installed gcc-4.7.3 dir to dir gcc-arm-none-eabi-4_7-2012q4

O.K.now

Title: Re: Gettings started as developer
Post by: coutts on March 26, 2013, 03:21:51 PM
I have compiled autoexec.bin for 5Dmark3 many times. Last time on 3/11/2013.
I used commands:
cd magic-lantern
hg pull
hg update
make -C /home/vXXXX/magic-lantern/platform/5D3.113
But I have got an error today:

$ make -C /home/vXXXX/magic-lantern/platform/5D3.113
make: Entering directory `/home/vXXXX/magic-lantern/platform/5D3.113'
[ CC       ]   boot-hack.o
/bin/sh: /home/vXXXX/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc-4.7.3.exe: No such file or directory
../../Makefile.inc:672: recipe for target `boot-hack.o' failed
make: *** [boot-hack.o] Error 127
make: Leaving directory `/home/vXXXX/magic-lantern/platform/5D3.113'

There are only two dir in vXXXX :magic-lantern and arm-toolchain462
What is a problem?
Then... :
installed gcc-4.7.3,
made dir gcc-arm-none-eabi-4_7-2012q4 in vXXXX
copied all from installed gcc-4.7.3 dir to dir gcc-arm-none-eabi-4_7-2012q4

O.K.now


Quote
/bin/sh: /home/vXXXX/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc-4.7.3.exe: No such file or directory

Please modify Makefile.userdefault to point to where your toolchain is located
Title: Re: Gettings started as developer
Post by: nanomad on March 28, 2013, 10:00:05 AM

Please modify Makefile.userdefault to point to where your toolchain is located

No

Please read what Makefile.userdefault says (you're supposed to place your settings inside Makefile.user using the defaults as a guide)
Title: Re: Gettings started as developer
Post by: Zibri on April 18, 2013, 03:09:44 PM
why do I always get that "stat" error?

Code: [Select]
[ CC       ]   picoc.o
[ CC       ]   chdk-gui_script.o
[ AR       ]   strrchr.o
[ AR       ]   dietlibc.a
[ AR       ]   lib_a-setjmp.o
[ AR       ]   newlib-libc.a
[ LD       ]   magiclantern
[ OBJCOPY  ]   magiclantern.bin
[ SYMBOLS  ]   magiclantern.sym
[ CC       ]   reboot.o
[ LD       ]   autoexec
stat: cannot stat `autoexec.bin': No such file or directory

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  EXIDX          0x06508c 0x00ce508c 0x00ce508c 0x00008 0x00008 R   0x4
  LOAD           0x000100 0x00c80100 0x00c80100 0x64f94 0x74bd9 RWE 0x100
[ OBJCOPY  ]   autoexec.bin
make[1]: Leaving directory `/home/magiclantern/magic-lantern/platform/550D.109'
Title: Re: Gettings started as developer
Post by: nanomad on April 18, 2013, 03:43:43 PM
Not an error, just the buildsystem complaining. Nothing to worry about ;)
(Fixed right now btw)
Title: Re: Gettings started as developer
Post by: Zibri on April 18, 2013, 06:26:58 PM
Yep.. it's a bug in the build script. It happens only on the first compile after a clean.
Title: Re: Gettings started as developer
Post by: RenatoPhoto on April 25, 2013, 02:22:32 PM
I have compiled autoexec.bin for 5Dmark3 many times. Last time on 3/11/2013.
I used commands:
cd magic-lantern
hg pull
hg update
make -C /home/vXXXX/magic-lantern/platform/5D3.113
But I have got an error today:

$ make -C /home/vXXXX/magic-lantern/platform/5D3.113
make: Entering directory `/home/vXXXX/magic-lantern/platform/5D3.113'
[ CC       ]   boot-hack.o
/bin/sh: /home/vXXXX/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc-4.7.3.exe: No such file or directory
../../Makefile.inc:672: recipe for target `boot-hack.o' failed
make: *** [boot-hack.o] Error 127
make: Leaving directory `/home/vXXXX/magic-lantern/platform/5D3.113'

There are only two dir in vXXXX :magic-lantern and arm-toolchain462
What is a problem?
Then... :
installed gcc-4.7.3,
made dir gcc-arm-none-eabi-4_7-2012q4 in vXXXX
copied all from installed gcc-4.7.3 dir to dir gcc-arm-none-eabi-4_7-2012q4

O.K.now

I had the same problem compiling under windows, with the help of Pelican I was able to compile without downloading the gcc-4.7.3.
Just change the Makefile.user

From:
ARM_ABI=none-eabi
ARM_LIBC_A=../../../arm-toolchain462/arm-none-eabi/lib/libc.a
PYTHON=python2.6

To:
GCC_VERSION=4.6.2
ARM_PATH=../../../arm-toolchain462
ARM_ABI=none-eabi
ARM_LIBC_A=../../../arm-toolchain462/arm-none-eabi/lib/libc.a
PYTHON=python2.6

I compiled for 5D3 and so far everything I tested works well, the new interface is very nice.  Congratulations to all who made this possible.  You guys are amazing.

Just a note:  When compiling for 5D3 I got many warnings.  Dont know if this is a problem or if some of the ML functionality will not work on 5D3. 

Title: Re: Gettings started as developer
Post by: Kim.dh on April 29, 2013, 10:21:04 PM
Trying to compile for 550D using Cygwin with Mercurial installed through cygwin setup.exe, and it fails.

log:[spoiler]Sandman@Kim ~/magic-lantern
$ make 550D
make -C /home/Sandman/magic-lantern/platform/550D.109
make[1]: Entering directory `/home/Sandman/magic-lantern/platform/550D.109'
[ AS       ]   entry.o
[ CC       ]   boot-hack.o
[ AS       ]   stubs.o
[ VERSION  ]   ../../platform/550D.109/version.c
[ CC       ]   version.o
[ CC       ]   exmem.o
[ CC       ]   bmp.o
[ CC       ]   font-dyn.o
[ CC       ]   config.o
[ CC       ]   menu.o
[ CC       ]   debug.o
[ CC       ]   stdio.o
[ CC       ]   audio-ak.o
[ CC       ]   bitrate.o
[ CC       ]   property.o
[ CC       ]   propvalues.o
[ CC       ]   gui.o
[ CC       ]   gui-common.o
[ CC       ]   misc.o
[ CC       ]   tweaks.o
[ CC       ]   lens.o
[ CC       ]   picstyle.o
[ CC       ]   cfn.o
[ CC       ]   lcdsensor.o
[ CC       ]   zebra.o
[ CC       ]   shoot.o
[ CC       ]   chdk-gui_draw.o
[ CC       ]   movtweaks.o
../../src/movtweaks.c:257:8: warning: pointer targets in initialization differ i                               n signedness [-Wpointer-sign]
../../src/movtweaks.c:257:8: warning: (near initialization for '__config_shutter                               _lock_value.value') [-Wpointer-sign]
[ CC       ]   menuhelp.o
[ MENU IDX ]   menuindexentries.h
No menuindex.txt not running "python2.6 menuindex.py"
[ 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       ]   liveview.o
[ CC       ]   reloc.o
[ CC       ]   aj_port.o
[ CC       ]   fps-engio.o
[ CC       ]   hdr.o
[ CC       ]   lv-img-engio.o
[ CC       ]   state-object.o
[ CC       ]   tasks.o
[ CC       ]   tskmon.o
[ CC       ]   beep.o
[ CC       ]   vsync-lite.o
[ CC       ]   ico.o
[ CC       ]   console.o
[ CC       ]   pico.o
../../picoc/pico.c: In function 'PlatformExit':
../../picoc/platform_ml.c:62:1: warning: 'noreturn' function does return [enable                               d by default]
[ CC       ]   picoc.o
[ CC       ]   chdk-gui_script.o
[ AR       ]   strrchr.o
[ AR       ]   dietlibc.a
[ AR       ]   lib_a-setjmp.o
[ AR       ]   newlib-libc.a
[ LD       ]   magiclantern
boot-hack.o: In function `my_big_init_task':
boot-hack.c:(.text+0x160): undefined reference to `_init_funcs_start'
boot-hack.c:(.text+0x164): undefined reference to `_init_funcs_end'
boot-hack.c:(.text+0x178): undefined reference to `_tasks_end'
boot-hack.c:(.text+0x17c): undefined reference to `_tasks_start'
boot-hack.o: In function `my_task_dispatch_hook':
boot-hack.c:(.text+0x1ec): undefined reference to `_task_overrides_end'
boot-hack.c:(.text+0x1f0): undefined reference to `_task_overrides_start'
boot-hack.o: In function `copy_and_restart':
boot-hack.c:(.text+0x3b4): undefined reference to `_bss_end'
boot-hack.c:(.text+0x3b8): undefined reference to `_bss_start'
boot-hack.o: In function `my_init_task':
boot-hack.c:(.text+0x7f8): undefined reference to `_bss_end'
boot-hack.c:(.text+0x7fc): undefined reference to `_text_start'
config.o: In function `config_parse':
config.c:(.text+0x2dc): undefined reference to `_config_vars_end'
config.c:(.text+0x2e0): undefined reference to `_config_vars_start'
config.o: In function `config_save_file':
config.c:(.text+0x460): undefined reference to `_config_vars_start'
config.c:(.text+0x464): undefined reference to `_config_vars_end'
config.o: In function `get_config_vars_start':
config.c:(.text+0x55c): undefined reference to `_config_vars_start'
config.o: In function `get_config_vars_end':
config.c:(.text+0x568): undefined reference to `_config_vars_end'
config.o: In function `config_var_was_changed':
config.c:(.text+0x5bc): undefined reference to `_config_vars_start'
config.c:(.text+0x5c0): undefined reference to `_config_vars_end'
config.o: In function `config_var_restore_default':
config.c:(.text+0x608): undefined reference to `_config_vars_start'
config.c:(.text+0x60c): undefined reference to `_config_vars_end'
property.o: In function `prop_add_internal_handlers':
property.c:(.text+0x1d0): undefined reference to `_prop_handlers_start'
property.c:(.text+0x1d4): undefined reference to `_prop_handlers_end'
d:/cygwin/home/sandman/arm-toolchain462/bin/../lib/gcc/arm-none-eabi/4.6.2\libgc                               c.a(unwind-arm.o): In function `get_eit_entry':
C:\msys\1.0\home\yagarto\gcc-build\arm-none-eabi\libgcc/../../../gcc-4.6.2/libgc                               c/../gcc/config/arm/unwind-arm.c:614: undefined reference to `__exidx_start'
C:\msys\1.0\home\yagarto\gcc-build\arm-none-eabi\libgcc/../../../gcc-4.6.2/libgc                               c/../gcc/config/arm/unwind-arm.c:614: undefined reference to `__exidx_end'
collect2: ld returned 1 exit status
../../Makefile.inc:438: recipe for target `magiclantern' failed
make[1]: *** [magiclantern] Error 1
make[1]: Leaving directory `/home/Sandman/magic-lantern/platform/550D.109'
Makefile:35: recipe for target `550D' failed
make: *** [550D] Error 2
[/spoiler]

Any help would be greatly appreciated.

Edit: Resolved. Thank you Nanomad.
Title: Re: Gettings started as developer
Post by: nanomad on April 29, 2013, 11:25:32 PM
Make clean and rebuild, it should work then
Title: Re: Gettings started as developer
Post by: themichael on May 08, 2013, 10:36:51 PM
I've followed Pelican's post here for Windows (http://www.magiclantern.fm/forum/index.php?topic=2899.msg14021#msg14021)

I get the following no matter which camera I choose, recipe failure. A forum search didn't yield any solutions.
Code: [Select]
Michael@Desktop2 ~/magic-lantern
$ make 50D V=1
make -C /home/Michael/magic-lantern/platform/50D.109
make[1]: Entering directory `/home/Michael/magic-lantern/platform/50D.109'
../../../arm-toolchain462/bin/arm-none-eabi-gcc-4.6.2.exe -E -Wp,-MMD,./magiclantern.lds  -Wp,-MT,magiclantern.lds  -nostdlib  -fomit-frame-pointer  -fno-strict-aliasing  -DCONFIG_MAGICLANTERN=1  -DCONFIG_50D=1  -DRESTARTSTART=0x0004b000  -DROMBASEADDR=0xFF810000  -DVERSION=\"v2.3.NEXT.2013May08.50D109\"  -DCONFIG_DEBUGMSG=0  -Os  -Wall  -W  -Wno-unused-parameter  -Wno-implicit-function-declaration  -Wno-unused-function  -Wno-missing-field-initializers  -Wno-format  -Wdouble-promotion  -ffast-math  -fno-trapping-math  -fsingle-precision-constant  -fshort-double  -std=gnu99  -D__ARM__  -I.  -I../../src  -I../../picoc  -mthumb-interwork  -DCONFIG_PICOC -DCONFIG_CONSOLE ../../src/magiclantern.lds.S | grep -v ^# > magiclantern.lds
../../../arm-toolchain462/bin/arm-none-eabi-gcc-4.6.2.exe -Wp,-MMD,./entry.d  -Wp,-MT,entry.o  -nostdlib  -fomit-frame-pointer  -fno-strict-aliasing  -DCONFIG_MAGICLANTERN=1  -DCONFIG_50D=1  -DRESTARTSTART=0x0004b000  -DROMBASEADDR=0xFF810000  -DVERSION=\"v2.3.NEXT.2013May08.50D109\"  -DCONFIG_DEBUGMSG=0  -c -o entry.o ../../src/entry.S
../../Makefile.inc:746: recipe for target `entry.o' failed
make[1]: *** [entry.o] Error 1
make[1]: Leaving directory `/home/Michael/magic-lantern/platform/50D.109'
Makefile:44: recipe for target `50D' failed
make: *** [50D] Error 2

Title: Re: Gettings started as developer
Post by: necronomfive on May 31, 2013, 10:03:58 PM
Just a quick question:

is it safe to compile the latest contributions with GCC 4.7.2 from the Windows Yagarto Toolchain? It seems that currently, 4.7.3 is used, but didn't find a precompiled build for Windows (yeah, I know I'm lazy...  ::) )

Thanks for your help!
Title: Re: Gettings started as developer
Post by: RenatoPhoto on May 31, 2013, 10:22:03 PM
Dont know the specific errors but here are some pointers:

You must use gcc 4.7.3 to make for raw_rec modules

Must always do a "make clean" before you "make"

Here is a list of just a few of the existing threads were you can get more information:

Questions regarding compilation, TCC
http://www.magiclantern.fm/forum/index.php?topic=5324.0

Linux & compiling code
http://www.magiclantern.fm/forum/index.php?topic=5317.msg33445#msg33445
Title: Re: Gettings started as developer
Post by: necronomfive on May 31, 2013, 10:42:01 PM
Thank you very much! Seems that Pelican's guide many people are using as a reference for Windows compilation is out of date.
Title: Re: Gettings started as developer
Post by: primeone on August 23, 2013, 02:25:28 PM
Just an update because the existing instructions left me with a couple of errors.

This is what I did for Windows 7 64bit

I've followed Pelican's directions (http://www.magiclantern.fm/forum/index.php?topic=2899.msg14021#msg14021) except that:

1. I used the latest version of gcc-arm-embedded 32 bit that I could find (https://launchpad.net/gcc-arm-embedded/+download) and installed it into $HOME/arm-toolchain474

2. I modified  magic-lantern/src/Makefile.src by adding edmac-memcpy.o
Code: [Select]
ML_SRC_OBJS = \
 boot-hack.o \
 ico.o \
 edmac.o \
 menu.o \
 edmac-memcpy.o \
 debug.o \

3. I modified Makefile.user to this:

Code: [Select]
CONFIG_TCC          = y
CONFIG_MEMCHECK     = n
CONFIG_MODULES      = y
GCC_VERSION=-4.7.4
ARM_PATH=~/arm-toolchain474
ARM_ABI=none-eabi
ARM_LIBC_A=~/arm-toolchain474/arm-none-eabi/lib/libc.a
CONFIG_PICOC = n
PYTHON=python2.6

Notice how I needed to add the - to the GCC version. Otherwise it wouldn't find the compiler.

Fingers crossed!





Title: Re: Gettings started as developer
Post by: Pelican on August 23, 2013, 06:33:58 PM
Just a quick question:

is it safe to compile the latest contributions with GCC 4.7.2 from the Windows Yagarto Toolchain? It seems that currently, 4.7.3 is used, but didn't find a precompiled build for Windows (yeah, I know I'm lazy...  ::) )

Thanks for your help!
You can use from 4.7.2 to the latest.
Title: Re: Gettings started as developer
Post by: Marsu42 on August 26, 2013, 09:11:18 AM
Notice how I needed to add the - to the GCC version. Otherwise it wouldn't find the compiler.

If so something seems to be already broken, it should really work as described - here's my Makefile.user, it's simple nowadays since Makefile.user.default has good settings. The /opt/gcc-arm contains the directories extracted from the official distribution: arm-none-eabi, bin, lib, share

Code: [Select]
SUPPORTED_MODELS:=60D
ARM_PATH=/opt/gcc-arm
GCC_VERSION=-4.7.4
CFLAG_USER = -march=armv5te -mcpu=arm946e-s -g -O2 -DCONFIG_RELEASE_BUILD -w

Btw to compile the raw_rec tools you need to modify that Makefile to read "all: raw2dng.exe" (i.e. add .exe to the end).
Title: Re: Gettings started as developer
Post by: a1ex on August 26, 2013, 09:16:24 AM
Just typing "make raw2dng.exe" should do the trick. It's not included in "all" because it needs a Windows compiler too, besides the arm one.
Title: Re: Gettings started as developer
Post by: Marsu42 on August 26, 2013, 09:23:18 AM
Just typing "make raw2dng.exe" should do the trick. It's not included in "all" because it needs a Windows compiler too, besides the arm one.

Thing is: If the line stays as "all: raw2dng" it breaks the cygwin compile, so if  I want to make all modules in one go with Makefile.modules.user I have to modify the raw_rec Makefile - I am just to lazy to submit a patch that auto-detects the compilation environment :-p
Title: Re: Gettings started as developer
Post by: primeone on August 26, 2013, 04:52:28 PM
To Marsu42:

Your Makefile.user has the same change mine has : GCC_VERSION=-4.7.4

Pelican's post says GCC_VERSION=4.6.4

Title: Re: Gettings started as developer
Post by: Marsu42 on August 26, 2013, 05:38:22 PM
Your Makefile.user has the same change mine has : GCC_VERSION=-4.7.4

Well, I'm always using the newest arm-eabi-none toolchain, you never know if it'll save some nanoseconds :->
Title: Re: Gettings started as developer
Post by: kihlbahkt on June 18, 2014, 01:47:42 AM
I am slightly interested in setting up my win7 64 bit for development but reading thru the win based threads makes it sound like a huge pain in the ass to setup. Or am I just too cynical and its is not really that bad?  My plan is to follow the  "best " instruction I can find and move forward. If I can get it running then I will create a Win7 64bit tutorial. The first decision I need to make is... do I run virtual linux or cygwin? Does anyone have an opinion on that? If you read this and are doing dev on windows, speak up. Peace, Out.
Title: Re: Gettings started as developer
Post by: dpjpandone on August 14, 2014, 02:14:09 AM
I have the toolchain setup on my windows machine now, using gcc 4.8.3, and Cygwin.
When I make 7D.203 it compiles, and ML boots on the camera, but as soon as I try to use the raw module, the camera freezes and I have to pull the battery. Has anyone else experienced this? What was the solution?

I am a little unclear about which files I need to copy to my card, I don't see all the same stuff that comes packed in the nightly builds.... I have tried just keeping the files from nightlies on my card and just replacing the autoexec and .fir, but this results in freezing when a module is activated.
Title: Re: Gettings started as developer
Post by: philmoz on August 14, 2014, 02:36:43 AM
I have the toolchain setup on my windows machine now, using gcc 4.8.3, and Cygwin.
When I make 7D.203 it compiles, and ML boots on the camera, but as soon as I try to use the raw module, the camera freezes and I have to pull the battery. Has anyone else experienced this? What was the solution?

I am a little unclear about which files I need to copy to my card, I don't see all the same stuff that comes packed in the nightly builds.... I have tried just keeping the files from nightlies on my card and just replacing the autoexec and .fir, but this results in freezing when a module is activated.

I had this at first on my 5DIII - until I updated the .sym file in the modules directory.

When you rebuild, it should create a 7D_203.sym file in the platform directory, copy this to the modules directory on the card and see if it helps.

Phil.
Title: Re: Gettings started as developer
Post by: dmilligan on August 14, 2014, 02:48:22 AM
You can also just do 'make install' from platform/xxxD.xxx/  (if you setup your card directory paths correctly).
Title: Re: Gettings started as developer
Post by: ayshih on August 14, 2014, 02:50:59 AM
The first decision I need to make is... do I run virtual linux or cygwin? Does anyone have an opinion on that?
On Windows, I use a Linux VM in VirtualBox, and it works fine.  I haven't tried any other approach.

I had this at first on my 5DIII - until I updated the .sym file in the modules directory.

When you rebuild, it should create a 7D_203.sym file in the platform directory, copy this to the modules directory on the card and see if it helps.
I recommend running "make zip" from the appropriate platform directory, which will create a nightly-build-like zip file which has the correct directory structure with files in the right places.  You don't want to be in a situation where you can inadvertently mix files from different builds.

(Alternatively, do "make install", as @dmilligan suggests.)
Title: Re: Gettings started as developer
Post by: dpjpandone on August 14, 2014, 05:10:38 AM
Thanks so much for helping me with this guys!
 I do make clean, then make zip from the 7d.203 folder, and I get:

"hg: command not found" every time it tries to build a module... each module does this and then leaves the directory and deletes itself. Here is an example:

Code: [Select]
Building module mlv_snd...
make[4]: hg: Command not found
REBUILDING
[ README   ]   module_strings.h
cat README.rst | grep -v -E "^:([^:])+:.+$" | rst2html --no-xml-declaration | py                                                                                                                                                 thon ../html2text.py -b 700



/bin/sh: rst2html: command not found

(<type 'exceptions.SystemExit'>, SystemExit(1,), <traceback object at 0x6ffffd97                                                                                                                                                 b90>)
../../modules/Makefile.modules:39: recipe for target 'module_strings.h' failed
make[4]: *** [module_strings.h] Error 1

********************************************************
WARNING: module mlv_snd failed to build, deleting
********************************************************

make[4]: Entering directory '/cygdrive/c/ml/modules/mlv_snd'
make[4]: hg: Command not found
[ RM ]  mlv_snd.o mlv_snd.mo mlv_snd.sym mlv_snd.dep module_strings.h *.o *.d *.                                                                                                                                                 dep *.sym hgstamp
make[4]: Leaving directory '/cygdrive/c/ml/modules/mlv_snd'
make[3]: Leaving directory '/cygdrive/c/ml/modules/mlv_snd'
make[2]: Leaving directory '/cygdrive/c/ml/modules'
mkdir -p /cygdrive/c/ml/platform/7d.203/zip/ML/modules || echo "no problem"
cp ../modules/*/*.mo /cygdrive/c/ml/platform/7d.203/zip/ML/modules/ || echo "no                                                                                                                                                  problem"
cp: cannot stat `../modules/*/*.mo': No such file or directory
no problem
make[1]: Leaving directory '/cygdrive/c/ml/modules'
mkdir -p /cygdrive/c/ml/platform/7d.203/zip/ML/doc
cp -v ../../doc/cam/* /cygdrive/c/ml/platform/7d.203/zip/ML/doc
cp: cannot stat `../../doc/cam/*': No such file or directory
../../Makefile.inc:71: recipe for target 'installdoc' failed
make: [installdoc] Error 1 (ignored)
cp ../../doc/README.user /cygdrive/c/ml/platform/7d.203/zip/ML/README
cp ../../doc/INSTALL.pdf /cygdrive/c/ml/platform/7d.203/zip || echo "warning Una                                                                                                                                                 ble to copy INSTALL.pdf"
cp: cannot stat `../../doc/INSTALL.pdf': No such file or directory
warning Unable to copy INSTALL.pdf
cp ../../doc/UserGuide.pdf /cygdrive/c/ml/platform/7d.203/zip || echo "warning U                                                                                                                                                 nable to copy UserGuide.pdf"
cp: cannot stat `../../doc/UserGuide.pdf': No such file or directory
warning Unable to copy UserGuide.pdf
cp ../../src/logo.bmp /cygdrive/c/ml/platform/7d.203/zip/ML/docs || echo "warnin                                                                                                                                                 g Unable to copy logo.bmp"
[ LD       ]   autoexec-fir
[ OBJCOPY  ]   autoexec-fir.bin
[ STAT     ]   autoexec-fir.bin
autoexec-fir.bin: 473584 bytes
python ../../../dumper/build_fir.py -r ../../../dumper/7D000203.FIR autoexec-fir                                                                                                                                                 .bin 7D_203.fir
python: can't open file '../../../dumper/build_fir.py': [Errno 2] No such file o                                                                                                                                                 r directory
../../platform/Makefile.platform.extras:5: recipe for target 'build_fir' failed
make: [build_fir] Error 2 (ignored)
[ RM ]  magiclantern-Nightly.2014Aug13.7D203.zip
chmod -x /cygdrive/c/ml/platform/7d.203/zip/autoexec.bin
cd /cygdrive/c/ml/platform/7d.203/zip; zip -z ../magiclantern-Nightly.2014Aug13.                                                                                                                                                 7D203.zip < \
        ../../../src/zip.txt -r .\
        @printf "[ RM dir ] %s\n" " /cygdrive/c/ml/platform/7d.203/zip/";
        zip warning: name not matched: @printf
cygwin warning:
  MS-DOS style path detected: [ RM dir ] %s\n
  Preferred POSIX equivalent is: [ RM dir ] %s/n
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
        zip warning: name not matched: [ RM dir ] %s\n
        zip warning: name not matched:  /cygdrive/c/ml/platform/7d.203/zip/
  adding: 7D_203.fir (deflated 1%)
  adding: autoexec.bin (deflated 49%)
  adding: ML/ (stored 0%)
  adding: ML/cropmks/ (stored 0%)
  adding: ML/cropmks/CineSco2.bmp
zip warning: Permission denied
        zip warning: could not open for reading: ML/cropmks/CineSco2.bmp
  adding: ML/cropmks/CrssMtr2.bmp
zip warning: Permission denied
        zip warning: could not open for reading: ML/cropmks/CrssMtr2.bmp
  adding: ML/cropmks/Passport.bmp
zip warning: Permission denied
        zip warning: could not open for reading: ML/cropmks/Passport.bmp
  adding: ML/cropmks/PhiPhoto.bmp
zip warning: Permission denied
        zip warning: could not open for reading: ML/cropmks/PhiPhoto.bmp
  adding: ML/cropmks/PhiVideo.bmp
zip warning: Permission denied
        zip warning: could not open for reading: ML/cropmks/PhiVideo.bmp
  adding: ML/data/ (stored 0%)
  adding: ML/data/apsc8p.lut
zip warning: Permission denied
        zip warning: could not open for reading: ML/data/apsc8p.lut
  adding: ML/data/apsc8r.lut
zip warning: Permission denied
        zip warning: could not open for reading: ML/data/apsc8r.lut
  adding: ML/data/ff8p.lut
zip warning: Permission denied
        zip warning: could not open for reading: ML/data/ff8p.lut
  adding: ML/data/ff8r.lut
zip warning: Permission denied
        zip warning: could not open for reading: ML/data/ff8r.lut
  adding: ML/doc/ (stored 0%)
  adding: ML/docs
zip warning: Permission denied
        zip warning: could not open for reading: ML/docs
  adding: ML/fonts/ (stored 0%)
  adding: ML/fonts/arghlf22.rbf
zip warning: Permission denied
        zip warning: could not open for reading: ML/fonts/arghlf22.rbf
  adding: ML/fonts/argnor23.rbf
zip warning: Permission denied
        zip warning: could not open for reading: ML/fonts/argnor23.rbf
  adding: ML/fonts/argnor28.rbf
zip warning: Permission denied
        zip warning: could not open for reading: ML/fonts/argnor28.rbf
  adding: ML/fonts/argnor32.rbf
zip warning: Permission denied
        zip warning: could not open for reading: ML/fonts/argnor32.rbf
  adding: ML/fonts/term12.rbf
zip warning: Permission denied
        zip warning: could not open for reading: ML/fonts/term12.rbf
  adding: ML/fonts/term20.rbf
zip warning: Permission denied
        zip warning: could not open for reading: ML/fonts/term20.rbf
  adding: ML/logs/ (stored 0%)
  adding: ML/modules/ (stored 0%)
  adding: ML/modules/7D_203.sym (deflated 64%)
  adding: ML/README
zip warning: Permission denied
        zip warning: could not open for reading: ML/README
  adding: ML/scripts/ (stored 0%)
  adding: ML/scripts/brack.c
zip warning: Permission denied
        zip warning: could not open for reading: ML/scripts/brack.c
  adding: ML/scripts/clock.c
zip warning: Permission denied
        zip warning: could not open for reading: ML/scripts/clock.c
  adding: ML/scripts/dump.lua
zip warning: Permission denied
        zip warning: could not open for reading: ML/scripts/dump.lua
  adding: ML/scripts/dumpcfg.lua
zip warning: Permission denied
        zip warning: could not open for reading: ML/scripts/dumpcfg.lua
  adding: ML/scripts/hello.c
zip warning: Permission denied
        zip warning: could not open for reading: ML/scripts/hello.c
  adding: ML/scripts/hello.py
zip warning: Permission denied
        zip warning: could not open for reading: ML/scripts/hello.py
  adding: ML/scripts/img.c
zip warning: Permission denied
        zip warning: could not open for reading: ML/scripts/img.c
  adding: ML/scripts/keys.c
zip warning: Permission denied
        zip warning: could not open for reading: ML/scripts/keys.c
  adding: ML/scripts/print.lua
zip warning: Permission denied
        zip warning: could not open for reading: ML/scripts/print.lua
  adding: ML/scripts/sokoban.c
zip warning: Permission denied
        zip warning: could not open for reading: ML/scripts/sokoban.c
  adding: ML/scripts/test.c
zip warning: Permission denied
        zip warning: could not open for reading: ML/scripts/test.c
  adding: ML/scripts/wb_shoot.lua
zip warning: Permission denied
        zip warning: could not open for reading: ML/scripts/wb_shoot.lua
  adding: ML/settings/ (stored 0%)

zip warning: Not all files were readable
  files/entries read:  12 (536K bytes)  skipped:  29 (1.5M bytes)
enter new zip file comment (end with .):
../../Makefile.inc:90: recipe for target 'magiclantern-Nightly.2014Aug13.7D203.z                                                                                                                                                 ip' failed
make: *** [magiclantern-Nightly.2014Aug13.7D203.zip] Error 18











Title: Re: Gettings started as developer
Post by: ayshih on August 14, 2014, 05:54:20 AM
"hg: command not found" means that either Mercurial is not installed, or it's not in the path.  Mercurial is invoked when building a module because information about the last change to the module is added to the module's help screen.
Title: Re: Gettings started as developer
Post by: dpjpandone on August 14, 2014, 06:29:00 AM
"hg: command not found" means that either Mercurial is not installed, or it's not in the path.  Mercurial is invoked when building a module because information about the last change to the module is added to the module's help screen.

oh crap, I forgot to reinstall it...  I'm cloning the repository now!

also, what do you use to edit the code? I've just been making small changes with windows write or wordpad, but I's like to use something like the arduino environment which has formatting and shows keywords in different colors and etc...
Title: Re: Gettings started as developer
Post by: dpjpandone on August 14, 2014, 07:19:48 AM
Now I'm seeing this a lot:

/bin/sh: rst2html: command not found


I googled this and it looks like I need to install rst2html in my arm path, was this supposed to be included with mercurial? or with the arm gcc 4.8.3?


Title: Re: Gettings started as developer
Post by: nikfreak on August 14, 2014, 10:43:11 AM
can you try reinstall (1st sudo apt-get remove then install...) package docutils??? This solved it for me when I got that error
Title: Re: Gettings started as developer
Post by: Audionut on August 14, 2014, 12:15:55 PM
Do an advanced search in this dev section for rst2html with my username.

I'd do it myself but I only have phone access.
Title: Re: Gettings started as developer
Post by: dpjpandone on August 15, 2014, 01:22:41 AM
Audionut - an advanced search only turns up this thread....

I downloaded docutils 0.12 and followed the instructions on the sourceforge page here: http://docutils.sourceforge.net/README.html#installation


here is how I installed it:

Code: [Select]
Jon@Jon-PC ~
$ cd c:/cygwin64/bin/docutils-0.12

Jon@Jon-PC /usr/bin/docutils-0.12
$ python setup.py install
running install
running build
running build_py
running build_scripts
running build_data
running install_lib
running install_scripts
changing mode of /usr/bin/rst2html.py to 755
changing mode of /usr/bin/rst2latex.py to 755
changing mode of /usr/bin/rst2man.py to 755
changing mode of /usr/bin/rst2odt.py to 755
changing mode of /usr/bin/rst2odt_prepstyles.py to 755
changing mode of /usr/bin/rst2pseudoxml.py to 755
changing mode of /usr/bin/rst2s5.py to 755
changing mode of /usr/bin/rst2xetex.py to 755
changing mode of /usr/bin/rst2xml.py to 755
changing mode of /usr/bin/rstpep2html.py to 755
running install_data
running install_egg_info
Removing /usr/lib/python2.7/site-packages/docutils-0.12-py2.7.egg-info
Writing /usr/lib/python2.7/site-packages/docutils-0.12-py2.7.egg-info

can you see where I made a mistake?


btw, here is my makefile.user (in case the problem is there) : http://www.filedropper.com/makefile_1





Title: Re: Gettings started as developer
Post by: Audionut on August 15, 2014, 04:45:50 AM
http://www.magiclantern.fm/forum/index.php?topic=11278.0
Title: Re: Gettings started as developer
Post by: dmilligan on August 15, 2014, 12:56:35 PM
ln -s /usr/bin/rst2html.py /usr/bin/rst2html
Title: Re: Gettings started as developer
Post by: dpjpandone on August 15, 2014, 05:20:28 PM
ln -s /usr/bin/rst2html.py /usr/bin/rst2html

This worked!

Big thanks to:

dmilligan, Audionut, nikfreak, ayshih, and philmoz  - I really appreciate your time and energy guys!

I actually got a zip that looks like a nightly build now!

I did notice some other errors/warnings, if someone has time, can you please confirm that the following is acceptable?

(code too large to post) download a txt file of the output from cygwin here:

http://www.filedropper.com/cygwinoutput


the builds I am generating are working fine on my 7D, and I have already fixed some issues that were bothering me for months now! I really can't thank you enough. I'm so happy to be able to participate now.

~Jon
Title: Re: Gettings started as developer
Post by: nikfreak on August 15, 2014, 07:01:03 PM
most of the warnings are confusing when compiling for first time
You will get used to it. File posted by you looks good to me.
Title: Re: Gettings started as developer
Post by: ayshih on August 15, 2014, 07:52:18 PM
I did notice some other errors/warnings, if someone has time, can you please confirm that the following is acceptable?
It looks like the errors you're still having are with building the local executables (raw2dng and cr2hdr), which is why you aren't having any problems with what you are loading on the camera.
Title: Re: Gettings started as developer
Post by: dpjpandone on August 15, 2014, 11:02:19 PM
It looks like the errors you're still having are with building the local executables (raw2dng and cr2hdr), which is why you aren't having any problems with what you are loading on the camera.

OK, thanks! I remember seeing a post about how someone fixed this error with raw2dng, so I'll try that first.
Title: Re: Gettings started as developer
Post by: menoc on November 30, 2014, 05:32:08 PM
-I was also getting:

/bin/sh: rst2html: command not found


-I got it to work by putting "rst2html.py" in "/usr/local/bin/rst2html" directory:

sudo ln -s rst2html.py /usr/local/bin/rst2html
Title: Re: Gettings started as developer
Post by: pdykmans on January 08, 2015, 08:27:26 PM
Hello all!

I'm new to the forum and quite eager to contribute... if only I would get the stuff to compile :-(

I'm running Ubuntu on a virtual box and I get this "/bin/sh rst2html not found" error. Now, I've seen some posts on this but none of the solutions work. I have a copy of the docutils-0.12 sitting under my magiclantern home directory. And from inside the "/docutils-0.12/tools" directory I've issued a "sudo ln -s rst2html.py /usr/local/bin/rst2html" command. This worked and the symbolic link is created in the "/usr/local/bin" directory allright.

However, rst2html is still not found. At least; not consistently.

Now the weird thing is; when I run make on a module (e.g. dual_iso) just after a clean it always fails with rst2html not found. When I issue Make a second time around the dual_iso.mo file is created without rst2html spoiling my evening ;-)

However, when I issue "make zip" on the 60D.111 directory, there's that pesky "rst2html  not found" again for every single module.

On the bright side; the platforms do compile and I get the autoexec.bin just fine. It's only the modules giving me trouble.

Any ideas?

Thank you in advance!
Title: Re: Gettings started as developer
Post by: pdykmans on January 08, 2015, 10:40:25 PM
Ok... I got it now. My mistake! I had the docutils-0.12 allright but they weren't properly installed. Going into the docutils directory and issuing "sudo python setup.py install" did the trick. Nothing special for most of you I guess, but my knowledge of Linux has gone REALLY rusty. So I put it here for my own recollection.

I can now compile 60D.111 ZIP just fine, with 12 modules inside the archive. My day is good! :-)

Now, as for what I was thinking of contributing; I would like to have a bit of feedback on feasability and usefulness.

So, my idea was to automatically bracket a dual-iso shoot into 2 or 3 shoots. For the purpose of (maybe) add even more quality in post. Like restoring some of the lost vertical resolution and reducing the aliasing/moire effect.

1) The 2 bracket would be a dual-iso followed by a reverse dual-iso. So, if the normal does 100/800, the second would do 800/100. I might get this completely wrong, but would this allow to restore some of the lost resolution in post? I'm here assuming you shoot from a tripod so that both shots can be more or less overlayed. And since the loss of vertical resolution is introduced by missing line information, can I assume that both shots will hold eachother's missing pieces?

2) The triple bracket would be a dual-iso followed by a shot with the base iso and one with the recovery iso. The thinking here is more or less the same.

Now, I KNOW that the strength of dual-iso is that you can have low noise in just one shot, thus eliminating the problem of moving objects. But in landscape photography this is not usually an issue. I'm basically hinting at classic HDR, but without some of the flaws.

Would any of this be useful/feasable?
Title: Re: Gettings started as developer
Post by: Pelican on January 09, 2015, 01:31:46 AM
It's easier to take a normal (not dual iso) one with 100 and another one with 800.
Title: Re: Gettings started as developer
Post by: pdykmans on January 09, 2015, 11:28:30 AM
Of all things automatic, I tend to find bracketing one of the most useful really. Especially when shooting semi-hand-held night shots in a city. Where I usually try to steady the camera on a bridge railing or something. In those cases I never go without automatic bracketing. The shorter the time and the less manipulation between shots the better.
Title: Re: Gettings started as developer
Post by: Pelican on January 11, 2015, 04:13:32 AM
OFFTOPIC:
I can't see any advantage to take two dual iso pictures instead of a normal bracket.
Title: Re: Gettings started as developer
Post by: N/A on January 12, 2015, 10:24:43 PM
ln -s /usr/bin/rst2html.py /usr/bin/rst2html
Thanks for this tip, this fixed by compile as well. Brew prefers for the /bin/ folder to be in the /local/ folder, so it wasn't working until I realized this-
Code: [Select]
ln -s /usr/local/bin/rst2html.py /usr/local/bin/rst2htmlWas the solution. Only took 3 years to learn  :D

Maybe I can learn a little coding by 2020.
Title: Re: Gettings started as developer
Post by: martinMK on September 14, 2015, 08:20:53 PM
Got myself to a standstill now..


$ make 5D2 V=1
make -C  /home/Administrator/ml/platform/5D2.212
make[1]: Entering directory '/home/Administrator/ml/platform/5D2.212'
echo
/bin/sh: hg: command not found
~/yagarto462/yagarto/bin/arm-none-eabi -gcc-4.8.3.exe -Wp,-MMD,./entry.d -Wp,-MT,entry.o -nostdlib -fomit-frame-pointer -fno-strict-aliasing -I../../include   -c -o entry.o ../../src/entry.S
/bin/sh: /home/Administrator/yagarto462/yagarto/bin/arm-none-eabi: No such file or directory
../../Makefile.filerules:33: recipe for target 'entry.o' failed
make[1]: *** [entry.o] Error 127
make[1]: Leaving directory '/home/Administrator/ml/platform/5D2.212'
Makefile:18: recipe for target '5D2' failed
make: *** [5D2] Error 2

my path to yagarto is:

ARM_ABI=none-eabi
ARM_LIBC_A=../yagarto462/yagarto/arm-none-eabi/lib/libc.a

ARM_PATH=~/yagarto462/yagarto
ARM_BINPATH=$(ARM_PATH)/bin


I am confused with this line
/bin/sh: hg: command not found

and this one /home/Administrator/yagarto462/yagarto/bin/arm-none-eabi: No such file or directory

can some one give me some insights?

Thank you.
Title: Re: Gettings started as developer
Post by: Audionut on September 14, 2015, 11:00:58 PM
I recall having some path issues.
Mine is currently setup like so.

http://imgur.com/yU9pgK6

hg is just complaining because it can't find the executable.  ~/yagarto462/yagarto/bin/arm-none-eabi -gcc-4.8.3.exe

Title: Re: Gettings started as developer
Post by: dfort on September 15, 2015, 12:01:06 AM
/bin/sh: hg: command not found

Type: which hg
can your system locate it? Did you clone the source like this?

Code: [Select]
hg clone -r unified https://bitbucket.org/hudson/magic-lantern
Different topic -- way too similar name, Getting started with development (http://magiclantern.fm/forum/index.php?topic=991.msg1205#msg1205)

It could be that your development environment can't find where your Mercurial (hg) is installed. This is likely to happen in Cygwin. If that is the case you'll have to install Mercurial again using the Cygwin installer.