LPCTool
From Bettyhacks.com - Hack BettyTV-Remote
(→Help) |
(→Lpctool-Probleme) |
||
Line 1: | Line 1: | ||
− | + | lpctool überträgt [[boop|Firmware]] über einen [[Interfaces PC zu Betty|Adapter]] [http://de.wikipedia.org/wiki/RS-232 seriell] zur [[Betty]]. | |
+ | Siehe auch: [[Betty-Heaven]] | ||
+ | |||
+ | ==Aktuelle Version== | ||
lpctool V0.9 | lpctool V0.9 | ||
This Software is free Software under GNU GPL 3 or later | This Software is free Software under GNU GPL 3 or later | ||
(c) 2007 Ch. Klippel <ck@mamalala.net> | (c) 2007 Ch. Klippel <ck@mamalala.net> | ||
− | + | Quellcode im SVN ansehen: http://boopfirmware.svn.sourceforge.net/viewvc/boopfirmware/lpctool/trunk/ | |
− | + | ==Forumsdiskussion== | |
+ | Die Ankündigung des Programms im Forum: http://bettyhacks.com/forum/index.php?topic=54.0 | ||
− | + | ==Funktion== | |
+ | Siehe [[#Flashvorgang]]. | ||
− | + | # Bootloader aktivieren | |
+ | ## Zusätzlich zu den Datenleitungen werden zwei Handshake-Signale benutzt | ||
+ | <pre> | ||
+ | PC Betty | ||
+ | ----------- | ||
+ | TX - RX | ||
+ | RX - TX | ||
+ | DTR - nReset | ||
+ | RTS - eINT1 | ||
+ | </pre> | ||
+ | # Flashtool ins RAM der Betty laden | ||
+ | # LPCTool sendet neue Firmware an Flashtool | ||
+ | # Flashtool schreibt neue Firmware in den Flash | ||
+ | |||
+ | ==Unterstützte Hardware== | ||
+ | |||
+ | Findet man unter [[Interfaces PC zu Betty]]. | ||
+ | |||
+ | ==Windows== | ||
+ | http://megabug.de/cmde/betty_pub/lpctool-cygwin.zip | ||
+ | |||
+ | Es gibt aber Einschränkungen, siehe [[LPCTool#Lpctool-Probleme]]. | ||
+ | |||
+ | ==Linux== | ||
+ | === Debian Paket === | ||
+ | Für Debian Basierte Distr. kann man folgendes Paket nehmen. | ||
<pre> | <pre> | ||
− | usage: lpctool [-d NAME] [-i] [-r [NAME]] [-R ADDRESS] [-X [ADDRESS]] [-a [NAME] [-A ADRDESS]] [-e] [-b [NAME] [-B ADDRESS]] [-E] [-s] [-S] [-c] [-C] [-v] [-V] | + | http://www.grautier.com/grautier/index.php?/plugin/dlfile_108 |
+ | </pre> | ||
+ | |||
+ | === selbst kompilieren === | ||
+ | Man benötigt die ARM-toolchain, siehe [[Entwicklungsumgebungen]] | ||
+ | |||
+ | Das LPCTool kann man unter Linux mit subversion herunterladen. | ||
+ | |||
+ | <pre> | ||
+ | svn co http://boopfirmware.svn.sourceforge.net/svnroot/boopfirmware/lpctool/ lpctool | ||
+ | </pre> | ||
+ | |||
+ | Alsdann kann das Programm compiliert werden: | ||
+ | |||
+ | <pre> | ||
+ | cd trunk | ||
+ | make | ||
+ | sudo make install | ||
+ | </pre> | ||
+ | Bei dem Paket für Debian Basierte Systeme | ||
+ | <pre> | ||
+ | dpkg -i LPCTool.deb | ||
+ | </pre> | ||
+ | |||
+ | ==Boop Flashen== | ||
+ | |||
+ | === LPCTool Parameter === | ||
+ | |||
+ | <pre> | ||
+ | usage: lpctool [-d NAME] [-i] [-r [NAME]] [-R ADDRESS] [-X [ADDRESS]] [-a [NAME] [-A ADRDESS]] [-e] [-b [NAME] [-B ADDRESS]] | ||
+ | [-E] [-s] [-S] [-c] [-C] [-v] [-V] | ||
+ | |||
-d NAME specify serial device, default is /dev/ttyS0 | -d NAME specify serial device, default is /dev/ttyS0 | ||
-i use compiled-in flash-tool instead of external ram image file | -i use compiled-in flash-tool instead of external ram image file | ||
Line 44: | Line 105: | ||
-v print version | -v print version | ||
-V be more verbose | -V be more verbose | ||
+ | </pre> | ||
− | |||
− | |||
− | + | ===Linux=== | |
− | + | ||
− | + | Flashen kann man dann z.B. so: | |
− | + | ||
− | + | <pre> | |
− | + | ./lpctool -d /dev/ttyS0 -i -v -e -a boop_rom.bin | |
</pre> | </pre> | ||
+ | |||
+ | Wenn man LPCTool installiert hat (Debian-Paket oder <code>make install</code>) lässt man das <code>./</code> weg. | ||
+ | |||
+ | ===Windows=== | ||
+ | Flashen kann man dann z.B. so: | ||
+ | |||
+ | <pre> | ||
+ | lpctool.exe -d /dev/com4 -i -v -e -a boop_rom.bin | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | === Flashvorgang === | ||
+ | |||
+ | <pre> | ||
+ | lpctool -d /dev/ttyUSB0 -i -v -e -a boop_rom.bin | ||
+ | |||
+ | lpctool V0.9 | ||
+ | |||
+ | This Software is free Software under GNU GPL 3 or later | ||
+ | (c) 2007 Ch. Klippel <ck@mamalala.net> | ||
+ | |||
+ | Info : erasing flash #0 before write | ||
+ | Info : using flash #0 image boop_rom.bin | ||
+ | Info : opening serial device /dev/ttyUSB0 | ||
+ | Info : reset into bootmode | ||
+ | Info : opening bootloader | ||
+ | Info : initiating auto-baud | ||
+ | Info : awaiting autobaud response | ||
+ | Info : got response, answering | ||
+ | Info : setting frequency | ||
+ | Info : switching baudrate | ||
+ | Info : disabling echo | ||
+ | Info : unlocking bootloader | ||
+ | Info : uploading compiled-in ram image | ||
+ | Info : starting ram upload | ||
+ | Info : ram upload complete, total bytes: 0x000049CC | ||
+ | Info : ram uploaded | ||
+ | Info : executing code at ram address 0x40000200 | ||
+ | Info : code execution started 0x40000200 | ||
+ | Info : opening ram tool | ||
+ | Info : opened ramtool | ||
+ | Info : opening flash0 image boop_rom.bin | ||
+ | Info : uploading flash0 image boop_rom.bin | ||
+ | Info : setting address to 0x80000000 | ||
+ | Info : erasing whole flash | ||
+ | Info : erasing flash | ||
+ | Info : whole flash erased | ||
+ | Info : enabling bulk write | ||
+ | Info : setting total number of bytes to 0x000301D8 | ||
+ | Info : starting flash upload | ||
+ | Info : flash upload complete, total bytes: 0x000301D8 | ||
+ | Info : flash #0 uploaded | ||
+ | Info : reset device | ||
+ | Info : closing file descriptor | ||
+ | Info : closing serial device /dev/ttyUSB0 | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | |||
+ | ==Lpctool-Probleme== | ||
+ | |||
+ | Falls nach dem Laden des Bootloaders (ramtool) die Fernbedienung neu startet (reset!) - | ||
+ | im Quellcode die Geschwindigkeit (u.a. TOOLBAUD) von 115.200 baud auf 38.400 baud | ||
+ | reduzieren. | ||
+ | "tcsetattr" toggelt beim Baud-Wechsel (38.400->115.200) den reset-Pin (Linux, CentOS 5, USB-Seriell-Kabel, Windows mit FT232R, Linux mit PL2303(H?)X. | ||
+ | |||
+ | Eine gebremste lpctool-cygwin für Windows gibt es [http://bettyhacks.com/forum/index.php?topic=54.msg842#msg842 im Forum]. | ||
+ | |||
+ | Eine mit cygwin für Windows gebaute Version, die ohne Baudratenwechsel bei 38400 baud auskommt gibt es ebenfalls [http://bettyhacks.com/forum/index.php?topic=241.msg1667#msg1667 im Forum]. Getestet mit PL-230? USB-UART Wandler. | ||
+ | |||
+ | |||
+ | Stellen im Code von LPCTOOL: | ||
+ | |||
+ | '''lpctool_serial.h''' ''Zeile 5'': | ||
+ | |||
+ | <nowiki>#define TOOLBAUD 115200</nowiki> | ||
+ | muss geändert werden in | ||
+ | <nowiki>#define TOOLBAUD 38400</nowiki> | ||
+ | |||
+ | '''serial.c''' ''Zeile 170'': | ||
+ | |||
+ | <nowiki>serial_setbrg (115200);</nowiki> | ||
+ | muss geändert werden in | ||
+ | <nowiki>serial_setbrg (38400);</nowiki> | ||
+ | |||
+ | [[Category:Tools]] | ||
+ | [[Category:Firmware]] |