pyfrprog.git
14 years agouse this (http://svenpeter.blogspot.com/2009/08/pyftdi.html) wrapper for pyftdi
Bernhard Urban [Sun, 3 Jan 2010 14:44:47 +0000 (15:44 +0100)]
use this (svenpeter.blogspot.com/2009/08/pyftdi.html) wrapper for
libftdi
(http://www.intra2net.com/en/developer/libftdi/documentation/functions_func.html)

why?
now we should able to use higher baud rates. however, it is even slower
now. actually i don't know what's the reason for that.

14 years agotty must be global
Bernhard Urban [Sun, 3 Jan 2010 14:16:08 +0000 (15:16 +0100)]
tty must be global

14 years agoimproved structure, add main() function
theStack [Fri, 1 Jan 2010 19:11:38 +0000 (20:11 +0100)]
improved structure, add main() function

see http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#module-structure
and http://www.artima.com/weblogs/viewpost.jsp?thread=4829

14 years agosmall README changes + USPP lib mention
theStack [Sat, 19 Dec 2009 13:49:24 +0000 (14:49 +0100)]
small README changes + USPP lib mention

14 years agomake install && README
Bernhard Urban [Fri, 18 Dec 2009 16:28:52 +0000 (17:28 +0100)]
make install && README

14 years agoadd time measurement for performance comparisons
theStack [Tue, 15 Dec 2009 20:41:50 +0000 (21:41 +0100)]
add time measurement for performance comparisons

14 years agorenamed 'cmd' functions...
Bernhard Urban [Tue, 15 Dec 2009 03:24:16 +0000 (04:24 +0100)]
renamed 'cmd' functions...

14 years agodecreased wait-time for pkernel + mini cleanup
theStack [Tue, 15 Dec 2009 02:25:10 +0000 (03:25 +0100)]
decreased wait-time for pkernel + mini cleanup

14 years agosendByte() is now free of senseless sleeping -> speed increase! \o/
theStack [Tue, 15 Dec 2009 02:07:10 +0000 (03:07 +0100)]
sendByte() is now free of senseless sleeping -> speed increase! \o/

sleeping just *once* after telling the bootloader to set a new baudrate is sufficient!

14 years agosendByte()-sleep is only needed in bootloader-mode
theStack [Tue, 15 Dec 2009 01:59:35 +0000 (02:59 +0100)]
sendByte()-sleep is only needed in bootloader-mode

14 years agodeleted (uncommented, but anyway...) tests
theStack [Tue, 15 Dec 2009 01:54:24 +0000 (02:54 +0100)]
deleted (uncommented, but anyway...) tests

< 260 loc remain for the whole flasher - python rocks! :)

14 years agotwo become one ;) merged kernel.py into frprog.py
theStack [Tue, 15 Dec 2009 01:50:53 +0000 (02:50 +0100)]
two become one ;) merged kernel.py into frprog.py

14 years agoreadMHX() now takes filename instead of fp
theStack [Tue, 15 Dec 2009 01:09:04 +0000 (02:09 +0100)]
readMHX() now takes filename instead of fp

14 years agoMerge branch 'master' of wien.tomnetworks.com:pyfrprog
theStack [Mon, 14 Dec 2009 13:48:45 +0000 (14:48 +0100)]
Merge branch 'master' of wien.tomnetworks.com:pyfrprog

14 years agocamelcase fct name + removed useless comment
theStack [Mon, 14 Dec 2009 13:48:16 +0000 (14:48 +0100)]
camelcase fct name + removed useless comment

(yes that was pedantic)

14 years agofrprog.py: created function read_mhx_file
theStack [Mon, 14 Dec 2009 13:44:38 +0000 (14:44 +0100)]
frprog.py: created function read_mhx_file

14 years agoMerge branch 'master' of wien.tomnetworks.com:pyfrprog
Bernhard Urban [Mon, 14 Dec 2009 13:44:20 +0000 (14:44 +0100)]
Merge branch 'master' of wien.tomnetworks.com:pyfrprog

14 years agoomg, this preprocessor really fails
Bernhard Urban [Mon, 14 Dec 2009 13:44:13 +0000 (14:44 +0100)]
omg, this preprocessor really fails

14 years agocleaned up cmdBAUDRATE
theStack [Mon, 14 Dec 2009 13:35:05 +0000 (14:35 +0100)]
cleaned up cmdBAUDRATE

14 years ago-rw-r--r-- 1 lewurm lewurm 4244 2009-12-14 14:17 pkernel/pkernel.mhx
Bernhard Urban [Mon, 14 Dec 2009 13:18:13 +0000 (14:18 +0100)]
-rw-r--r-- 1 lewurm lewurm  4244 2009-12-14 14:17 pkernel/pkernel.mhx

14 years agocleanup
Bernhard Urban [Mon, 14 Dec 2009 13:05:18 +0000 (14:05 +0100)]
cleanup

-rw-r--r-- 1 lewurm lewurm 5620 2009-12-14 14:12 pkernel.mhx

14 years agoonly flush once for a sequence, detect 0xffs seqs
theStack [Mon, 14 Dec 2009 12:07:47 +0000 (13:07 +0100)]
only flush once for a sequence, detect 0xffs seqs

14 years agoremoved some asm code
Bernhard Urban [Mon, 14 Dec 2009 09:12:43 +0000 (10:12 +0100)]
removed some asm code

14 years agofaster baudrate for pkernel
Bernhard Urban [Mon, 14 Dec 2009 09:08:26 +0000 (10:08 +0100)]
faster baudrate for pkernel

14 years agomoved kerlen.py
Bernhard Urban [Mon, 14 Dec 2009 08:57:31 +0000 (09:57 +0100)]
moved kerlen.py

14 years agoadded further exit function, so the board restarts after reset
Bernhard Urban [Mon, 14 Dec 2009 08:53:20 +0000 (09:53 +0100)]
added further exit function, so the board restarts after reset

14 years agoRevert "added receivebyte with timeout. sometimes it will just hang,"
Bernhard Urban [Mon, 14 Dec 2009 08:49:26 +0000 (09:49 +0100)]
Revert "added receivebyte with timeout. sometimes it will just hang,"

This reverts commit 97455c66228fca7dfc8d0b1f397e01e98f1e3b6c.

14 years agoMerge branch 'master' of wien.tomnetworks.com:pyfrprog
Bernhard Urban [Mon, 14 Dec 2009 08:47:29 +0000 (09:47 +0100)]
Merge branch 'master' of wien.tomnetworks.com:pyfrprog

14 years agoremoved some unnecessary interrupt-related flashfunctions (because we
Bernhard Urban [Mon, 14 Dec 2009 08:46:14 +0000 (09:46 +0100)]
removed some unnecessary interrupt-related flashfunctions (because we
don't even use interrupts in pkernel)

14 years agoadded receivebyte with timeout. sometimes it will just hang,
Bernhard Urban [Mon, 14 Dec 2009 08:36:49 +0000 (09:36 +0100)]
added receivebyte with timeout. sometimes it will just hang,
unfortuanetly this isn't useful, since the MC hangs in a flashroutine...
hmpf :/

14 years agokernel.py: disable timeout (having blocking read)
theStack [Mon, 14 Dec 2009 08:12:28 +0000 (09:12 +0100)]
kernel.py: disable timeout (having blocking read)

14 years agoMEGAWOOT: it just works \o/
Bernhard Urban [Mon, 14 Dec 2009 07:21:12 +0000 (08:21 +0100)]
MEGAWOOT: it just works \o/

instructions: first, type make to build the pkernel. ignore the
warnings.
then start frprog.py and ram pkernel into ram:
> ./frprog.py pkernel/pkernel.mhx

when its done, the first led should be on. next command:
> ./pkernel/kernel.py <your target mhx file>

wait and have fun :D

14 years agouse chip erase command instead of deleting each cell. however, this
Bernhard Urban [Mon, 14 Dec 2009 06:19:13 +0000 (07:19 +0100)]
use chip erase command instead of deleting each cell. however, this
won't work atm.
although the code is executed from IRAM there seems to be further access
on the flash... i'll check this out...

14 years agow00t :)
Bernhard Urban [Mon, 14 Dec 2009 05:23:17 +0000 (06:23 +0100)]
w00t :)

the trick: erase first *all* sectors and then flash it, not erase,
flash, erase, flash, ...

14 years agookay, here is a programmer (=kernel.py) which communicate to the pkernel
Bernhard Urban [Mon, 14 Dec 2009 03:25:14 +0000 (04:25 +0100)]
okay, here is a programmer (=kernel.py) which communicate to the pkernel
running on the board. there are some operation done to the flash,
however it isn't correct (nothing happens after a reset)

note: atm you have to program the pkernel with a windows programmer.
note: use simpleprg.mhx to test it. (on larger files it takes *very*
long, due to a built-in debug delay ;))

todo: after pkernel works correctly, we have to reduce the .mhx size.
when the mhx file is small enough we can use the bootrom hack to load it
directly into ram. after that it should be done :)

14 years agoremoved USTACK
Bernhard Urban [Mon, 14 Dec 2009 02:04:17 +0000 (03:04 +0100)]
removed USTACK

14 years agochanged from K to X -- even more DRAM \o/
Bernhard Urban [Mon, 14 Dec 2009 01:59:24 +0000 (02:59 +0100)]
changed from K to X -- even more DRAM \o/

14 years agoremoved "CONST" section
Bernhard Urban [Mon, 14 Dec 2009 01:57:18 +0000 (02:57 +0100)]
removed "CONST" section

however, it is still there in the map... wtf?

14 years agoclockstuff too
Bernhard Urban [Mon, 14 Dec 2009 01:44:38 +0000 (02:44 +0100)]
clockstuff too

14 years agoremoved basically some clockrelated ifdef stuff
Bernhard Urban [Mon, 14 Dec 2009 01:40:44 +0000 (02:40 +0100)]
removed basically some clockrelated ifdef stuff

14 years agoleds "show" 0xaa when finished flashing process
Bernhard Urban [Mon, 14 Dec 2009 01:34:00 +0000 (02:34 +0100)]
leds "show" 0xaa when finished flashing process

14 years agosome cleanup
Bernhard Urban [Mon, 14 Dec 2009 01:33:18 +0000 (02:33 +0100)]
some cleanup

14 years agoremoved some uart strings and functions
Bernhard Urban [Mon, 14 Dec 2009 01:20:45 +0000 (02:20 +0100)]
removed some uart strings and functions

-rw-r--r-- 1 lewurm lewurm 5206 2009-12-14 02:21 pkernel/pkernel.mhx

14 years agorefactoring/reformatting fun...
Bernhard Urban [Mon, 14 Dec 2009 01:12:32 +0000 (02:12 +0100)]
refactoring/reformatting fun...

dude, i think the don't even have a tab key in japan.

14 years agow00t, wtf IT WORKS NOW!!!1
Bernhard Urban [Mon, 14 Dec 2009 00:33:17 +0000 (01:33 +0100)]
w00t, wtf IT WORKS NOW!!!1

BUT actually I have NO idea why!

14 years agowe can write 0x00 at 0xf4000, but nothing else... :(
Bernhard Urban [Sun, 13 Dec 2009 22:30:58 +0000 (23:30 +0100)]
we can write 0x00 at 0xf4000, but nothing else... :(
also added the a pragma section found in flash.c to all c-files... dunno
if it actually changes something.

14 years agonicer output; still don't work as desired :/
Bernhard Urban [Sun, 13 Dec 2009 22:03:35 +0000 (23:03 +0100)]
nicer output; still don't work as desired :/

14 years agothis commit won't work :(
Bernhard Urban [Sun, 13 Dec 2009 21:37:19 +0000 (22:37 +0100)]
this commit won't work :(

basically he tries to flash a programm (here it is simpleprg) to
0xf4000 and erase it before. unfortunately it will fail -- maybe because
the pkernel is executed itself from there?!
however, the readme.txt of the flashdemo says no... dunno :(

14 years agoprep for python kernelprog
Bernhard Urban [Sun, 13 Dec 2009 21:37:13 +0000 (22:37 +0100)]
prep for python kernelprog

14 years agoroot Makefile
Bernhard Urban [Sun, 13 Dec 2009 20:49:51 +0000 (21:49 +0100)]
root Makefile

14 years agomoved pkernel in a own directory
Bernhard Urban [Sun, 13 Dec 2009 20:49:19 +0000 (21:49 +0100)]
moved pkernel in a own directory

14 years agomerged flashdemo repo
Bernhard Urban [Sun, 13 Dec 2009 20:32:44 +0000 (21:32 +0100)]
merged flashdemo repo

Merge branch 'master' of wien.tomnetworks.com:flashdemo
Conflicts:
.gitignore

14 years agoactually we have to write it in IRAM, thus we have to skip addresses for
Bernhard Urban [Sun, 13 Dec 2009 07:28:39 +0000 (08:28 +0100)]
actually we have to write it in IRAM, thus we have to skip addresses for
section >= 0x148000 and also have to calculate a other writeaddress as
given in the mhx file. however, we need those addresses later for the
real flashing part (through pkernel)

14 years agoflashing will be done now in a simple loop
theStack [Sun, 13 Dec 2009 07:08:53 +0000 (08:08 +0100)]
flashing will be done now in a simple loop

14 years agorefactor fun
Bernhard Urban [Sun, 13 Dec 2009 07:06:43 +0000 (08:06 +0100)]
refactor fun

14 years agopkernel programmer init
Bernhard Urban [Sun, 13 Dec 2009 07:03:18 +0000 (08:03 +0100)]
pkernel programmer init

14 years agofirst version of mhx file support impl.
theStack [Sun, 13 Dec 2009 07:01:11 +0000 (08:01 +0100)]
first version of mhx file support impl.

o it can only handle S2 records (which means max. 6 bytes for the addresses) by now,
but other data records shouldn't be used by the fujitsu converter anyway i guess?
o data is only read and printed to stdout, but not really used, that will be done
in the next commit

14 years agookay, big fat note: clear the fucking watchdog timer...... DAMN ;)
Bernhard Urban [Sun, 13 Dec 2009 04:58:33 +0000 (05:58 +0100)]
okay, big fat note: clear the fucking watchdog timer...... DAMN ;)

14 years agoexecute own code from iram, however READ attention text before doing
Bernhard Urban [Sun, 13 Dec 2009 02:19:02 +0000 (03:19 +0100)]
execute own code from iram, however READ attention text before doing
something stupid

also added some (useful?) examples...

14 years agoa call to the end of the IRAM (0x00033ffc)...
theStack [Sat, 12 Dec 2009 04:15:53 +0000 (05:15 +0100)]
a call to the end of the IRAM (0x00033ffc)...

*really* starts the program that was flashed before - how crazy is that? does
that mean that instructions are called backwards or something like that? well,
at the moment i don't care new super mario bros is waiting xD

14 years agoimpl. CALL and CHECKSUM bootloader cmds, untested
theStack [Sat, 12 Dec 2009 04:00:08 +0000 (05:00 +0100)]
impl. CALL and CHECKSUM bootloader cmds, untested

14 years agoadd constants for device and baudrate
theStack [Sat, 12 Dec 2009 03:47:32 +0000 (04:47 +0100)]
add constants for device and baudrate

14 years agoadd a test with some more data and local chksum
theStack [Sat, 12 Dec 2009 03:35:23 +0000 (04:35 +0100)]
add a test with some more data and local chksum

+ decreased sleep time (1ms instead of 10ms just works fine)
+ doubled baud rate (the highest possible by now as it seems?)

14 years agoinitial commit
theStack [Sat, 12 Dec 2009 03:10:12 +0000 (04:10 +0100)]
initial commit

14 years agodecreased speed for led counter and stop it at the end of main
Bernhard Urban [Fri, 11 Dec 2009 23:33:26 +0000 (00:33 +0100)]
decreased speed for led counter and stop it at the end of main

14 years agolowercase plz
Bernhard Urban [Fri, 11 Dec 2009 23:10:01 +0000 (00:10 +0100)]
lowercase plz

14 years agoRevert "headerfile/makefile hax hax"
Bernhard Urban [Fri, 11 Dec 2009 23:08:47 +0000 (00:08 +0100)]
Revert "headerfile/makefile hax hax"

This reverts commit 828d4e7ae7bd728f23424ea58cc1b445a58328ac.

14 years agoheaderfile/makefile hax hax
Bernhard Urban [Fri, 11 Dec 2009 23:06:18 +0000 (00:06 +0100)]
headerfile/makefile hax hax

14 years agoright led port for bits pot blue board
Bernhard Urban [Fri, 11 Dec 2009 23:03:58 +0000 (00:03 +0100)]
right led port for bits pot blue board

14 years agodos2unix on all files + tab madness
theStack [Fri, 11 Dec 2009 22:57:46 +0000 (23:57 +0100)]
dos2unix on all files + tab madness

14 years agogitignore update
Bernhard Urban [Fri, 11 Dec 2009 22:13:51 +0000 (23:13 +0100)]
gitignore update

14 years agoinit
Bernhard Urban [Fri, 11 Dec 2009 21:59:40 +0000 (22:59 +0100)]
init