Benutzer-Werkzeuge

Webseiten-Werkzeuge


becki:linux:wago_750-860_tips

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
becki:linux:wago_750-860_tips [2009-06-09 16:48]
becki
becki:linux:wago_750-860_tips [2012-01-19 09:51] (aktuell)
becki
Zeile 1: Zeile 1:
-====== ​Tips zum Linux-FBK 750-860 ====== +====== Linux-FBK 750-860 ​Tips == 
-===== Howto update ​the System ==+===== Links == 
 + 
 +[[http://​www.wago.de/​catalogue/​documentDownload.do?​docOid=020000040002ca3b00050092|Data sheet 750-860]] -- [[http://​www.wago.de/​catalogue/​documentDownload.do?​docOid=0200000a0001f61b00030092|data sheet 750-863]] 
 + 
 +===== Installation of the Toolchain == 
 + 
 +Done on Slackware 12.2. Information Source: [[http://​www.wago.com/​cms/​downloads/​m086000e.pdf|Manual]]. The iso image is available at the [[http://​www.wago.com//​cps/​rde/​xchg/​SID-53EFFEF9-5907BC14/​wago/​style.xsl/​deu-11235.htm|Embedded-Linux page]] of the wago website (registration necessary). 
 + 
 +<code bash> 
 +su - 
 +mount -o loop Linux_V3_20070403.iso /mnt/tmp #mount the BSP Cdrom Iso Image 
 +cd /​mnt/​tmp/​linux/​toolchain 
 +./​install.sh 
 +exit 
 +</​code>​ 
 + 
 +This installs the following files and dirs (subdirs not listed; tested with ''​find -mmin / -cmin''​):​ 
 +  /​usr/​bin/​mkimage (via mkimage-0.3.0-1.i386.rpm) 
 +  /​usr/​local/​bin/​arm-uclinux-elf-* 
 +  /​usr/​local/​arm-uclinux-tools 
 +  /tftpboot 
 +  /tagetfs 
 + 
 +Additionally the following line is appended to ''/​etc/​sudoers''​ 
 +  %users ALL = NOPASSWD: /​bin/​mknod 
 + 
 +===== Install uClinux Kernel-Sourcecode and Example code == 
 + 
 +Installation as normal user! 
 + 
 +<code bash> 
 +cd /​mnt/​tmp/​linux/​sources 
 +./​install.sh 
 +</​code>​ 
 + 
 +This installs the following files and dirs (subdirs not listed; tested with ''​find -mmin / -cmin''​):​ 
 + 
 +  /​$HOME/​uclinux-dist (1.3 GB) 
 +  /​tftpboot/​jffs2.img 
 +  /​tftpboot/​linux.flashme 
 + 
 +===== Compile all == 
 + 
 +<code bash> 
 +cd $HOME/​uclinux-dist 
 +make menuconfig # and exit without save! 
 +make 
 +</​code>​ 
 + 
 +This also creates new jffs2.img and linux.flashme files in ''/​tftpboot''​ 
 + 
 +Note that the manual states to call ''​make menuconfig''​. But in my case it changed noting in ''​uclinux-dist'',​ so i think it is unnecessary. 
 + 
 +===== Set Date/Time on Target == 
 + 
 +  - Set the date/time in **UTC** with ''​%%date MMDDhhmm[[CC]YY]%%''​.\\ (According to the manual 4.3.2 date sets the realtimeclock,​ but this is //not// true.) 
 +  - Save the system time to the hardware clock: ''​hwclock --systohc''​ 
 +  - Afer a reboot a call to ''​date''​ should print the correct //local// time. 
 + 
 +===== Update ​the Target ​System ==
  
 Sources: Sources:
-  - [[http://​www.wago.com/​wagoweb/​documentation/​750/​eng_dat/​d086000e.pdf|Manual]]+  - Manual
   - [[http://​denx.de/​wiki/​DULG/​Manual|DENX U-Boot and Linux Guide (DULG)]] -> 5.9. U-Boot Command Line Interface   - [[http://​denx.de/​wiki/​DULG/​Manual|DENX U-Boot and Linux Guide (DULG)]] -> 5.9. U-Boot Command Line Interface
  
 This guide is based on the manual -> 5.10 File System and Linux Kernel Update This guide is based on the manual -> 5.10 File System and Linux Kernel Update
  
-  - Boot, log in as root and set the date/​time ​with ''​%%date MMDDhhmm[[CC]YY]%%''​. According to the manual 4.3.2 date is part of Busybox and sets the realtimeclock,​ so that the hwclock command is //not// necessary.+  - Boot, log in as root and set the date/​time ​(see above) 
 +  - Reboot and enter uboot ((see manual->​5.10.2)); ​''​LFBK #'' ​appears
   - Type ''​printenv''​ to check the environment variables and correct the ipaddresses of the FBK and the server if required:<​code>​setenv ipaddr 192.168.xxx.yyy   - Type ''​printenv''​ to check the environment variables and correct the ipaddresses of the FBK and the server if required:<​code>​setenv ipaddr 192.168.xxx.yyy
 setenv serverip 192.168.xxx.zzz setenv serverip 192.168.xxx.zzz
Zeile 14: Zeile 74:
   - Compare all other variables with the actual manual and correct them if required. Especially check ''​update-rootfs'',​ ''​update-kernel''​ & ''​update-ub''​. (E.g. ''​printenv update-kernel''​)   - Compare all other variables with the actual manual and correct them if required. Especially check ''​update-rootfs'',​ ''​update-kernel''​ & ''​update-ub''​. (E.g. ''​printenv update-kernel''​)
   - Type ''​saveenv''​ to save the modifications into the flash.   - Type ''​saveenv''​ to save the modifications into the flash.
-  - Start TFTP with ''/​tftpboot''​ as TFTP source directory (uncomment and modify the line in ''/​etc/​inetd.conf''​ accordingly;​ make ''/​etc/​rc.d/​rc.inetd''​ runnable and start it with ''/​etc/​rc.d/​rc.inetd restart''​) +  - Start TFTP on your development machine ​with ''/​tftpboot''​ as TFTP source directory (uncomment and modify the line in ''/​etc/​inetd.conf''​ accordingly;​ make ''/​etc/​rc.d/​rc.inetd''​ runnable and start it with ''/​etc/​rc.d/​rc.inetd restart''​) 
-  - Mount the toolchain.iso and copy ''​linux.flashme''​ and ''​jffs2.img''​ to ''/​tftpboot''​+  - Only necessary if "​Compile all" (see above) hasn't been done: Mount the toolchain.iso and copy ''​linux.flashme''​ and ''​jffs2.img''​ to ''/​tftpboot''​
   - Update:<​code>​run update-kernel   - Update:<​code>​run update-kernel
 run update-rootfs</​code>​Dont use a managed Hub; if you encounter problems with your hub or switch, use a crosslink cable! run update-rootfs</​code>​Dont use a managed Hub; if you encounter problems with your hub or switch, use a crosslink cable!
 +  - To see the boot messages and to get a login shell on the serial connection after the update to kernel 2.6 the little switch on the right side of the serial connector has to be set to the upper position!
  
-FIXME After update to kernel 2.6 no login prompt appears any more on the serial connection!+===== Apply Patches == 
 +==== "soft lockup"​ Patch ==
  
 +The FBK freezes with this message: ''​BUG:​ soft lockup detected on CPU#​0!''​
  
-===== Allgemeines =====+Download the patch from the [[http://​www.wago.com/​cps/​rde/​xchg/​wago/​style.xsl/​deu-16260.htm|Wago service]] and apply the patch according to the help file. Afterwards you again have to [[#compile all]], [[#update the target system]] and configure the [[#​webserver]].
  
-  * [[http://​www.wago.com/​wagoweb/​documentation/​index_d.htm|Allgemeine Wago-Produkte-Doku]] / [[http://​www.wago.com/​wagoweb/​documentation/​navigate/​nm0dc__e.htm|Links]] to Data Sheet & Manual +==== "RAM disk handling"​ Patch ==
-  * Wago stellt eine Support-Cd, diese wird im Folgendem CD_Linux_Controller genannt +
-  * Telnet und Ftp-Zugang mit root/wago +
-  * Ip-Adresse ändern mit ''​wagoset''​ +
-  * Bootstrap: /​etc/​inittab startet ua. /​etc/​startwago startet ua. /bin/mb_tcp (modbus)+
  
-===== Installation der Toolchain =====+FIXME May affect Unix domain sockets!
  
-... auf Slackware 10.2. Generelle Vorgehensweise gemäß [[file:///​R:/​Elktr-TB/​KaeserNet/​WAGO/​CD_Linux_Controller/​750-860_Handbuch_V12.pdf|Wago Linux Programmierhandbuch]]+===== Create a new App ==
  
-==== Arm-elf-tools installieren ====+Example App: "​sbtimer"​
  
-arm-elf-tools-20030314.sh ausführen. Erhältlich von http://​www.uclinux.org/​pub/​uClinux/​m68k-elf-tools/​ oder CD_Linux_Controller/​toolchain/​linux/​ Dies installiert: ​+==== Recipe ==
  
-  /usr/local/bin/​arm-elf-* +  ​* ''​mkdir ~/uclinux-dist/user/sbtimer''​ 
-  /usr/local/bin/elf2flt +  ​* ''​touch ~/uclinux-dist/user/sbtimer/sbtimer.c''​ 
-  ​/​usr/​local/​bin/​genromfs +  ​* write a ''​main()''​ in ''​sbtimer.c'' ​ 
-  /usr/local/bin/flthdr +  ​* Add ''​sbtimer''​ to the ''​dir_y''​ variable in  ~/uclinux-dist/user/Makefile 
-  /usr/local/lib/​gcc-lib/​arm-elf+  ​* Create ''​~/uclinux-dist/user/sbtimer/Makefile''​. 
-  /usr/​local/​man/​man1/​arm-elf-* +  ​* Cd to ''​~/uclinux-dist''​ and call ''​make user''​. 
-  ​/​usr/​local/​arm-elf/​+  ​* Upload ''​sbtimer''​ with FTP to the target
  
-==== /​usr/​bin/​mkimage installieren ====+==== Makfile example ​==
  
-  # rpm2tgz mkimage-0.3.0-1.i386.rpm +<code bash> 
-  # installpkg mkimage-0.3.0-1.i386.tgz +EXEC = sbtimer
-Dies installiert /​usr/​bin/​mkimage . Das Rpm gibts hier: Gibts CD_Linux_Controller/​toolchain/​linux/​+
  
-==== Benutzerrechte für mknod ändern ====+all: install
  
-visudo aufrufen und fogendes eintragen ​(Ändert /​etc/​sudoers): +This adds an implicit rule for generating $(EXEC).o from $(EXEC).c
-  ​%users ALL = NOPASSWD: /bin/mknod+$(EXEC)$(EXEC).o 
 + $(CC) $(LDFLAGS) -o $@ $(EXEC).o $(LDLIBS) 
 + cp $(EXEC) ​/targetfs/
  
-==== Anlegen der Transferverzeichnisse ====+romfs: 
 + $(ROMFSINST) /​bin/​$(EXEC)
  
-  # mkdir /tftpboot; chmod a+w /tftpboot +clean: 
-  # mkdir /targetfs; chmod a+w /targetfs+ -rm -f $(EXEC) *.elf *.gdb *.o
  
-==== uClinux Kernel-Quellcode installieren ====+install: $(EXEC) 
 + lftp -c "open root:​wago@wago;​ cd bin; put $(EXEC); chmod a+x $(EXEC)"​ 
 +</​code>​
  
-Installation als normaler user!+==== What gets included? ==
  
-  /​mnt/​CD_Linux_Controller/​sources/​linux$ ./​linux-kernel.sh +FIXME
-  ~/uClinux$ make menuconfig (alle Dialoge abbrechen) +
-  ~/uClinux$ make dep  +
-  ~/uClinux$ make+
  
-===== Eine neue Applikation erstellen =====+''​$(CFLAGS)''​ :?:((Where is CFLAGS?)) contains as the first ''​-I''​-switch the path ''​$HOME/​uClinux/​lib/​uClibc/​include'',​ which points to ''​$HOME/​uClinux/​uClibc/​include''​. Here are all common header files. ​
  
-Am Beispiel ​der App "​tester"​+Auch ''​asm/​types.h''​ wird hier gefunden, jedoch löst das der asm-Symlink tatsächlich nach ''​~/​uClinux/​linux-2.4.x/​include/​asm/​types.h''​ auf.
  
-  * mkdir ~/​uClinux/​user/​testdir +===== Webserver == 
-  * ~/​uClinux/​user/​testdir/​tester.c schreiben +==== Mime Types ==
-  * ~/​uClinux/​user/​Makefile:​ dir_y kbusapi ... testdir (einfügen) +
-  * ~/​uClinux/​user/​testdir/​Makefile erstellen. ~/​uClinux/​user/​wagoset/​Makefile als Vorlage benutzen! +
-  * Aufruf von ''​make user''​ von ~/uClinux aus! Dies compiliert offensichtlich alle ~/​uClinux/​user/​*/​*.c :?: +
-  * Programm tester per FTP übertragen+
  
-==== Was wird includiert? ==+The default Boa installation on the 750-860 serves CSS files with the mime type ''​text/​html''​ instead of ''​text/​css''​. This my lead to problems especially when HTML document type "​strict"​ is used. Go around this by adding the line 
 +  AddType text/css css 
 +to ''/​etc/​boa/​boa.conf''​
  
-$(CFLAGS) beinhaltet als ersten -I Schalter den Pfad ~/uClinux/lib/uClibc/include , was tatsächlich auf ~/uClinux/​uClibc/​include zeigtHier liegen alle gängigen Header-Dateien+:!: Note: The path to the mime.types file in ''​boa.conf''​ is wrong: ''​/etc/mime.types''​ instead of ''​/etc/boa/mime.types''​. But even wiht the correct path, the mime.types file seems to be ignored.
  
-Auch asm/types.h wird hier gefundenjedoch löst das der asm-Symlink tatsächlich nach ~/uClinux/​linux-2.4.x/include/asm/types.h auf.+==== Logging == 
 + 
 +:!: Error- and access logging does not work. If the according directive in ''​boa.conf''​ ist activatedeg ''​ErrorLog'',​ the server refuses to start. 
 + 
 +===== Install cron == 
 + 
 +Two cron apps are coming with wago uclinux-dist: cron and vixie-cron. cron ist smaller so I use this one. 
 + 
 +Add ''​cron''​ to the ''​dir_y''​ variable in ''​~/uclinux-dist/​user/​Makfile'',​ compile and install it on the target. 
 + 
 +Example: The following 2 files are necessary to make the digital output ​4.0 change its state every minute: 
 + 
 +<code bash> 
 +cat /etc/config/crontab 
 +
 +*  *  *  *  *  root  /​bin/​beckis 
 +</​code>​ 
 + 
 +<code bash> 
 +cat /​bin/​beckis 
 +#​!/​bin/​msh 
 +kbusdemo -n 4.
 +sleep 2 
 +kbusdemo -o 4.
 +</​code>​ 
 + 
 +FIXME Start cron at PO. Where to add the cron start command? In ''/​etc/​startwago''?​ Lock at Manual!
  
 ===== Io-Api ===== ===== Io-Api =====
Zeile 92: Zeile 176:
   * /​proc/​driver/​kbus/​pab gibt Auskunft über die gesteckten IO-Module und deren Byte-Adressen   * /​proc/​driver/​kbus/​pab gibt Auskunft über die gesteckten IO-Module und deren Byte-Adressen
   * kbusdemo liegt in entgegen dem Manual in user/​wagokbusdemo   * kbusdemo liegt in entgegen dem Manual in user/​wagokbusdemo
 +
 +===== Misc =====
 +
 +  * [[http://​www.wago.com/​wagoweb/​documentation/​index_d.htm|Allgemeine Wago-Produkte-Doku]] / [[http://​www.wago.com/​wagoweb/​documentation/​navigate/​nm0dc__e.htm|Links]] to Data Sheet & Manual
 +  * Wago stellt eine Support-Cd, diese wird im Folgendem CD_Linux_Controller genannt
 +  * Telnet und Ftp-Zugang mit ''​root/​wago''​
 +  * Ip-Adresse ändern mit ''​wagoset''​
 +  * Bootstrap: /​etc/​inittab startet ua. /​etc/​startwago startet ua. /bin/mb_tcp (modbus)
  
 ===== Todo ===== ===== Todo =====
Zeile 97: Zeile 189:
   * NFS benutzen   * NFS benutzen
  
-===== Offene Fragen ​=====+===== Open Ends / To Do =====
  
   * Ist eine Austauschplattform (Wiki, Forum, FAQ's) zum 750-860 im Internet vorhanden?   * Ist eine Austauschplattform (Wiki, Forum, FAQ's) zum 750-860 im Internet vorhanden?
-  * Shortcut zum Wiederholen des letzten Befehls in der Konsole? 
-  * Anzeige der Prozessorlast?​ (der Befehl top fehlt) 
   * Compiler: Woher kommen die Datentypen ''​%%__u16,​ __u8, ...%%''​   * Compiler: Woher kommen die Datentypen ''​%%__u16,​ __u8, ...%%''​
   * c++-code mit /​usr/​local/​bin/​arm-elf-g++ verwendbar? Mit welchen Paramtern aufzurufen?   * c++-code mit /​usr/​local/​bin/​arm-elf-g++ verwendbar? Mit welchen Paramtern aufzurufen?
-  * Was ist /​usr/​local/​bin/​arm-elf-c++ ?+
becki/linux/wago_750-860_tips.1244566131.txt.gz · Zuletzt geändert: 2009-06-09 16:48 von becki

Impressum - Datenschutzerklärung