make install && README
authorBernhard Urban <lewurm@gmx.net>
Fri, 18 Dec 2009 16:28:52 +0000 (17:28 +0100)
committerBernhard Urban <lewurm@gmx.net>
Fri, 18 Dec 2009 16:28:52 +0000 (17:28 +0100)
Makefile
README
frprog.py

index d49406d2fea9af93bc091203fdfc4a9d3c10f858..9f3c3b96381389bd8caf1c5459528ef21311aad0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,2 +1,21 @@
+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
diff --git a/README b/README
index bd8108ef15e2e975f1c95a2c7e9631c14bf13cb2..3684bdebb9f606baa91d9ada46540306d5beb33c 100644 (file)
--- a/README
+++ b/README
@@ -1 +1,58 @@
-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)
index b9432a85c2a67f698ced568193561155cb65fb9e..73b5ae6826a2db81b2605483e876f17e8807409e 100755 (executable)
--- a/frprog.py
+++ b/frprog.py
@@ -183,14 +183,17 @@ def readMHXFile(filename): # desired mhx filename
 
 
 # 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)