Free Eclipse IDE and GNU toolchain for ColdFire (Set up instructions and example for 5282)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Free Eclipse IDE and GNU toolchain for ColdFire (Set up instructions and example for 5282)

34,091 Views
mccPaul
Contributor I
Hi all,
 
I have eventually written up the instructions for setting up a complete C/C++ development system for Coldfire, using the Eclipse IDE, GNU toolchain and SubVersion for source control. All of the software is open source and can be downloaded for free (links are provided).
 
If you have a P&E Micro BDM cable, you also get integrated visual debugging with GDB.
 
There is no 'Managed Make' plugin, so you have to roll your own makefiles. I have created a hello_world application that can be used as a starting point. If you aren't willing or able to learn GNU Make (it is very complicated) then I suggest you look at commercial packages based on Eclipse that come with a 'Managed Make' plugin in - available from many suppliers of commercial tools for ColdFire.
 
Eclipse is a superb IDE that is supported with hundreds of free and commercial plugins for all sorts of development tasks. It is probably the best I have used in 20 years of professional programming! When you combine it with source control issue tracking and an integrated serial terminal (all available for free!!) you have a top quality professional developemnt environment.
 
This has all been written from the point of view of setting up a development environment for the 5282, hosted on a Windows platform. I'm sure that much of the instructions can be adapted for Linux but don't ask me for help with Linux because I don't use it! It should be very easy to adapt the set up for other ColdFire/68K CPUs.
 
There is a PDF and HTML instructions hosted on my company's website:
 
 
Enjoy!
 
Paul.
 


Message Edited by t.dowe on 2008-10-30 02:59 PM
Labels (1)
0 Kudos
Reply
35 Replies

2,330 Views
mccPaul
Contributor I
Hi
 
Eclipse should work with any GNU toolchain, so if you can get one to support your CPU, then it should all work.
 
The CodeSourcery Coldfire GCC says that it supports 68K architecture and the 68332 CPU variant so I suggest you try it and see.
 
Paul.
0 Kudos
Reply

2,330 Views
rmelizalde
Contributor I
Hi!

I've followed the instructions in order to set up this IDE for M52233DEMO board. I can compile and everything seems to be OK until I try to debug, when an emerging window titled "Launching" shows the following message: "An internal error occurred during: 'launching'".

Any help would be apreciated.

Thanks in advance,

Ric


0 Kudos
Reply

2,330 Views
mccPaul
Contributor I
Hi
 
Do you know if gdb is working? You should be able to start a debug session from a standard MS-DOS command line, if you can't, then Eclipse won't be able to either.
 
It is possible that gdb's BDM stub is not working properly so you need to check that as well. I am assuming that you are using Codesourcery's m68k toolchain.
 
From an MS-DOS command line:
 
Change to the folder with your binary in.
Make sure that your toolchain folder is on your current PATH.
Enter:
m68k-elf-sprite -i
If the sprite and the BDM pod driver are installed properly you will see output something like this:
 
CodeSourcery ColdFire Debug Sprite (Sourcery G++ Lite 4.2-8)
pe: [speed=<n:0-31>&memory-timeout=<n:0-99>] P&E Adaptor
  pe://USBMultilink/PE6013569 - USB1 : USB-ML-CF Rev C (PE6013569)
  pe://CycloneProMaxSerial:1 - COM1 : Serial Port 1
  pe://ParallelPortCable:1 - LPT1 : Parallel Port 1 (Address $0378)
ccs: [timeout=<n>&speed=<n>] CCS Adaptor
  ccs://$Host:$Port/$Chain_position - CCS address
 
The parallel port and serial port are detected, but no device is shown. My USB pod is detected as you can see above.
 
If you don't see your BDM pod, then you have an installation problem of some kind.
 
Now you can try gbd. Type:
 
m68k-elf-gdb
 
You should see the GDM preamble and a (gdb) prompt.
 
Now enter the first line of the Eclipse debug startup script, which should be something like:
 
target remote | m68k-elf-sprite pe://USBMultilink/ m5282evb
 
You should get some output like:
 
Remote debugging using | m68k-elf-sprite pe://USBMultilink/ m5282evb
m68k-elf-sprite:smileysurprised:pening P&E USBMultilink port 1 (USB1 : USB-ML-CF Rev C (PE6013569))
m68k-elf-sprite:Target reset
0x00000000 in ?? ()
 
If you don't, then you need to investigate what is wrong (paths, installation, etc.)
 
Now type:
 
load your_elf_file.elf
 
And gdb should load your executable (we don't specify the filename in our script because Eclipse sets it for us).
 
Finally type:
 
continue
 
And your code should be executed.
 
If all this works, then you know that you have a good gdb installation.
 
Now you need to set the check box on the Ecilpse debug configuration dialog, Debugger tab, that is called "Verbose console mode". If you try and start a debug session now, you will see the output from gdb in the console which should hopefully point you in the direction of the problem.
 
I hope that helps,
 
Paul.
 
 
 
0 Kudos
Reply

2,330 Views
rmelizalde
Contributor I
Hi Paul,
 
First of all, thank you for your time.
 
I've followed your instructions (starting a gdb session from the command line) and I reach this point:
 
(gdb) target remote | m68k-elf-sprite pe://USBMultilink m52235evb
Remote debugging using | m68k-elf-sprite pe://USBMultilink m52235evb
m68k-elf-sprite:smileysurprised:pening P&E USBMultilink port 1 (USB1 : USB-ML-CF REF : M52230DE
MO (PE6015070))
m68k-elf-sprite:Target reset
0x00000000 in ?? ()
 
Whe I try to load the .elf, I get the following message:
 
(gdb) load hello_52233.elf
Loading section .text, size 0x91e8 lma 0x0
Load failed
 
I don't think this is because of a Flash memory malfunction because I can program it properly from CFFlasher and CodeWarrior.
 
At least, now I know that there is a problem with gdb so it is not a problem with Eclipse. However, I still can't figure out what is wrong.
 
I hope you can add any comments about this last issue.
 
Ric
0 Kudos
Reply

2,330 Views
mccPaul
Contributor I
Hi
 
Your executable needs to be compiled and linked to run in SRAM, you can't flash it with the version of the tools I am using, although I think CodeSourcery are adding support for this (maybe not in the free tools though).
 
I build a RAM version and debug it and then build a flash version and use CFlasher to flash it.
 
Cheers,
 
Paul.
0 Kudos
Reply

2,330 Views
admin
Specialist II
Hi Paul,

great tutorial! Thanks a lot.

I just wanted to add a note to your example write() function. It has to return the length of the string written instead of 0. Otherwise printf's won't work.

int write(int file, char *ptr, int len)
{
   int i;
   
   for (i = 0; i < len; i++)
   {
      uart0_out_char(*ptr++);
   }
   return len;
}


Best regards
Nathan
0 Kudos
Reply

2,330 Views
mccPaul
Contributor I
Hi Nathan,
 
Thanks for the vote of encouragement!
 
Watch this space for a big update to the Eclipse IDE for embedded work. At the moment I am testing the release candidates of the v3.3 Eclipse Platform with the C/C++ development tools v4.0 release candidate.
 
There are far too many improvements to the platform to mention in a short post, but suffice to say that the support for embedded development has improved no end since last June's releases. When the release versions are available (June 07), I'll add another tutorial.
 
Another worthwhile plugin that we are now using is Mylar which integrates Eclipse with issue trackers like Bugzilla, Trac, Jira, etc. I will also be investigating Buckminster, which looks like it will help with build management.
 
The Device Software Development Project (DSDP) is still at a relatively early stage as Eclipse projects go, but there are a load of interesting developments worth looking at there.
 
Cheers,
 
Paul.
0 Kudos
Reply

2,330 Views
mjbcswitzerland
Specialist V
Hi Paul, and others watching the thread!!

I have just found another document which describes the tool chain. It seems as though they have a single download which installs all necessary components (from GCC through Zylin CDT to Java).

I haven't tried it (I was actually looking for something else) but it may give some new ideas??

Here's the link: http://download.ronetix.com/toolchain/m68k_cross_development_guide.pdf

Regards

Mark

www.uTasker.com

0 Kudos
Reply

2,330 Views
mjbcswitzerland
Specialist V
Hi

Here's another update about Eclipse and GCC.

In the last couple of months I have also beein using Eclipse together with ARM GCC along side the Coldfire. It is nice to be able to switch between Coldfire and ARM project without even having to leave the IDE.

In fact I like the YAGARTO solution since it is so much easier to install. It is for ARM but basically if you just download the CodeSourcery GCC version for the Coldfire in addition to that then just about all is working.

Here are some more detailed instructions - professional GCC development work is certainly getting easier and the results are very good.

http://www.utasker.com/forum/index.php?topic=34.0 ARM but simplest basic install for chain.
http://www.utasker.com/forum/index.php?topic=14.0 specific to Coldfire - M5223X

Regards

Mark

www.uTasker.com

0 Kudos
Reply

2,330 Views
thm59
Contributor II
hello,

Just to add a small tip :
For the last step ("the icing of the cake" ), I tried to install the terminal, but it dont appaired in the windows views menu ( "show view" >> "other" ).

The solution was as follows :
Open a dos prompt command windows, and, after going in the eclipse directory, start eclipse with the dos command line :  eclipse.exe -clean

thierry

Alban Edit: reformatting following user request.

Message Edited by Alban on 2007-04-23 04:36 PM

0 Kudos
Reply

2,330 Views
bkatt
Contributor IV
1. Has anyone figured out how to set this up on Linux?

2. Is there any solution for loading the flash with Linux?
(using 52233 and 5282 parts with internal flash)

3. Can the USB BDM cable be used with Linux, or do you have to use a parallel cable?
0 Kudos
Reply

2,330 Views
mccPaul
Contributor I
To answer your first question, although I haven't set this up on Linux, the way to do it will be:
 
1. Set up a GNU m68k toolchain with support for the BDM version of gdb. There are some notes on the uCLinux website at http://www.uclinux.org/ports/coldfire/notes.html.
 
2. When this is working, in other words, when you can compile, link, upload images and debug using gcc and gdb from the command line you can install Eclipse and configure it it the way I have suggested in my notes. The main changes will be to any path names.
 
You may get a better answer to your other questions if you post a separate query in the forum.
 
Cheers,
 
Paul.
0 Kudos
Reply

2,330 Views
ynaught
Contributor III
Paul,
 
Thanks for the info in this post!  I'm anxious to try these tools.
 
I noticed that in your whitepaper section "How to get the software" your link to the eclipse binaries is just wrong.  Google helped me, but maybe you want to repair it?
 
Thanks for your input!
0 Kudos
Reply

2,330 Views
mccPaul
Contributor I
Thanks ynaught.
 
The correct URL for Eclipse downloads is http://download.eclipse.org/eclipse/downloads/. Now fixed in my instructions.
 
Paul.
0 Kudos
Reply

2,330 Views
timmer
Contributor I
NetBurner offers a complete tool chain based on Eclipse that includes compiler, linker, and debugger. The $99 development kit also includes a complete RTOS, TCP/IP stack, and web services in source form. The tools are built and ready to use. It's a great tool set, at a great price, take a look.

Tim Shannon
NetBurner Inc.
www.netburner.com
0 Kudos
Reply