SaltyCrane Blog — Notes on JavaScript and web development

How to use Tornado GNU tools with Eclipse 3.2 / CDT 3.1

Configuration: VxWorks 5.5, Tornado 2.2, GNU toolchain, simulator target, Eclipse 3.2, CDT 3.1, Windows XP.

I've finally figured out how to use the Tornado GNU tools inside Eclipse/CDT as a Standard Make project. I believe the key was setting up the environment variables correctly. (I used the method in this previous post to determine the Tornado environment.) This approach still uses the Tornado project (.wpj) file and TCL scripts, so you need to start with an existing Tornado project. You will then copy the Tornado files into your Eclipse directory. This still beats editing in Eclipse and building in Tornado. Now I am able to edit and build in Eclipse. Note: this will work with both a downloadable or a bootable project.

Update 2007-03-20: I now can start a Vxworks simulator, target server, and shell as an external tool in Eclipse. I've added those steps at the end of this guide.

Steps for building your project in Eclipse

  1. Assume your Tornado project directory is C:\sofeng\proj\Project0
  2. Open eclipse.exe and open the C/C++ perspective
  3. From the "File" menu, select "New" -> "Standard Make C Project"
  4. Enter the project name and the workspace location; click "Next" NOTE: Make sure these paths do not contain spaces. (e.g. "Documents and Settings")
  5. Click the "Make Builder" tab.
    • Uncheck "Use default" checkbox. In the "Build command:" textbox, enter "make"
    • Check the "Build on resource save (Auto Build)" checkbox. Delete the text "all" in the textbox. Delete the text "all" from the next textbox also.
  6. Click the "Environment" tab
    • Set the following environment variables using the "New..." button:
      • Path = C:\Tornado2.2\host\x86-win32\bin;
      • SHELL = C:\WINDOWS\system32\cmd.exe
      • TCL_LIBRARY = C:\Tornado2.2\host\resource\tcl
      • WIND_BASE = C:\Tornado2.2
      • WIND_HOST_TYPE = x86-win32
    • Select the "Append environment to native environment" option.
  7. Click the "Discovery Options" tab. Uncheck the "Automate discovery of paths and symbols" checkbox.
  8. Click "Finish"
  9. In the "C/C++ Projects" Window, right-click on your project and select "Import..."
  10. Under "General", select "File System". Click "Next"
  11. In the "From directory:" box, enter "C:\sofeng\proj\Project0"
  12. Select all the files including "Makefile" and "Project0.wpj". You do not need to select "SIMNTgnu"
  13. Select the "Create selected folders only" option
  14. Click "Finish"
  15. Your project should start building

Steps for using the Vxworks simulator and shell in Eclipse

These steps explain how to setup an "External Tool" in Eclipse to run a unix shell script. The shell script will run the commands to start the vxworks simulator, start the target server, and run the shell. Luckily you don't need any unix tools because the Tornado distribution already includes it. With this addition, now you can build your vxworks project with the method above and now start a vxworks simulator to download and run your project.
  1. Create a new text file and enter the following text. The ampersand's makes the process run in the background allowing the tools to run simultaneously. (Note the use of forward slashes is significant.)
    c:/Tornado2.2/target/config/simpc/vxworks &
    c:/tornado2.2/host/x86-win32/bin/tgtsvr -V -B wdbpipe -R c:/temp \
    -RW -c c:/Tornado2.2/target/config/simpc/vxWorks.exe vxsim &
    C:/Tornado2.2/host/x86-win32/bin/windsh.exe -q vxsim
    Save the file as "c:\sofeng\vxsim.sh".
  2. In Eclipse, from the "Run" menu, select "External Tools" > "External Tools..."
  3. Click on "Program", then press the 'New' button. (It is the button in the top left with a plus sign.)
  4. In the "Name:" field, type "vxsim_tool"
  5. In the "Location:" field, enter "c:\tornado2.2\host\x86-win32\bin\sh.exe"
  6. In the "Working Directory:" field, type whatever you want your working directory to be, e.g. "c:\"
  7. In the "Arguments:" box, enter "c:\sofeng\vxsim.sh"
  8. Click on the "Common" tab. Inside the "Display in favorites menu" box, check the "ExternalTools" checkbox. Also, make sure the "Allocate Console (necessary for input)" checkbox is checked.
  9. Click "Apply" and "Close".
  10. Now to run it, go to the "Run" menu > "External Tools" > "vxsim_tool". (Or use the "External Tools" button on the toolbar.)
  11. Your simulator should now start, the target server icon should appear in the system tray, and the Shell should appear as a "Console" window in Eclipse.
  12. To download your application, see How to download a Vxworks application from the command line

Related posts:
How to run the VxWorks Simulator from the command line
Tornado Tools Command Line Summary

Comments


#1 sofeng commented on :

Hi,

Nice article !

Could you mention though where (whether) actually the project files
were copied to (under Eclipse) ... or actually the build really took
place in your original project directory (that is in
C:\sofeng\proj\Project0) ?

Also I wonder if you have installed WindRiver's WorkBench 2.x (latest
is 2.6) IDE (which is Eclipse's based) ? - I have ... .
WindRiver's WorkBench 2.x IDE is designed by WindRiver for new
memory-protected vxWorks 6.x and WorkBench 2.x comes with better
compiler ... WorkBench 2.x also allows to import/build VxWorks 5.5.1
/Tornado 2.2 project in a similar fashion as you described it (using
Tornado 2.2 gnu tool chain ... but in the original proj directory under
Tornado installation tree) - it would be nice though to see whether
newer compiler supplied with WorkBench 2.x could be used for building
VxWorks 5.5.1 /Tornado 2.2 project as well (WindRiver is not
interested in providing instructions for such option - they want
VxWorks 5.5.1 /Tornado 2.2 users to migrate to vxWorks 6.x instead ...).

Regards,
Alex

Hi Alex,
To answer you first question, I copied my files from the original project directory to a new directory to be used with Eclipse. It may work to leave the files in the original location, but I have not tried it.

I do not have WindRiver's Workbench. I wish I did. Since I don't have Workbench, that is why I am using Eclipse with Tornado. I think Workbench 2.5 and later has limited support for VxWorks 5.5 (which includes building your project). So if you have Workbench 2.5 or later, I would use it instead of my method. Here is a Wind River .pdf article you may or may not have seen: http://www.windriver.com/whitepapers/VxWorks-5_Support_Workbench_2-5_wp.pdf
-sofeng


#2 Anonymous commented on :

Hola Sofeng,

First of all, I would like to congrats you for your site. It has been very useful for me and I am sure for many others too! I really thank you for all the hard work.

I wonder if you could help please. I am using Tornado2.2 on a PC win64. And I am no able to install ULIP :-( When I follow the procedure to install it it pups a window telling I should "Verify that the driver has been design for WINDOWS based on x64". Any ideas on what I should do? Thanks in advance.

Kindly regards,
Hector


#3 sofeng commented on :

Hi Hector,
Thanks for your comments. Unfortunately, I don't have any experience with win64 (or much with ULIP either).
-sofeng


#4 Jason commented on :

Hi Sofeng, Thanks for providing some very useful information about eclipse. I have a basic question for you. Can you tell me what tools do i need to compile and run an application on Vxworks board if i dont have wind-river workbench installed on my machine. I have eclipse available with me. -Jason


#5 Rafael commented on :

I downloaded Eclipse version 3.4.2. I cannot match your steps here to the current IDE. Will it be possible to get the steps above match the latest Eclipse version?


#6 Eliot commented on :

Jason, Rafael:
I'm sorry, I've switched jobs and no longer use VxWorks/Tornado or Eclipse. (If you have questions about Python or Emacs, fire away ;)


#7 Zigfried commented on :

Thanks man, your post just save my life !!!:)


#8 Kevin commented on :

Eliot, Good job with paving the way for us!

Rafael, I don't have the Eclipse version as Eliot either. I have Eclipse Helios Service Release 1. However, I think I am on the right track.

1) Create an empty project for C/C++. 2) Import your project(File > Import) 3) RightClick on your project name select Properties. 4) On the left handside, you should see C/C++ Build. Select the item, you should be able to uncheck "Use default build command" and put in "make". 5) After expanding the C/C++ Build, you should see an item called "Environment". Add the environment as Eliot explained then select "Append variables to native environment" at the bottom. Then hit Apply.

Unfortunately, I am still not able to build yet but I believe I am on the right track. Hopefully, these instruction is far enough for Eliot to come in and help :). Good job Eliot!


#9 sayonee commented on :

Hello Eliot I am interested in learning VxWorks and I am looking for a project which can help me to understand and implement VxWorks ...Please let me know where I can find one ...i have tried searching on the Internet but can't find one ....Thanks and regards