User Tools

Site Tools


build_mac

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
build_mac [2011/07/28 02:28] – [1. Compiler] mhbuild_mac [2012/01/03 03:29] (current) – Added info box for macports darthrake
Line 1: Line 1:
 +<note important>** You //might// want to disable .DS_Store files on (network) mounts**
 +...otherwise Mac OS will break your r0ket file system.
 +**NEVER EVER access the r0ket with the finder.**
 +Always use only the terminal.
 +</note>
 +
 ====== Build environment on Mac OS X ====== ====== Build environment on Mac OS X ======
-===== 0. Work in Progress / First Trial ===== 
-This page will hopefully soon explain how to setup the build environment on a Mac. 
-As of now, the setup has not yet been completely tried out / documented. 
  
 ===== 1. Compiler ===== ===== 1. Compiler =====
 +
 +== Using Mac OS X: == 
 +
 <note tip> <note tip>
-The CodeSourcery G++ package provides a GNU cross-compiler toolchain for ARM, but needs to be built first from source code.+The CodeSourcery G++ package provides a GNU cross-compiler toolchain for ARM. The Mac OS X version is not distributed by CodeSourcery in binary form, but can be built from source code, or mainline gcc for arm-none-eabi can be installed via MacPorts.
 </note> </note>
  
-  * This explains how to build the tool chain on a Mac: [[http://www.micromouseonline.com/blog/2009/05/07/codesourcery-gnu-toolchain-for-the-arm-on-a-mac|CodeSourcery GNU Toolchain for the ARM on a Mac]]+=== Solution 1 === 
 + 
 +  * This explains how to build the tool chain on a Mac: [[https://github.com/jsnyder/arm-eabi-toolchain|Git project: jsnyder / arm-eabi-toolchain]] 
 +  * You will probably want to add this line to /etc/bashrc, so that the tools are always accessible when you open a new Terminal: <code>export PATH=$HOME/arm-cs-tools/bin:$PATH</code> 
 + 
 +=== Solution 2 === 
 + 
 +<note tip> 
 +This "Solution" produces slightly bigger code (with gcc 4.6.2) compared to older gcc versions. Therefore you can not compile some l0dables. This results in errors like: 
 +<code>arm-none-eabi-ld -nostartfiles -T loadable.ld -o mp0ng.elf mp0ng.o  -lc -L/opt/local/arm-none-eabi/lib/ 
 +arm-none-eabi-ld: mp0ng.elf section `.text' will not fit in region `sram' 
 +arm-none-eabi-ld: region `sram' overflowed by 148 bytes</code> 
 +</note> 
 + 
 +  * Install [[http://macports.org|MacPorts]] 
 +  * Don't forget <code>sudo port sync</code> 
 +  * Install the port ''arm-none-eabi-gcc'': <code>sudo port install arm-none-eabi-gcc</code> 
 + 
 +=== Solution 3 === 
 +  * Currently not working (at least on Lion). Less pain: MacPorts 
 +  * Install [[http://mxcl.github.com/homebrew|Homebrew]] 
 +  * Import (as in copy to /usr/local/Library/Formula) the formulae for cloog-ppl and arm-none-eabi-gcc from [[https://github.com/jpc/homebrew/tree/master/Library/Formula|here]]  
 +  * Install the formula ''arm-none-eabi-gcc'': <code>brew install arm-none-eabi-gcc</code> 
 + 
 + 
 +== Another option: Installing Ubuntu Linux in a VirtualBox: == 
 +  * [[http://www.tuaw.com/2009/09/07/how-to-set-up-ubuntu-linux-on-a-mac-its-easy-and-free/|Article: How to set up Ubuntu Linux on a Mac -- it's easy and free]] 
 +  * Then refer to the [[build?&#compiler|main Build article]]. 
 + 
 +===== 2. Source ===== 
 +see [[build?&#source|main Build article]] 
 + 
 +===== 3. Build ===== 
 +see [[build?&#build|main Build article]] 
 + 
 +===== 4. Deploy ===== 
 +Bring the r0ket into ISP-Mode: 
 +e.g. by using Method 1 (up to 30 seconds, but works always) 
 +  * Power off r0ket 
 +  * Press and hold button “Left”, power r0ket on 
 +  * Connect r0ket via USB 
 + 
 +Mac OS X will show "CRP DISABLD" USB device.  
 + 
 +== Using the Mac OS X Terminal: == 
 + 
 +<code>cp firmware.bin /Volumes/CRP\ DISABLD/</code> 
 + 
 +Note: Copying the firmware.bin over to the device in the Mac OS X Finder does __not__ work. 
 + 
 +== Using the Ubunto Terminal in a VirtualBox: == 
 + 
 +Share the directory "CRP DISABLD" on the Mac OS X host with VirtualBox, e.g. using the name r0flash - it will be available on the Ubuntu guest at /media/sf_r0flash. 
 + 
 +Copy the file firmware.bin to that directory: 
 +<code>cp firmware.bin /media/sf_r0flash/</code>  
 + 
 + 
 +===== 9. Prepare a brand new r0ket ===== 
 +See [[build|main Build article (scoll to the bottom)]]
 +or: 
 + 
 +Bring the r0ket into ISP-Mode: 
 +e.g. by using Method 1 (up to 30 seconds, but works always) 
 +  * Power off r0ket 
 +  * Press and hold button “Left”, power r0ket on 
 +  * Connect r0ket via USB 
 + 
 +If you want to start from scratch: 
 +<code> 
 +rm /Volumes/CRP2\ ENABLD/* 
 +</code> 
 + 
 +Install the "initial" formatting firmware: 
 +<code> 
 +cd firmware 
 +make APP=initial 
 +cp firmware.bin /Volumes/CRP\ DISABLD/firmware.bin 
 +</code> 
 +The Data Flash will be formatted. 
 +Now the r0ket will present a flash file system called "NO NAME" over USB.  
 +Install the l0dables: 
 +<code> 
 +cd l0dable 
 +make 
 +cp *.c0d /Volumes/NO\ NAME/ 
 +cp *.int /Volumes/NO\ NAME/ 
 +cp *.nik /Volumes/NO\ NAME/ 
 +cd .. 
 +</code> 
 +Now install the Camp firmware ("final"): 
 +<code> 
 +make APP=final 
 +cp firmware.bin /Volumes/CRP2\ ENABLD/firmware.bin 
 +</code>
  
-  * But use this source code release: [[http://www.codesourcery.com/sgpp/lite/arm/portal/release1802|Release 1802]]+=== Example commands that worked for me === 
 +MacOSX, Lion, Up-to-date MacPorts - DanBUK 
 +<code
 +sudo port sync 
 +sudo port install arm-none-eabi-gcc 
 +git clone git://github.com/r0ket/r0ket.git 
 +cd r0ket 
 +git checkout c583ddc7e3b6ecc2cdb94fe0a0474d52bcbb220b 
 +cd firmware 
 +cp SECRETS SECRETS.release 
 +# Edit SECRETS.release 
 +./release-all 
 +make APP=initial 
 +cp firmware.bin ../release/initial.bin 
 +cd ../release/ 
 +# ISP Mode - Power on whilst holding left on Joypad 
 +# NB. This isn't always CRP DISABLED, could be CRP2 ENABLED 
 +mount grep "CRP DISABLD" 
 +# /dev/disk3      32Ki   32Ki    0Bi   100%    /Volumes/CRP DISABLD 
 +cp initial.bin /Volumes/CRP\ DISABLD/firmware.bin 
 +diskutil unmount "CRP DISABLD" 
 +# power off 
 +# power on 
 +mount | grep "NO NAME" 
 +# /dev/disk3 on /Volumes/NO NAME (msdos, local, nodev, nosuid, noowners) 
 +# If you want to start completely empty: 
 +# rm -Rf /Volumes/NO\ NAME/* 
 +cp files/* /Volumes/NO\ NAME/ 
 +diskutil unmount "NO NAME" 
 +# press button (joypad middle) 
 +mount | grep "CRP2 ENABLD" 
 +# /dev/disk3 on /Volumes/CRP2 ENABLD (msdos, local, nodev, nosuid, noowners) 
 +cp final.bin /Volumes/CRP2\ ENABLD/firmware.bin 
 +diskutil eject "CRP2 ENABLD" 
 +# power off 
 +# power on 
 +# Enjoy! 
 +</code>
build_mac.1311812939.txt.gz · Last modified: 2011/07/28 02:28 by mh

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki