Post Reply 
Short Guide on Compiling NewRPL
11-18-2016, 04:57 AM
Post: #5
RE: Short Guide on Compiling NewRPL
(11-18-2016 03:12 AM)Han Wrote:  Updated to include Mac OS X instructions. I compiled the firmware, but have not tested the firmware file (left my 49G+ and 50G at the office). Claudio, can you comment on the errors mentioned at the end of the Mac OS X section in the first post?

I can tell you that I compiled both UI and FW on Ubuntu (64-bits) and on FreeBSD (32 and 64 bits) (most similar OS to a Mac that I can get) and it compiled with zero errors. I also compile UI on Windows (32-bits) and get zero errors. Sometimes I get a spurious warning about a comparison on ui_cmdline.c that makes no sense to me.
Regarding memory.h: It was an old #include needed back in the early days, but I eventually replaced all calls to memcpy and friends with my own memcpyw and memcpyb to become completely independent from any system library, so memory.h became obsolete and can be removed with no consequences (I'll commit that change tomorrow). It's a standard header, though, it should be there even on Mac. Perhaps there's some missing basic headers?

Also the problem with types should never happen: The first thing newrpl.h does is define all those custom types: WORD is defined as uint32_t to be 100% consistent across multiple platforms. Replacing WORD with unsigned int is superfluous, as they are the same type, same as replacing int with BINT in your example. I'm not sure where those errors come from.

The arm-none-eabi-gcc you are using should be fine. A while back they had declared ARM9 obsolete and removed libgcc.a from the packages, but they eventually included everything back. Even though they say Cortex, the old arm920t is supported and they provide a libgcc.a that is armv4t compatible.
As far as recommended ARM compiler: I tested the arm-none-eabi-gcc in the Ubuntu packages and works well. I also used the freebsd package and worked just as well. For the UI project, I used Clang on FreeBSD and it compiles fine too.


A few details on your tutorial:

* All tools like elf2rom and newrpl-comp have a proper "install" target that copies the executable file into tools-bin for you. It is supposed to work on all targets except Windows. When you configure the project, select the "Release" target, then add a custom step after build, in which you put "install" as the sole argument. When you hit build, it will copy the file at the end for you. Doesn't work on Windows, as the executable has a different extension and the cp command is not supported.

* I gave up on trying to cross compile the firmware on Windows. arm-none-eabi-gcc always has issues with the paths. To build the firmware on Windows, I recommend an Ubuntu VM.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Short Guide on Compiling NewRPL - Han - 11-17-2016, 07:01 PM
RE: Compiling NewRPL Guide - Claudio L. - 11-17-2016, 07:26 PM
RE: Compiling NewRPL Guide - Han - 11-17-2016, 07:48 PM
RE: Compiling NewRPL Guide - Han - 11-18-2016, 03:12 AM
RE: Short Guide on Compiling NewRPL - Claudio L. - 11-18-2016 04:57 AM
RE: Short Guide on Compiling NewRPL - Han - 11-18-2016, 01:35 PM
RE: Short Guide on Compiling NewRPL - Han - 11-18-2016, 03:34 PM
RE: Short Guide on Compiling NewRPL - Han - 11-18-2016, 05:49 PM
RE: Short Guide on Compiling NewRPL - Han - 11-19-2016, 01:12 AM



User(s) browsing this thread: 1 Guest(s)