Go to Post the robot is never done that it just evolves less rapidly - sporno [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 20-03-2005, 15:13
Validius's Avatar
Validius Validius is offline
There is a shadow following me.....
AKA: Mark Ratering
FRC #1549 (Washtenuts)
Team Role: College Student
 
Join Date: Feb 2005
Rookie Year: 2005
Location: South Lyon
Posts: 159
Validius will become famous soon enoughValidius will become famous soon enough
Send a message via AIM to Validius
I want a version of the mplab compiler for Linux.

'nuff said
__________________
When a sociaty comes to believe that human life is not inherently worth living, it is a slippery slope to the gas chamber. You wind up on a low road that twists past Columbine and leads toward Auschwitz.

-Peggy Noonan
  #2   Spotlight this post!  
Unread 20-03-2005, 16:31
jdong jdong is offline
Linux Nerd
AKA: John D
#0245 (Adam-Bots)
Team Role: Programmer
 
Join Date: Apr 2004
Location: Rochester, MI
Posts: 98
jdong will become famous soon enoughjdong will become famous soon enough
Re: I want a version of the mplab compiler for Linux.

I'm the current maintainer of Linux stuff around here.... You need:

1. WINE
2. MCC18 from Microchip -- it runs under WINE
3. IFI Makefile -- see http://adambots-live.sourceforge.net/
4. Picloader: http://sf.net/projects/ifi-picloader
__________________
John Dong
Co-Captain, Webmaster / Programmer
Team 245 -- Rochester Adams Robotics
  #3   Spotlight this post!  
Unread 20-03-2005, 16:56
Validius's Avatar
Validius Validius is offline
There is a shadow following me.....
AKA: Mark Ratering
FRC #1549 (Washtenuts)
Team Role: College Student
 
Join Date: Feb 2005
Rookie Year: 2005
Location: South Lyon
Posts: 159
Validius will become famous soon enoughValidius will become famous soon enough
Send a message via AIM to Validius
Re: I want a version of the mplab compiler for Linux.

Quote:
Originally Posted by jdong
I'm the current maintainer of Linux stuff around here.... You need:

1. WINE
2. MCC18 from Microchip -- it runs under WINE
3. IFI Makefile -- see http://adambots-live.sourceforge.net/
4. Picloader: http://sf.net/projects/ifi-picloader

I use WINE quite a bit and the software that was sent with the default kit wouldnt run. What is the differance between that and what you indicate?

[edit] Where do i get it? [/edit]
__________________
When a sociaty comes to believe that human life is not inherently worth living, it is a slippery slope to the gas chamber. You wind up on a low road that twists past Columbine and leads toward Auschwitz.

-Peggy Noonan
  #4   Spotlight this post!  
Unread 22-03-2005, 06:51
jdong jdong is offline
Linux Nerd
AKA: John D
#0245 (Adam-Bots)
Team Role: Programmer
 
Join Date: Apr 2004
Location: Rochester, MI
Posts: 98
jdong will become famous soon enoughjdong will become famous soon enough
Re: I want a version of the mplab compiler for Linux.

Install MCC18 using WINE, or copy from an existing Windows installation, over to /opt/mcc18. This is the path hardcoded into the makefile. Go to the appropriate Sourceforge project linked above, and download the latest ifi-makefile. You may have to browse CVS, as the latest version is awesome but not tested stable.
__________________
John Dong
Co-Captain, Webmaster / Programmer
Team 245 -- Rochester Adams Robotics
  #5   Spotlight this post!  
Unread 22-10-2005, 07:46
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: I want a version of the mplab compiler for Linux.

(Oldish thread warning)

What version(s) of WINE work with the MCC18 compiler? I have 20050725 and get
Quote:
Originally Posted by mcc18 under WINE
fixme:msvcrt:_spawnve :not translating name /home/ryan/bin/mcc18/binmcc18-traditional to locate program
Error executing /home/ryan/bin/mcc18/binmcc18-traditional. File or path is not found
This happens when running mcc18, so it apparently starts up, then tries to launch mcc18-transitional, but some path translation is broken in the version of WINE I am running.

The version on the SF Adambots-live site is 2004something, and I'd really rather not go that far back... (Getting IE6 working under the current version was a pain; I can't imagine trying it with something older.)

--EDIT--
Oh, yeah, and what purpose do the "Z:"s before some of the paths in the Adambots-live Makefile server? I'm changing it so everything will be under my home directory. Sorry, don't know a bunch about shell scriptiing/makefiles.
__________________


Last edited by Ryan M. : 22-10-2005 at 07:48.
  #6   Spotlight this post!  
Unread 23-10-2005, 19:26
jdong jdong is offline
Linux Nerd
AKA: John D
#0245 (Adam-Bots)
Team Role: Programmer
 
Join Date: Apr 2004
Location: Rochester, MI
Posts: 98
jdong will become famous soon enoughjdong will become famous soon enough
Re: I want a version of the mplab compiler for Linux.

Ok, Three things:

(1) you should link mcc18-traditional to mcc18-traditional.exe using the command [b]ln -sf /opt/mcc18/bin/mcc18-traditional.exe /opt/mcc18/bin/mcc18-traditional. This procedure must be repeated for cpp18 and _mplink.

(2) Check out http://adambots.gotdns.com/adambots-...k/configure.py -- Run "python configure.py" to auto-generate a Makefile within a project folder. Re-run after adding or removing files...

(3) Get the MCC wrapper scripts:
http://adambots.gotdns.com/adambots-...s/mcc-wrapper/

An RPM is available for RPM users; else just copy the three scripts to /usr/local/bin, making sure that they are chmodded +x
__________________
John Dong
Co-Captain, Webmaster / Programmer
Team 245 -- Rochester Adams Robotics

Last edited by jdong : 23-10-2005 at 21:15.
  #7   Spotlight this post!  
Unread 24-10-2005, 06:50
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: I want a version of the mplab compiler for Linux.

Thanks! It works now.

Just as an FYI for others (although you'll figure it out I'm sure): user_routines.c has an include for user_Serialdrv.h, but it's actually named user_SerialDrv.h. Either rename the file or change the include statement. (I renamed, so it may have been in other places as well.)
__________________

  #8   Spotlight this post!  
Unread 04-11-2005, 00:10
nukem nukem is offline
Registered User
#1676
 
Join Date: Jan 2005
Location: Hillsdale, NJ
Posts: 43
nukem is on a distinguished road
Re: I want a version of the mplab compiler for Linux.

Thank you guys sooo much! This really helped me out. Our school is a bunch of nazis that wont let us do anything on their computer and all I and the other programmers have are Linux machines. I just wish this was in gcc or microchip released a native linux version.
  #9   Spotlight this post!  
Unread 04-02-2006, 20:26
Goldeye Goldeye is offline
Registered User
AKA: Josh Hecht
FRC #0694 (Stuypulse)
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2005
Location: New York
Posts: 145
Goldeye has a spectacular aura aboutGoldeye has a spectacular aura aboutGoldeye has a spectacular aura about
Send a message via AIM to Goldeye
Re: I want a version of the mplab compiler for Linux.

Quote:
Originally Posted by jdong
Ok, Three things:

(1) you should link mcc18-traditional to mcc18-traditional.exe using the command ln -sf /opt/mcc18/bin/mcc18-traditional.exe /opt/mcc18/bin/mcc18-traditional. This procedure must be repeated for cpp18 and _mplink.

(3) Get the MCC wrapper scripts:
http://adambots.gotdns.com/adambots-...s/mcc-wrapper/

An RPM is available for RPM users; else just copy the three scripts to /usr/local/bin, making sure that they are chmodded +x

Nevermind. I managed to fix it. Working configure.py attached. Do the above stuff (part 2 was excluded) to get it working. I made it compatible with both RCs, and also made it `make clean` when you run the configure. That can be disabled if you have a slow computer. Set CLEAN near the top to False.

Run ./configure.py old to make it build for the old rc.
Run ./configure.py alltimers to use FRC_alltimers.lib.
You can mix both for the expected effect.

I can't test upload till morning though.
Attached Files
File Type: tgz configure.py.tgz (2.9 KB, 109 views)
__________________
Team 694

2005 Championship - Galileo Semifinalist
2005 New York - Regional Chairmans Award
2005 New York - Semifinalist (Thanks 1257,1340)

Last edited by Goldeye : 04-02-2006 at 20:27. Reason: added the [/b] to the quote
  #10   Spotlight this post!  
Unread 14-01-2006, 08:12
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: I want a version of the mplab compiler for Linux.

I believe I have the new compiler working... (I have yet to test the generated hex file, but I have no reason to believe it to be in error. However, you've been warned. )
  1. Install mcc18 compiler to /opt/mcc18.
  2. Do step 1 of jdong's post. (above)
  3. Download the configure.py attached to this post. (I only changed the processor passed to MCC18. May not even be necessary, but just in case...)
  4. Do step 3 of jdong's post.
  5. Edit /opt/mcc18/h/p18cxxx.h and put
    Code:
    #undef __18F8722
    #define __18F8722
    starting right after #define _P18CXXX_H

This fix/hack makes compiling for multiple processors difficult (have to change /opt/mcc18/h/p18cxxx.h), but hey... if you're working on FIRST, you're using a certain processor anyways.
Attached Files
File Type: tgz configure.py.tgz (2.7 KB, 165 views)
__________________

  #11   Spotlight this post!  
Unread 14-01-2006, 12:10
lasindi lasindi is offline
Registered User
FRC #1164 (Project Neo)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: New Mexico
Posts: 11
lasindi is an unknown quantity at this point
Re: I want a version of the mplab compiler for Linux.

Ryan, unfortunately I seem to be getting an error with the linker when I use your configure script. This is the output I get when I do "make" on the default code:
Code:
Linking...
mplink /l\""/opt/mcc18/lib"\" \""18f8722.lkr"\"  \""Z:\home\lasindi\.wine\drive_c\first\default_code\\FRC_library.lib"\" /m\""FrcCode.map"\" /o\""FrcCode.cof"\"
        Microchip MPLINK Linker
        Version 0.0+SVN20050725
DEBUG:Using wine /opt/mcc18//bin/_mplink /l"/opt/mcc18/lib" "18f8722.lkr" "Z:\home\lasindi\.wine\drive_c\first\default_code\FRC_library.lib" /m"FrcCode.map" /o"FrcCode.cof"  to launch mplink
MPLINK 3.90, Linker

Copyright (c) 2004 Microchip Technology Inc.

Error - no input object files specified.

Errors    : 1




Traceback (most recent call last):
  File "/home/lasindi/bin/mplink", line 51, in ?
    raise Exception,"Link Failed"
Exception: Link Failed
make: *** [FrcCode.hex] Error 1
Is there something I need to change in the makefile or configure script, or do you think this is a problem with the mplink wrapper script?

I also wonder whether or not my WINE install might be the problem. I'm running Ubuntu with wine 20050725 (the binary I got using apt-get). Which distro and wine version are you running?
  #12   Spotlight this post!  
Unread 14-01-2006, 12:22
nukem nukem is offline
Registered User
#1676
 
Join Date: Jan 2005
Location: Hillsdale, NJ
Posts: 43
nukem is on a distinguished road
Re: I want a version of the mplab compiler for Linux.

First of all you do not need to change anything in the code to get the 2006 code to compile for the 2006 controller, all you have to do is change a couple of things in the make file.

In the Makefile change the PIC to 18F8722 and the ARGS to ARGS=-D_FRC_BOARD -O+ -nw=2066. You do not need to install to /opt/mcc you can install anywere you want. For example I installed into ~/.wine/drive_c/mcc18 if you want to do that change the LIB CODE and INCLUDE paths to where ever you installed. I dont remember if I had to add or take out anything in ALL_TARGETS and INCLUDE_FILES but if you get an error from the linker about a file not being there add it. The reason why the code will fail sometimes is because he has gcc check deps to fix this add -D__$(PIC) to the line starting with cpp. Anyway I probably confused the hell out of everyone so ill post mine below.

Code:
#This is automatically generated by the configure.py script
#Keep your dirty hands off
#Run ./configure.py to generate a fresh one.
MCC18=./mcc18
PIC=18F8722 # Don't change
ARGS=-D_FRC_BOARD -O+ -nw=2066
LINKER=./mplink
MP2HEX=./mp2hex
IFILOAD=picloader_textmode
SERIAL_DEV=/dev/ttyS0
READLOG=./read.log
LIB_PATH=/home/nuke/.wine/drive_c/mcc18/lib
CODE_PATH=Z:\home\nuke\FIRST\frc-code-1-04-2006\\
INCLUDE_PATH=/home/nuke/.wine/drive_c/mcc18/h
INCLUDE_PATHW=Z:\\home\\nuke\\.wine\\drive_c\\mcc18\\h




ALL_TARGETS=user_routines_fast.o ifi_startup.o ifi_utilities.o user_routines.o user_Serialdrv.o main.o 
INCLUDE_FILES= ifi_default.h ifi_utilities.h user_routines.h user_Serialdrv.h delays.h ifi_aliases.h 
############ Targets: 
default: FrcCode.hex

#Remove all the individual file backup (The files ending with ~)
#NOTE that this does NOT remove your tbz2 backups!
clean-backup-files:
	@echo -e "Removing all the ~ backup files your annoying editor makes..."
	@find . -name "*~" |xargs rm -f

#Removes all compiled files from the directory
clean: clean-backup-files clean-deps nohex
	@echo -e "Cleaning compiler intermediate files..."
	@rm -rf *.o *.err

#Remove deps folder
clean-deps:
	@echo -e "Cleaning dependency folder..."
	@rm -rf .deps
	@mkdir .deps
	@touch .deps/dummy

#Remove hexfiles
nohex:
	@echo -e "Cleaning linker output and hex files..."
	@rm -rf *.hex *.cod *.cof

#These all start the IFI Loader.
safeload: prettycode clean check load
load: FrcCode.hex
	$(IFILOAD) FrcCode.hex $(SERIAL_DEV)

read:
	@echo -e "Monitoring $(SERIAL_DEV) for data"
	@echo -e "Output will also be logged to $(READLOG)"
	@echo -e "---------"
	@cat $(SERIAL_DEV) | tee $(READLOG) || /bin/true
	
	
prettycode:
	@echo -e "Using indent to autoformat your .c and .h files..."
	@indent *.c *.h
all: clean FrcCode.hex
%.o: %.c
	@echo -e "Compiling $@..."
	@echo -e "1.   Checking Dependencies for $@"
	@cpp -nostdinc -isystem $(INCLUDE_PATH) -M -MP -D__$(PIC) $< -MF .deps/$*.deps
	@echo -e "2.   Launching Compiler..."
	@$(MCC18) -p=$(PIC) -fo $@ $< /i\""$(INCLUDE_PATHW)"\" $(ARGS) 
	@echo -e "Done with $@."




FrcCode.hex :  $(ALL_TARGETS) $(INCLUDE_FILES)
	@echo -e "Linking..."
	$(LINKER) /l\""$(LIB_PATH)"\" \""18f8722.lkr"\" $(ALL_TARGETS) \""$(CODE_PATH)FRC_library.lib"\" /m\""FrcCode.map"\" /o\""FrcCode.cof"\"
	$(MP2HEX) FrcCode.cof



.deps/*: 
	@echo -e "Creating Dependency Makefiles..."
	@mkdir -p .deps
	@touch .deps/dummy
	@echo -e "Done!"

include .deps/*
As for the ifi-pictools has anyone got code to load on the 2006 controller? The numbers roll but I dont know anything is being loaded onto the controller.
  #13   Spotlight this post!  
Unread 14-01-2006, 16:52
psquared89's Avatar
psquared89 psquared89 is offline
Registered User
AKA: Pat Pannuto
FRC #0245 (Adambots)
Team Role: Driver
 
Join Date: Mar 2005
Rookie Year: 2004
Location: Rochester Hills, MI
Posts: 73
psquared89 is a jewel in the roughpsquared89 is a jewel in the roughpsquared89 is a jewel in the roughpsquared89 is a jewel in the rough
Re: I want a version of the mplab compiler for Linux.

Sorry about the delay guys. I'm at Siemens (our build site) with the beloved John Dong right now, we've updated the configure.py script for the '06 stuff.

Put http://adambots.gotdns.com/adambots-...o/configure.py in your project folder, then run it with "python configure.py" to generate Makefiles. Re-run it every time you add/remove c/h files from the project.
__________________
At the end of the game, the King and the Pawn both go back into the same box.
~ Italian Proverb
---------------------------------
adambots.com
  #14   Spotlight this post!  
Unread 14-01-2006, 22:31
lasindi lasindi is offline
Registered User
FRC #1164 (Project Neo)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: New Mexico
Posts: 11
lasindi is an unknown quantity at this point
Re: I want a version of the mplab compiler for Linux.

I figured out my problem. The configure.py script depends on gawk, and I didn't have it installed. Once I installed gawk, everything works great. Thanks to everyone for your help and your code!
  #15   Spotlight this post!  
Unread 15-01-2006, 03:28
nukem nukem is offline
Registered User
#1676
 
Join Date: Jan 2005
Location: Hillsdale, NJ
Posts: 43
nukem is on a distinguished road
Re: I want a version of the mplab compiler for Linux.

Quote:
Originally Posted by lasindi
I figured out my problem. The configure.py script depends on gawk, and I didn't have it installed. Once I installed gawk, everything works great. Thanks to everyone for your help and your code!
Two things, first have you gotten it to load code with the ifi-pictools or have you made code changes to that also? Second, I was thinking why not have the script read the project files from MPLab and use that to set everything(PIC type, CFLAGs, etc)? Once it reads the file it could ask the user if they want to use the ones imported from the file or edit it themselves. I was going to do it myself but I dont have any time(playing with the camera too much heh)
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
MPLAB C18 problem Justyn Programming 0 09-03-2005 11:37
IMPORTANT regarding the new C Compiler dlavery General Forum 12 14-01-2005 05:05
Makefile and stripped down compiler Venkatesh Programming 0 09-01-2005 18:55
MPLAB IDE 6.60 Error mchan1111 Programming 8 08-11-2004 20:17
using the MPLAB IDE MPLAB SIM simulator WizardOfAz Programming 1 03-11-2003 01:24


All times are GMT -5. The time now is 17:04.

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