Daverj
Posts: 28
Joined: Tue Mar 06, 2012 2:23 am
Contact: Website

Options for development environment

Thu Jul 19, 2012 8:42 pm

I would think this is a big question for a lot of people using the Pi, and I'm surprised there isn't a sticky about it.

I'm an experienced C programmer (for about 30 years, on a number of platforms). I am a relative newb with Linux (dabbled at it off and on for about 15 years, but never long enough to get really comfortable with it). I do a lot of hardware and software design on WinXP for various targets (PIC, Freescale, FPGAs, etc...) and I prefer to do development on my XP computer with files stored on a file server so all my projects are kept together, and I can move around between different projects on the one computer.

I have been searching the Pi forum and Wiki for the past couple of days looking for what the options are for setting up a development system to write my own C programs to load into the Pi, and for modifying and compiling some larger open source programs, modified and stripped down for my purposes.

So far here is what I believe my options are:

1 - Develop on the Pi = This sounds very limiting and slow. Not much RAM, and not easy to compile large complex programs, and compile times sound like they are very slow for big stuff

2 - Run Qemu on WinXP, load a Pi distro and develop there. = While probably faster than doing it directly on the Pi I gather that the same RAM limitations exist, so large programs may still be difficult to compile

3 - a) format the HD for dual boot
b) or install VMware or VirtualBox
c) or buy a cheap laptop
d) or boot Linux from a CD
--- and then install Linux, a cross compiler, and some development environment
= this sounds like the most powerful way, with no real RAM or HD restrictions. After compiling, the programs will have to be copied to the SD card, or a USB stick, or ssh'ed up to the Pi for testing. But I have no problem with doing that, since I tend to be the type of programmer that writes code for hours between compiles, rather than change one line and want to see it running again.

So are these my choices? Are there other ways to go? (and if these options, and others, are already described in one place, could somebody point me there please?)

Cod3r
Posts: 4
Joined: Fri Jul 20, 2012 3:31 am

Re: Options for development environment

Fri Jul 20, 2012 3:35 am

Honestly, and I'm not trying to be a jerk, but a 700mhz arm computer with Linux will probably outperform anything that still runs windows xp.

Daverj
Posts: 28
Joined: Tue Mar 06, 2012 2:23 am
Contact: Website

Re: Options for development environment

Fri Jul 20, 2012 4:42 am

Cod3r wrote:Honestly, and I'm not trying to be a jerk, but a 700mhz arm computer with Linux will probably outperform anything that still runs windows xp.
From the compile times I've seen quoted in these forums for compiling large projects on the Pi, I seriously doubt that it will do so faster than my XP box with a 2.4GHz Core-2 Quad Core. Especially if that same hardware was running Linux (two of the choices described above)

But that really wasn't the question. I'm asking if what I outlined above are my options, or are there others? (and are the various options described in one place somewhere, with the various pros & cons?)

User avatar
accuser
Posts: 8
Joined: Fri Jul 20, 2012 4:33 am
Location: Cornwall, UK
Contact: Website

Re: Options for development environment

Fri Jul 20, 2012 5:04 am

I tried building a new Linux kernel on my Raspberry Pi, and it took almost 19 hours!

I have an 8-core Mac Pro which I use for development, having installed a cross compiler toolchain. I also have Ubuntu 12.04 installed under VMWare, which also has a cross compiler toolchain. Both are able to build successfully for the Raspberry Pi (including the kernel).

I honestly find that using my Mac Pro with the development environment that I use daily and am familiar with is much more productive that anything that I can achieve under the VM. I would suggest that you invest some time looking into installing or building a cross compiler toolchain that will run under Windows (perhaps Cygwin? http://www.cygwin.com)

User avatar
johnbeetem
Posts: 945
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Mountains
Contact: Website

Re: Options for development environment

Fri Jul 20, 2012 5:25 am

This thread might be useful: "Cross-Compiler for Windows" http://www.raspberrypi.org/phpBB3/viewt ... =24&t=4058

I've successfully used Code Sourcery Lite (hippy links to it in the 5th reply) to compile C code for BeagleBoard on Windows 2000. I did it under Cygwin so I'd have Unix utilities like make, diff, and grep.

Daverj
Posts: 28
Joined: Tue Mar 06, 2012 2:23 am
Contact: Website

Re: Options for development environment

Fri Jul 20, 2012 5:04 pm

Thanks for the suggestions. I did use Cygwin briefly about a decade ago, when trying to get ECOS running on a Cirrus ARM chip.

IanLinsdell
Posts: 21
Joined: Fri Jun 29, 2012 9:34 pm

Re: Options for development environment

Wed Jul 25, 2012 2:16 am

I have built two cross compilers for Raspberry Pi here:

https://github.com/IanLinsdell/Raspberrypi

One if for the original Debian Image using soft float and the other hard float raspbian.

I have not yet received my Pi but have compiled and tested the BroadCom samples,
a bunch of GTK+ samples, and a web server using:
Windows 7 64Bit, Eclipse with CDT plugin, these cross compilers and the make tool.

Since I do not have a Pi yet, I tested on QEMU (soft float)

You are welcome to download as it took my 8 core i7 machine around 5 hours to build each version of the cross compiler. The compilers themselves compile ARM code for Pi very fast.

Daverj
Posts: 28
Joined: Tue Mar 06, 2012 2:23 am
Contact: Website

Re: Options for development environment

Wed Jul 25, 2012 7:42 pm

Sorry if this is a dumb question, but I've heard of Eclipse but never used it.

Does this mean that I can install Eclipse on WinXP, install your compilers wherever Eclipse expects them, install "the make tool" (where do I get that?), and then I'd be able to run this from WinXP to do my development without having to install Cygwin, VM, or VirtualBox and a version of Linux?

If so, that sounds like what I'm after.

A related question: after compiling/linking a program, would the easiest way to get it over to the RPi be to just copy it from WinXP to a thumb drive and stick that into the RPi? I'm assuming there isn't a simple utility for XP that can write a file to the EXT4 partition of the SD card in a USB reader.

PaulBuxton
Posts: 57
Joined: Tue Jan 10, 2012 11:38 am

Re: Options for development environment

Thu Jul 26, 2012 2:10 pm

Daverj wrote:Sorry if this is a dumb question, but I've heard of Eclipse but never used it.

Does this mean that I can install Eclipse on WinXP, install your compilers wherever Eclipse expects them, install "the make tool" (where do I get that?), and then I'd be able to run this from WinXP to do my development without having to install Cygwin, VM, or VirtualBox and a version of Linux?

If so, that sounds like what I'm after.

A related question: after compiling/linking a program, would the easiest way to get it over to the RPi be to just copy it from WinXP to a thumb drive and stick that into the RPi? I'm assuming there isn't a simple utility for XP that can write a file to the EXT4 partition of the SD card in a USB reader.
Pretty much.
You will need to provide a version of Make that Eclipse knows how to use. This could either be through cygwin or the Gnu toolchain for windows. http://gnuwin32.sourceforge.net/


Personally I would recommend this as a good time to install and learn some linux. Your XP machine should be powerful enough to run a virtual machine (I can recommend VirtualBox) with a lightweight linux distribution which will give you a feel for developing on linux as well as for linux.

Paul.

davidkkc
Posts: 1
Joined: Mon Jul 07, 2014 8:58 pm

Re: Options for development environment

Mon Jul 07, 2014 9:11 pm

accuser wrote:I tried building a new Linux kernel on my Raspberry Pi, and it took almost 19 hours!

I have an 8-core Mac Pro which I use for development, having installed a cross compiler toolchain. I also have Ubuntu 12.04 installed under VMWare, which also has a cross compiler toolchain. Both are able to build successfully for the Raspberry Pi (including the kernel).

I honestly find that using my Mac Pro with the development environment that I use daily and am familiar with is much more productive that anything that I can achieve under the VM. I would suggest that you invest some time looking into installing or building a cross compiler toolchain that will run under Windows (perhaps Cygwin? http://www.cygwin.com)
I'm new to this RPI space. Can you share with experience doing cross development on your Mac OS? I have been searching for a procedure to setup cross compiler on my Mac using an existing ADT eclipse IDE. So far, I only saw the setup for Linux, but not on Mac. Someone mentioned about cross tool-ng, I don't want to create a separate partition for the installation. In addition, I have xcode installed and want to be extra cautious to avoid messing this up.

Any advices. Thank you in advance.

rotwang
Posts: 243
Joined: Sat Dec 07, 2013 1:12 pm

Re: Options for development environment

Tue Jul 08, 2014 2:25 pm

I am now at the testing phase of a cross-compiler build with crosstoolNG, once that is done I then need to tidy up the script which does the whole setup, and then run it to build the complete cross-compiler from scratch as a check on everything. I am building for an AMD64 machine running Debian 7 (wheezy), but as far as I can see the whole script is distribution and machine agnostic. Once testing reaches the stage where I can cross-compile a kernel plus some test software on the AMD64 and transfer and run them on a compute module, I will post the details, but not before. Also bear in mind that I am looking for acceptable performance on my primary desktop, which is AMD64, quad cores @ 4.2Ghz, 2Tb of hard disc, and system on an SSD, and basically goes like a rat up a drainpipe. (Translation: fast). You will have to make your own judgments about performance but as a rough guide for pi million digits of pi

Code: Select all

[email protected]:~$ time pi 3141593 >/dev/null

real	0m6.020s
user	0m5.920s
sys	0m0.080s

although that's only a single core. And note that this is not a mine's bigger than yours thing, it's a heads up that what I find acceptably fast may not work for you.

My reasons for doing it this way are mainly that I now have Debian 7 set up across several raspberry pi's, a compute module, a couple of laptops and 2 desktops, supporting a workflow that I am happy with, and I really don't want to spend the time and effort either turning Ubuntu into something I can work with, (which is why I switched from Ubuntu to Debian in the first place), or sorting out virtual machines. which I don't think would give me the performance anyway.

PiGraham
Posts: 3876
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Options for development environment

Tue Jul 08, 2014 3:14 pm

A reasonably priced commercial option is VisualGDB. If you have MS VisualStudio it gives you cross compilation and local (PC-vm) and remote (on RPi) debugging in a familiar PC environment.
http://visualgdb.com/tutorials/raspberry/

It supports multiple targets including Android and BeagleBone.

I don't think it does anything that can't be done several other ways for free, but I've tried it and it works pretty well.

User avatar
mikronauts
Posts: 2770
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Options for development environment

Tue Jul 08, 2014 3:49 pm

For RoboPi, I develop the Pi interface library on one of my Linux boxes natively, and when a new release is ready, I re-compile on one of my Pi's. This saves me a LOT of time due to the number of compile/debug cycles involved in a new version, and all I have to change is the name of the serial port from /dev/ttyAMA0 to whatever USB tty I end up on under Ubuntu.

I do natively compile PropGCC / OpenSpin / SimpleIDE, and it does take almost nine hours for PropGCC, and about two-three hours each for OpenSpin and SimpleIDE. I simply have not bothered to set up cross development environments yet, but plan to do so in the future.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

Return to “General programming discussion”