Page 1 of 1
Mac Embeded Compiler
Posted: 22 Sep 2011, 03:19
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.
Re: Mac Embeded Compiler
Posted: 22 Sep 2011, 03:55
by tcwan
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.
Re: Mac Embeded Compiler
Posted: 25 Sep 2011, 20:05
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.
Re: Mac Embeded Compiler
Posted: 26 Sep 2011, 02:11
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.
Re: Mac Embeded Compiler
Posted: 02 Oct 2011, 16:01
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.