Mac Embeded Compiler

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
nxt-ai
Posts: 36
Joined: 10 Jan 2011, 05:02

Mac Embeded Compiler

Post by nxt-ai »

Anyone know of a working replacement for the IAR compiler, that would work on os 10.6?
Other than GCC that is, I hear it has significantly worse performance. Being able to compile projects like NXos (https://github.com/danderson/nxos) and nxt-firmware (http://nxt-firmware.ni.fr.eu.org/) would be nice too.
tcwan
Posts: 186
Joined: 30 Sep 2010, 07:39

Re: Mac Embeded Compiler

Post by tcwan »

nxt-ai wrote:Anyone know of a working replacement for the IAR compiler, that would work on os 10.6?
Other than GCC that is, I hear it has significantly worse performance. Being able to compile projects like NXos (https://github.com/danderson/nxos) and nxt-firmware (http://nxt-firmware.ni.fr.eu.org/) would be nice too.
I have not done any benchmarking against IAR, but so far GCC looks to be the most convenient since it is also cross-platform. I'm using GCC 4.6.1 on Mac OS X 10.6.

I guess you'll have to keep an eye out for LLVM to see if it'll work.
nxt-ai
Posts: 36
Joined: 10 Jan 2011, 05:02

Re: Mac Embeded Compiler

Post by nxt-ai »

If it can compile IAR code well then why is there a NXTGCC project? What would be required to compile, for example, the official firmware with GCC? Anyone had any issues doing so?

Preferably also include your solutions. :)
tcwan
Posts: 186
Joined: 30 Sep 2010, 07:39

Re: Mac Embeded Compiler

Post by tcwan »

nxt-ai wrote:If it can compile IAR code well then why is there a NXTGCC project? What would be required to compile, for example, the official firmware with GCC? Anyone had any issues doing so?

Preferably also include your solutions. :)
You can't compile the official firmware source using GCC without modification. For that you can use the Free IAR compiler release for Mindstorms (sorry, I don't have the URL handy). You would need to either use the NXTGCC version, or else NXT Improved Firmware http://nxt-firmware.ni.fr.eu.org/, which is derived from the official firmware source as well.

The advantage of NXT Improved Firmware is that now it tracks John Hansen's NXT Enhanced Firmware, so basically you get the features of the NXT Enhanced Firmware with GCC compilation capabilities.
schodet
Posts: 139
Joined: 29 Sep 2010, 11:21
Contact:

Re: Mac Embeded Compiler

Post by schodet »

The NXT Improved Firmware includes some changes to make the sources compatible with GCC. Look for commits prefixed with gcc in the git repository. Also, IAR compatibility is preserved.

You can find a step by step instruction for MAC OS X.

Currently firmwares compiled with GCC are a bit larger than those compiled with IAR. This is mainly caused by the newlib library which is larger than the library provided with IAR.

You should avoid using the NXTGCC project because:
- it uses an old ARM ABI which force you to compile using packed structures which produce larger code.
- it does not handle interrupt and flash code right, leading to crashes when accessing the flash when a interrupt is triggered.
- it drops IAR compatibility.
- it is distributed in a huge .zip file, which limit exchanges.
LEGO things http://ni.fr.eu.org/lego/ - NXT Improved Firmware (GCC) http://nxt-firmware.ni.fr.eu.org/ - Other robots http://apbteam.org
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests