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

来源:互联网 发布:维普数据库免费账号 编辑:程序博客网 时间:2024/06/06 23:19

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 toolsinside Eclipse/CDT as a Standard Make project. I believe the key was setting upthe environment variables correctly. (I used the method inthis previous post to determine the Tornado environment.)This approach still uses the Tornado project (.wpj) file and TCL scripts, soyou need to start with an existing Tornado project. You will then copy theTornado files into your Eclipse directory. This still beats editing in Eclipseand building in Tornado. Now I am able to edit and build in Eclipse. Note: thiswill work with both a downloadable or a bootable project.

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

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 inEclipse

These steps explain how to setup an "ExternalTool" in Eclipse to run a unix shell script. The shell script will run thecommands to start the vxworks simulator, start the target server, and run theshell. Luckily you don't need any unix tools because the Tornado distributionalready includes it. With this addition, now you can build your vxworks projectwith the method above and now start a vxworks simulator to download and runyour 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.)

2. c:/Tornado2.2/target/config/simpc/vxworks&

3. c:/tornado2.2/host/x86-win32/bin/tgtsvr-V -B wdbpipe -R c:/temp \

4. -RW -cc:/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".

  1. In Eclipse, from the "Run" menu, select "External Tools" > "External Tools..."
  2. Click on "Program", then press the 'New' button. (It is the button in the top left with a plus sign.)
  3. In the "Name:" field, type "vxsim_tool"
  4. In the "Location:" field, enter "c:\tornado2.2\host\x86-win32\bin\sh.exe"
  5. In the "Working Directory:" field, type whatever you want your working directory to be, e.g. "c:\"
  6. In the "Arguments:" box, enter "c:\sofeng\vxsim.sh"
  7. 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.
  8. Click "Apply" and "Close".
  9. Now to run it, go to the "Run" menu > "External Tools" > "vxsim_tool". (Or use the "External Tools" button on the toolbar.)
  10. 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.
  11. To download your application, see How to download a Vxworks application from the command line

原文出处:http://www.saltycrane.com/blog/2007/02/how-to-use-tornado-gnu-tools-with/

 

    阿科

    2012年12月27日于北京邮电大学新科研楼302室

 


原创粉丝点击