Compiling on Mac OS X

Post Reply
mrkunkel
Posts: 7
Joined: Wed Aug 28, 2013 8:35 pm
Country: -

Compiling on Mac OS X

Post by mrkunkel »

First, let me say that I'm excited to be able to modify the Taranis firmware, I wish I had this ability on my car.. I haven't compiled OpenTX before so feel free to call me out for any n00b mistakes.

Here's what I've got so far:
  • Mac OS X 10.8.4 on a MacBook Pro
  • Installed Companion9x and dfu-util
  • Installed Xcode via the Apple Store
  • Installed Xcode Command Line Tools via Xcode->Preferences->Downloads
  • Used Xcode to do a svn checkout from http://opentx.googlecode.com/svn/trunk/
  • Installed the appropriate version of MacPorts from http://www.macports.org/install.php
  • Installed ARM support using MacPorts from the Terminal via sudo port install arm-none-eabi-gcc
  • See UPDATE below..
Next, I used Terminal to issue the following make command:

Code: Select all

make PCB=TARANIS PCBREV=REV4 HELI=YES GVARS=YES AUTOSWITCH=YES AUTOSOURCE=YES PPM_LIMITS_SYMETRICAL=YES PPM_CENTER_ADJUSTABLE=YES TRANSLATIONS=EN TEMPLATES=YES DBLKEYS=YES
This built opentx.bin and showed the following result in the console:

Code: Select all

-------- begin --------
arm-none-eabi-gcc (GCC) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Size before:
   text	   data	    bss	    dec	    hex	filename
 190692	    872	  44064	 235628	  3986c	opentx.elf

///// A bunch of compiler output, but no errors /////

Creating load file for Flash: opentx.bin
arm-none-eabi-objcopy -O binary  opentx.elf opentx.bin

Size after:
   text	   data	    bss	    dec	    hex	filename
 190692	    872	  44064	 235628	  3986c	opentx.elf
-------- end --------
Then, I used companion9x to write opentx.bin to the Taranis.

Here's where my current issue presents itself. Something is wrong with the firmware, when I turn on the controller, the Splash screen comes up, then the controller appears to power-cycle, which brings the Splash screen up again, and then it loops until I shut it off.

I was able to burn the original firmware back on, and it worked fine. I also upgraded to the latest revision of the firmware, as downloaded by companion9x.

I'm hoping I'm making an obvious mistake that someone else can easily point out.

UPDATE - Working
I don't know if it's just that the Mac Ports version is too old, or if it's configured differently, but this seems to work fine:

Download the Mac binary version of gcc-arm-none-eabi from Launchpad, which at the time of writing this is gcc-arm-none-eabi-4_7-2013q2-20130614-mac.tar.bz2

Extract to /opt/ and Install with the following commands:

Code: Select all

cd /opt
sudo ln -s gcc-arm-non-eabi-4_72013q2 arm
echo "PATH=$PATH:/opt/arm/bin" >> ~/.bash_profile
After you close and reopen the Terminal, you should be able to run arm-none-eabi-gcc --version and see something like: GNU Tools for ARM Embedded Processors 4.7.4

Thanks,
Matt
Last edited by mrkunkel on Tue Sep 10, 2013 1:32 pm, edited 1 time in total.

Romolo
9x Developer
Posts: 1109
Joined: Sat Dec 31, 2011 12:11 am
Country: -
Location: Massa (MS), Tuscany, Italy

Re: Compiling on Mac OS X

Post by Romolo »

Try this command line:
I see missing at least: EXT=FRSKY & SDCARD=YES

make PCB=TARANIS EXT=FRSKY SDCARD=YES PPM_CENTER_ADJUSTABLE=YES FLIGHT_MODES=YES AUTOSWITCH=YES PPM_LIMITS_SYMETRICAL=YES AUTOSOURCE=YES DBLKEYS=YES HELI=YES TEMPLATES=YES PPM_UNIT=PERCENT_PREC1 GVARS=YES FAI=CHOICE TRANSLATIONS=EN
mrkunkel
Posts: 7
Joined: Wed Aug 28, 2013 8:35 pm
Country: -

Re: Compiling on Mac OS X

Post by mrkunkel »

Hi Romolo, I tried the make command you provided and it didn't seem to make a difference.

If it helps any, the throttle and switch warnings run correctly after the splash screen shows up, then if I press a button to skip the warning, or if I correct the switch or throttle, it instantly reboots.
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Compiling on Mac OS X

Post by Kilrah »

Romolo wrote:Try this command line:
I see missing at least: EXT=FRSKY & SDCARD=YES
They are defined automatically in the makefile when PCB=TARANIS. Just like audio and other native hardware features.

The command line I gave is the one used to build the stock FW.

Hard to say, if it compiles without errors it should work, but there could be a possibility a library was the wrong version other something...
Never tried compiling on Mac myself, only windows and Linux.

Sent via mobile
mrkunkel
Posts: 7
Joined: Wed Aug 28, 2013 8:35 pm
Country: -

Re: Compiling on Mac OS X

Post by mrkunkel »

Ok, I believe I've got this figured out.. It looks like the version of grc-arm-none-eabi that I installed through MacPorts is too old, or otherwise incompatible. Through Rob Thompson's post, I ended up on the Launchpad site for GCC-ARM-Embedded, and downloaded the Mac Binaries: gcc-arm-none-eabi-4_7-2013q2-20130614-mac.tar.bz2

It appears to have allowed me to compile a working version of the firmware, however, the file size is up to 226K using the provided build options. I know that leaves me ~775K of free space, so I'm not worried, just not sure where the difference is coming from.

Post Reply

Return to “openTx for FrSky radios”