RE: Magic Lantern 0.2.1 for 550D firmware 1.0.9

481 views
Skip to first unread message

Dave Thomas

unread,
May 16, 2012, 1:03:12 AM5/16/12
to ml-d...@googlegroups.com
Trying to revive this old thread (referenced by http://magiclantern.wikia.com/wiki/Build_instructions/550D) to update the summon-arm in the hopes that I could save an ML newbie like me the few hours of headache I just experienced :)

This summon-arm didn't work right out of the box due to missing tarballs (lame mirror?) and complaints about missing patchfiles.  Did I miss the patchfiles in the setup instructions?  Here's what I did which worked but in retrospect may not have been the easiest thing...

*  Diff the summon-arm from this attachment and make a few judgements about what should work
*  Realize that I still need patches to google them so create a folder "patches" and copy in the following:
(I would put this in the script but my lame osx wget doesn't like github's https cert)
(I recall there was another but can't seem to find it in my history)

Results: Though I couldn't build the unified branch, I was able to build 550d.  After boldly dropping in the autoexec.bin, I booted the camera.....  SUCCESS!

Anyway my final summon-arm DIFFers from esden's one on github:

--- summon-arm-toolchain
+++ summon-arm-toolchain        
@@ -19,28 +19,30 @@
 # You probably want to customize those
 # You can also pass them as parameters to the script
 ##############################################################################
-TARGET=arm-none-eabi           # Or: TARGET=arm-elf
-PREFIX=${HOME}/sat     # Install location of your final toolchain
+TARGET=arm-elf         # Or: TARGET=arm-elf
+PREFIX=${HOME}/arm-toolchain # Install location of your final toolchain
 DARWIN_OPT_PATH=/opt/local     # Path in which MacPorts or Fink is installed
 # Set to 'sudo' if you need superuser privileges while installing
 SUDO=
 # Set to 1 to be quieter while running
 QUIET=0
 # Set to 1 to use linaro gcc instead of the FSF gcc
-USE_LINARO=1
+USE_LINARO=0
 # Set to 1 to enable building of OpenOCD
-OOCD_EN=1
+OOCD_EN=0
 # Set to 'master' or a git revision number to use instead of stable version
 OOCD_GIT=
 # Set to 1 to build libstm32 provided by ST
 LIBSTM32_EN=0
 # Set to 1 to build libopencm3 an open source library for Cortex M3 and simalar
 # chips
-LIBOPENCM3_EN=1
+LIBOPENCM3_EN=0
 # Make the gcc default to Cortex-M3
 DEFAULT_TO_CORTEX_M3=0
 # Override automatic detection of cpus to compile on
 CPUS=
+# Mirror to use for downloading GNU software

 ##############################################################################
 # Parsing command line parameters
@@ -84,6 +86,9 @@
                CPUS=*)
                CPUS=$(echo $1 | sed 's,^CPUS=,,')
                ;;
+               GNUMIRROR=*)
+               GNUMIRROR=$(echo $1 | sed 's,^GNUMIRROR=,,')
+               ;;
                *)
                echo "Unknown parameter: $1"
                exit 1
@@ -114,7 +119,7 @@
        # For FSF GCC:
        GCCVERSION=4.5.2
        GCC=gcc-${GCCVERSION}
+       GCCURL=${GNUMIRROR}/gcc/${GCC}/${GCC}.tar.gz
 else
        # For the Linaro GCC:
        GCCRELEASE=4.5-2011.02-0
@@ -158,7 +163,7 @@
 BINUTILFLAGS=

 if [ ${DEFAULT_TO_CORTEX_M3} == 0 ] ; then
-       GCCFLAGS=
+       GCCFLAGS="--with-float=soft"
 else
        # To default to the Cortex-M3:
        GCCFLAGS="--with-arch=armv7-m --with-mode=thumb --with-float=soft"
@@ -316,10 +321,10 @@

 cd ${SOURCES}

+fetch ${BINUTILS} ${GNUMIRROR}/binutils/${BINUTILS}.tar.bz2
 fetch ${GCC} ${GCCURL}
+fetch ${GDB} ${GNUMIRROR}/gdb/${GDB}.tar.bz2

 if [ ${OOCD_EN} != 0 ]; then
        if [ "x${OOCD_GIT}" == "x" ]; then









On Jun 8 2011, 9:50 am, Alex <broscutama...@gmail.com> wrote:
> Following Chris' suggestion, I'm increasing ML version number in order
> to prevent further thread splitting problems :)
> I've upgraded to GCC 4.6.0, with the attached summon-arm script
> (which is a modified version ofhttps://github.com/dan-wellkeeper/summon-arm-toolchain). Results:
> * With the new GCC, autoexec.bin shrunk by 8k (which I think it's pretty good).
> * There was a strange structure alignment problem with picture style
> data, and maybe with bitrate structure too: 0x12345678 was displayed
> as 0x56781234. The issue was only present with -Os; it was working
> fine with -O1 and -O2 (but with larger autoexec.bin). Adding the
> "aligned" attribute to the buggy structure fixed the problem. There
> might be more issues like this, but I didn't notice anything so far.
> * String trimming problems seem to have disappeared as far as I could
> notice (yay!).
> Code is pretty much the same as with previous builds, except the
> Before doing further changes, I'd like to know if there are more (or
> less) side effects from upgrading the compiler, so please report any
> issues you find. I'm looking especially for issues which only happen
> with only one of last two builds (but not with the other). Thanks.
> P.S. This message should have arrived yesterday, but I've looked it up
> in the mailing list and it's not there, so I'm reposting it. That's
> why this build is still marked as Jun07.
>  summon-arm
> 19KViewDownload
>  magiclantern-2011Jun07.550d.fw109.alex.zip
> 1832KViewDownload

"Sztupák Sz. Zsolt"

unread,
May 16, 2012, 2:33:34 AM5/16/12
to ml-d...@googlegroups.com
Hi!

There is also a summon-arm and prepare.ubuntu.sh script inside the ML source: https://bitbucket.org/hudson/magic-lantern/src/a28afc13b7ea/toolchain
The wiki should be updated to reflect that though.

 SztupY
--
http://magiclantern.wikia.com/
 
To post to this group, send email to ml-d...@googlegroups.com
To unsubscribe from this group, send email to ml-devel+u...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/ml-devel?hl=en

Andrew Coutts

unread,
Jun 2, 2012, 1:42:54 AM6/2/12
to Magic Lantern firmware development
You said you are installing this on OS X. There is a MUCH easier
solution for Mac / Windows developers (surprisingly, when does that
ever happen??). All you need to do is download Yagarto:
http://www.yagarto.de/
And run the installer. It comes with pre-built binaries so you don't
have to wait for everything to build (not sure how it works so well
but it does).

I also wrote this wiki page last year to help other OS X developers
get setup:
http://magiclantern.wikia.com/wiki/Magic_Lantern_Development_on_Mac

Send me an email if you have any further questions, I am pretty
comfortable with getting setup after how many times I've done it.

On May 16, 2:33 am, "Sztupák Sz. Zsolt" <m...@sztupy.hu> wrote:
> Hi!
>
> There is also a summon-arm and prepare.ubuntu.sh script inside the ML
> source:https://bitbucket.org/hudson/magic-lantern/src/a28afc13b7ea/toolchain
> The wiki should be updated to reflect that though.
>
>   SztupY> Trying to revive this old thread (referenced by
> >http://magiclantern.wikia.com/wiki/Build_instructions/550D) to update
> > the summon-arm in the hopes that I could save an ML newbie like me the
> > few hours of headache I just experienced :)
>
> > This summon-arm didn't work right out of the box due to missing
> > tarballs (lame mirror?) and complaints about missing patchfiles.  Did
> > I miss the patchfiles in the setup instructions?  Here's what I did
> > which worked but in retrospect may not have been the easiest thing...
>
> > *  Download the latest
> >https://raw.github.com/esden/summon-arm-toolchain/master/summon-arm-t...
> > *  Diff the summon-arm from this attachment and make a few judgements
> > about what should work
> > *  Realize that I still need patches to google them so create a folder
> > "patches" and copy in the following:
> >https://raw.github.com/esden/summon-arm-toolchain/master/patches/patc...
> > <http://ftp.gnu.org/gnu/gcc/$%7BGCC%7D/$%7BGCC%7D.tar.gz>
> > +       GCCURL=${GNUMIRROR}/gcc/${GCC}/${GCC}.tar.gz
> >  else
> >         # For the Linaro GCC:
> >         GCCRELEASE=4.5-2011.02-0
> > @@ -158,7 +163,7 @@
> >  BINUTILFLAGS=
>
> >  if [ ${DEFAULT_TO_CORTEX_M3} == 0 ] ; then
> > -       GCCFLAGS=
> > +       GCCFLAGS="--with-float=soft"
> >  else
> >         # To default to the Cortex-M3:
> >         GCCFLAGS="--with-arch=armv7-m --with-mode=thumb --with-float=soft"
> > @@ -316,10 +321,10 @@
>
> >  cd ${SOURCES}
>
> > -fetch ${BINUTILS}http://ftp.gnu.org/gnu/binutils/${BINUTILS}.tar.bz2
> > <http://ftp.gnu.org/gnu/binutils/$%7BBINUTILS%7D.tar.bz2>
> > +fetch ${BINUTILS} ${GNUMIRROR}/binutils/${BINUTILS}.tar.bz2
> >  fetch ${GCC} ${GCCURL}
> >  fetch ${NEWLIB}ftp://sources.redhat.com/pub/newlib/${NEWLIB}.tar.gz
> > <ftp://sources.redhat.com/pub/newlib/$%7BNEWLIB%7D.tar.gz>
> > <http://ftp.gnu.org/gnu/gdb/$%7BGDB%7D.tar.bz2>
> > +fetch ${GDB} ${GNUMIRROR}/gdb/${GDB}.tar.bz2
>
> >  if [ ${OOCD_EN} != 0 ]; then
> >         if [ "x${OOCD_GIT}" == "x" ]; then
>
> > On Jun 8 2011, 9:50 am, Alex <broscutama...@gmail.com
> > <mailto:broscutama...@gmail.com>> wrote:
> > > Following Chris' suggestion, I'm increasing ML version number in order
> > > to prevent further thread splitting problems :)
>
> > > I've upgraded to GCC 4.6.0, with the attached summon-arm script
> > > (which is a modified version
> > ofhttps://github.com/dan-wellkeeper/summon-arm-toolchain
> > <http://github.com/dan-wellkeeper/summon-arm-toolchain>). Results:

Dave Thomas

unread,
Jun 2, 2012, 2:45:05 AM6/2/12
to ml-d...@googlegroups.com
Thanks for the suggestion, Andrew.   I might give yagarto another try but I think the problem I has was the process wasn't vetted for my OSX Lion 10.7.4 (can't remember why I abandoned yagarto).

SztupY, the summon-arm you suggested worked right out of the box.  I'm usually more comfortable building a toolchain than using binaries anyhow :P

I'm able to 'make all' with no problems, and as I just posted, the updates to ML that came with this version was critical while I was on set last week with my trusty 550D.

Now that I'm back in Montreal (the shoot was in Vancouver), I thought I'd try the same on our 5D2 but I this when I `make fir` - which I presume I need to run unified ML on this platform.  Is that right?

The make.log is attached (product of `make V=1 2>&1 clean fir | tee /tmp/make.log`).  Would yagarto help?
make.log

Alex

unread,
Jun 2, 2012, 3:25:23 AM6/2/12
to ml-d...@googlegroups.com
To compile the FIR, you need the encryption keys, which are not public.

You can use AJ 5.9 to enable the bootflag (that's how I've installed
it for the first time), then upgrade to 212 and copy the new autoexec.

Morgan Look

unread,
Jun 2, 2012, 6:15:56 AM6/2/12
to ml-d...@googlegroups.com
I managed to get this working, I've stumbled a few times but got there in the end.  

First it couldn't find make, so I assumed it needed X Code installed, but there is a copy of make with yagarto (you just have to follow the README bit about adding stuff to .bash_profile).  Anyway, I have X Code installed as well now, not sure if it's needed (I suspect there are other command line calls that may get used).

The only way I could find to make Mac Hg clone the unified branch was to use it on the command line (using the alias mhg).  I think I prefer that anyway.
I still get warnings about it not finding hg during make, but I figure that's probably not too important.


Next I had to update the Makefile.inc to reflect the yagarto build environment, this includes ARM_LIBC_A which is hidden way down the Makefile.inc (I suggest moving it nearer the top).  And readelf which needs a specific reference too.

ARM_PATH=~/yagarto/yagarto-4.6.2
ARM_BINPATH=$(ARM_PATH)/bin
ARM_LIBC_A = $(ARM_PATH)/arm-none-eabi/lib/libc.a
GCC_VERSION=4.6.2
CC=$(ARM_BINPATH)/arm-none-eabi-gcc-$(GCC_VERSION)
OBJCOPY=$(ARM_BINPATH)/arm-none-eabi-objcopy
AR=$(ARM_BINPATH)/arm-none-eabi-ar
RANLIB=$(ARM_BINPATH)/arm-none-eabi-ranlib
READELF=$(ARM_BINPATH)/arm-none-eabi-readelf

$(READELF) -l magiclantern | grep -C 2 MemSiz

Next it borks on a call to stat -c (by this time autoexec.bin has finished building, and it can be used on the camera)

I see the following references to stat in Makefile.inc which appears to be unused elsewhere

ifeq ($(UNAME), Darwin)
        # Variable declaration for Mac OS X
        UMOUNT=hdiutil unmount
        CF_CARD="/Volumes/EOS_DIGITAL"
        STAT=stat -f
else
        # Default settings for remaining operating systems
        CF_CARD=/media/EOS_DIGITAL/
        UMOUNT=umount
        STAT=stat -c
endif

But in platform/all/Makefile the following use of stat -c occurs.

stat -c "autoexec.bin: %s bytes" autoexec.bin; \

To fix this I recommend changing the main Makefile.inc to read as follows

ifeq ($(UNAME), Darwin)
        # Variable declaration for Mac OS X
        UMOUNT=hdiutil unmount
        CF_CARD="/Volumes/EOS_DIGITAL"
        STAT_CMD=stat -f "%N: %z bytes"
else
        # Default settings for remaining operating systems
        CF_CARD=/media/EOS_DIGITAL/
        UMOUNT=umount
        STAT_CMD=stat -c "%n: %s bytes"
endif

and then change platform/all/Makefile to call $(STAT_CMD) instead

x: autoexec-all autoexec-all.bin
        cp autoexec-all.bin autoexec.bin
        $(STAT_CMD) autoexec.bin; \

Someone should probably check it still works in non Darwin environments just incase the stat call doesn't work anymore.

Finally it falls over compiling the stuff in plugins/  but that can be made to work also.

plugins/Makefile.top needs the same modifications as the main Makefile.inc for the yagarto build environment
plugins/symtblgen.rb has a reference to readelf which I'm not sure how to fix properly since it's written in ruby

I should be working on my assignment
Morgan.

Dave Thomas

unread,
Jun 2, 2012, 6:00:38 PM6/2/12
to ml-d...@googlegroups.com
There's an easier way to make stat work on Mac OSX:

sudo port install coreutils
echo 'export PATH=/opt/local/libexec/gnubin:$PATH' >> ~/.bash_profile

Which makes your shell more gnu-like, but you don't need to make any code changes.

scrax

unread,
Jun 4, 2012, 2:29:12 PM6/4/12
to ml-d...@googlegroups.com
I'll try but i prefer a fix in the source than having to install more stuff, the biggest problem with osx for me was installing all the stuff needed. 

Added the readelf fix to my fork because it was not in the last commits alex did (maybe is working only for osx?).

Thanks for the info.
For more options, visit this group at
http://groups.google.com/group/ml-devel?hl=en

--
http://magiclantern.wikia.com/

To post to this group, send email to ml-d...@googlegroups.com
To unsubscribe from this group, send email to ml-devel+unsubscribe@googlegroups.com

For more options, visit this group at http://groups.google.com/group/ml-devel?hl=en

--
http://magiclantern.wikia.com/
 
To post to this group, send email to ml-d...@googlegroups.com
To unsubscribe from this group, send email to ml-devel+unsubscribe@googlegroups.com

scrax

unread,
Jun 5, 2012, 7:26:42 AM6/5/12
to ml-d...@googlegroups.com
+  symtbl=`arm-elf-readelf -r #{ARGV[0]}`
-   symtbl=`readelf -r #{ARGV[0]}`

in symtblgen.rb solve my problems with make in the plugins folders (I have not yagarto on my mac, but the summon arm modded by SztupY)



For more options, visit this group at
http://groups.google.com/group/ml-devel?hl=en

--
http://magiclantern.wikia.com/

To post to this group, send email to ml-d...@googlegroups.com
To unsubscribe from this group, send email to ml-devel+unsubscribe@googlegroups.com
Reply all
Reply to author
Forward
0 new messages