Go to Post When you are able to get inside their heads, you will either... or.. B) Learn way to much, and end up running away screaming. - Either way, it'll be a learning experience. - Elgin Clock [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-01-2008, 19:17
itsnotabigtruck itsnotabigtruck is offline
Registered User
FRC #2002 (TETRA)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Tualatin, OR
Posts: 5
itsnotabigtruck is on a distinguished road
Visual Studio C18/MPLINK build rules >>>HERE<<<

I got tired of having to use MPLAB, and didn't want to install Eclipse (already had VS), so I wrote this build rules file in order to use VC to compile for the IFI RC.

This is very, very beta, and I am not responsible if it fries your robot, fries your computer, kills your dog, burns your house, etc.

Visual Studio MCC18 build rules file (right-click and choose Save Link As to download)

In order to use this:
  1. Create a Visual C++ project, preferably close to the root of the drive.
  2. Put mcc18.rules in your project directory
  3. Right-click the project in Solution Explorer and select Custom Build Rules
  4. Click Find Existing and find the mcc18.rules you put in the project directory
  5. Click No if you get asked whether you want to add the directory you chose to the build rules search path
  6. Click OK
  7. Right-click the project again and select Tool Build Order
  8. Check Microchip C18 C Compiler and Microchip MPLINK Linker, and uncheck everything else
  9. Click OK
  10. Right-click the project again and select Properties
  11. Select Microchip C18 C Compiler, then General
  12. Set these options:
    • Compiler Memory Model: Large
    • Target Processor: 18F8722
    • Additional Macros: _DONT_USE_TMR0;_LARGE_CODE;_FRC_BOARD
    • Suppress Warnings: 2066
  13. Then go to Optimization, and set more options (note that you probably don't need to turn off all of these optimizations, they're just the settings from the default code):
    • Disable Unreachable Code Removal: Yes (-Ou-)
    • Disable Tail Merging: Yes (-Ot-)
    • Disable Branch Optimization: Yes (-Ob-)
    • Disable Dead Code Removal: Yes (-Od-)
    • Disable Procedural Abstraction: Yes (-Opa-)
    • Disable Copy Propagation: Yes (-Op-)
    • Disable Redundant Store Elimination: Yes (-Or-)
  14. You might also want to set Default Char Unsigned to Yes (-k)
  15. Now go to Microchip MPLINK Linker and set these options:
    • Linker Script Search Path: $(ProjectDir) (in most cases)
    • Output HEX File Type: INHX32
    • Suppress .COD and .LST File Creation: Yes (/w)
    • Additional Input Files: 18F8722.lkr (if you're using the default IFI linker script)
  16. Now go to General under Configuration Properties
  17. Set Output Directory to Debug\bin (or somewhere else, if you prefer)
  18. Set Intermediate Directory to Debug\obj (or somewhere else, if you prefer)
  19. Set Extensions to Delete on Clean to "$(IntDir)\*;$(OutDir)\*.out;$(OutDir)\*.hex;$(Out Dir)\*.hxh;$(OutDir)\*.hxl;*.o" (no quotes)
  20. Set Configuration Type to Utility
  21. Click OK
  22. Copy all your code to the project folder
  23. Click the Show All Files button in Solution Explorer
  24. Select all your headers, C files, object libraries, and linker scripts (note: only include libraries and linker scripts for the 8722)
  25. Right-click them and select Include in Project
  26. Hit F6
  27. You're done!
  #2   Spotlight this post!  
Unread 17-01-2008, 21:01
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Visual Studio C18/MPLINK build rules >>>HERE<<<

Sweet!

I haven't had a chance to test it, but I will.
__________________
Eric Haskins KC9JVH
  #3   Spotlight this post!  
Unread 19-01-2008, 15:36
TheGouger's Avatar
TheGouger TheGouger is offline
Registered User
FRC #1053
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Ottawa, Canada
Posts: 2
TheGouger is an unknown quantity at this point
Re: Visual Studio C18/MPLINK build rules >>>HERE<<<

Good job. I have VS 2008 and it compiles with no problems. I haven't had the chance to test it on our robot, but I'll be able to do that sometime next week (I doubt there will be any significant problems )
  #4   Spotlight this post!  
Unread 25-01-2008, 01:22
itsnotabigtruck itsnotabigtruck is offline
Registered User
FRC #2002 (TETRA)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Tualatin, OR
Posts: 5
itsnotabigtruck is on a distinguished road
Re: Visual Studio C18/MPLINK build rules >>>HERE<<<

Here's an updated toolchain, which now includes a C# program which regexes the C18 output in order to make the error list work. Yay!

NEW TOOLCHAIN WITH ERROR FORMATTER

Note that this doesn't work with linker errors or warning level 3 messages (default is level 2).

Source is included; pls. upload if you improve it.
  #5   Spotlight this post!  
Unread 03-03-2008, 07:48
Heffo Heffo is offline
Registered User
no team
 
Join Date: Mar 2008
Location: Australia
Posts: 1
Heffo is an unknown quantity at this point
Re: Visual Studio C18/MPLINK build rules >>>HERE<<<

Hello,

Thanks for posting the information on how to use C18 from inside Visual Studio. I really hate the interface in MPLAB and love Visual Studio.

I have my *.c files compiling properly, generating the object files, but for some reason, the linker isn't being started to build the hex file. Do you have any suggestions as to what may be the issue.

I am using Visual Studio 2005 Professional.

Regards,
Robert Heffernan
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Build problems: MPLink 4.15 Linker... help? Trav-O Programming 2 12-01-2008 14:26
Confused on some rules about hurtling here Ghandric Rules/Strategy 2 10-01-2008 12:37
Visual Studio 2005 SP1 EHaskins Programming 0 21-12-2006 11:36
MPLink Error cloudago Programming 2 01-02-2005 23:00
Any pratical use for Microsoft Visual Studio .NET Pro Kyle Fenton General Forum 11 28-01-2003 16:59


All times are GMT -5. The time now is 00:51.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi