View Single Post
  #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.