+PREFIX = /usr
+
all:
make -C pkernel/
+
+#install: all #this just work when $FUJDEV is set for root too, eh?
+install:
+ sed -e 's/%PREFIX%/\$(PREFIX)/g' frprog.py > $(PREFIX)/bin/frprog
+ cp SerialPort_linux.pyc $(PREFIX)/bin/SerialPort_linux.pyc
+ mkdir -p $(PREFIX)/share/frprog/
+ cp pkernel/pkernel.mhx $(PREFIX)/share/frprog/pkernel.mhx
+ chmod a+rx $(PREFIX)/bin/frprog
+ chmod a+r $(PREFIX)/bin/SerialPort_linux.pyc
+ chmod a+r $(PREFIX)/share/frprog/pkernel.mhx
+
+uninstall:
+ rm -R $(PREFIX)/share/frprog
+ rm $(PREFIX)/bin/frprog
+ rm $(PREFIX)/bin/SerialPort_linux.pyc
+
+.PHONY: uninstall
-insert $README here ;)
+What is frprog?
+frprog is a programmer written in python for programming an microcontroller of
+the FR Family by Fujitsu. It also includes a simple "kernel" (lets name it
+"pkernel") for communication to the PC, since the BootROM isn't able to modify
+the flash.
+
+
+Why?
+There are only programmers available on Windows.
+And Windows sucks, in particular we hate the clickage every time we want to
+flash a programm on the board. Sadly we don't have a monkey to do this job for
+us.
+
+
+Usage:
+> frprog [target mhx-file]
+where the target file must be a vaild MHX output of the Softune linker. frprog
+will instruct you through the process then.
+(We also build up a simple Makefile which calls their compiler, assembler, ...
+through wine, so we actually don't rely on Windows for our work :) Contact
+us if you are interested!)
+
+
+Supported Microcontroller:
+o MB91F465X (you find this controller in the "bits pot blue" board by Fujitsu)
+
+
+Installation:
+Do the common trick
+> make && sudo make install
+to install it. In case, adjust $PREFIX in the Makefile.
+
+For zsh-users, add this to your .zshrc:
+> _frprog() {
+> _files -J files -g '*.(#i)mhx(.)'
+> }
+> compdef _frprog frprog
+
+
+ToDo:
+o use checksum for transmission
+o verify flash
+o <insert your idea here>
+
+feel free to contribute!
+
+
+License and Disclaimer:
+GPL2 of course and YOU USE THIS PROGRAM ON YOUR OWN
+RISK ...
+
+
+Credits:
+Sebastian "theStack" Falbesoner // sebastian.falbesoner _AT_ gmail _DOT_ com
+Bernhard "lewurm" Urban // lewurm _AT_ gmail _DOT_ com
+
+Thanks to Holger for his value hints (check out also his featurerich programmer
+"FLASHly" http://home.arcor.de/ho/holger.wech/elektronik/ for Windows)
# check command line arguments
-if len(sys.argv) != 3:
- print "Usage: " + sys.argv[0] + " [pkernel mhx-file] [target mhx-file]"
+if len(sys.argv) != 2:
+ print "Usage: " + sys.argv[0] + " [target mhx-file]"
sys.exit(1)
# read in data from mhx-files before starting
try:
- bootloaderseqs = readMHXFile(sys.argv[1])
- pkernelseqs = readMHXFile(sys.argv[2])
+ try:
+ bootloaderseqs = readMHXFile("pkernel/pkernel.mhx")
+ except IOError as error1:
+ bootloaderseqs = readMHXFile("%PREFIX%/share/frprog/pkernel.mhx")
+ pkernelseqs = readMHXFile(sys.argv[1])
except IOError as error:
print sys.argv[0] + ": Error - couldn't open file " + error.filename + "!"
sys.exit(1)