From 5b1e050a0c5d3fc992a0a29f55f2826aad135353 Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Fri, 18 Dec 2009 17:28:52 +0100 Subject: [PATCH] make install && README --- Makefile | 19 ++++++++++++++++++ README | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- frprog.py | 11 +++++++---- 3 files changed, 84 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index d49406d..9f3c3b9 100644 --- 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 bd8108e..3684bde 100644 --- 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 + +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) diff --git a/frprog.py b/frprog.py index b9432a8..73b5ae6 100755 --- 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) -- 2.25.1