Benutzer-Werkzeuge

Webseiten-Werkzeuge


becki:linux:wago_750-860_tips

Dies ist eine alte Version des Dokuments!


Linux-FBK 750-860 Tips

Installation of the Toolchain

Done on Slackware 12.2. Information Source: Manual. The iso image is available at the Embedded-Linux page of the wago website (registration necessary).

su -
mount -o loop Linux_V3_20070403.iso /mnt/tmp #mount the BSP Cdrom Iso Image
cd /mnt/tmp/linux/toolchain
./install.sh
exit

This installs the following files and dirs (sudirs 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!

cd /mnt/tmp/linux/sources
./install.sh

This installs the following files and dirs (sudirs not listed; tested with find -mmin / -cmin):

/$HOME/uclinux-dist (1.3 GB)
/tftpboot/jffs2.img
/tftpboot/linux.flashme

Compile all

cd $HOME/uclinux-dist
make menuconfig # and exit without save!
make

This also creates new jffs2.img and linux.flashme files in /tftpboot which differ from the original one's :?:

Set Date/Time on Target

  1. 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.)
  2. Save the system time to the hardware clock: hwclock –systohc
  3. Afer a reboot a call to date should print the correct local time.

Update the Target System

Sources:

  1. Manual
  2. 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

  1. 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.
  2. Reboot and enter uboot 1)
  3. Type printenv to check the environment variables and correct the ipaddresses of the FBK and the server if required:
    setenv ipaddr 192.168.xxx.yyy
    setenv serverip 192.168.xxx.zzz
  4. 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)
  5. Type saveenv to save the modifications into the flash.
  6. 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)
  7. Only necessary if „Compile all“ (see above) hasn't been done: Mount the toolchain.iso and copy linux.flashme and jffs2.img to /tftpboot
  8. Update:
    run update-kernel
    run update-rootfs

    Dont use a managed Hub; if you encounter problems with your hub or switch, use a crosslink cable!

  9. 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!

Create a new App

Example App: „sbtimer“

Recipe

  • mkdir ~/uclinux-dist/user/sbtimer
  • touch ~/uclinux-dist/user/sbtimer/sbtimer.c
  • write a main() in sbtimer.c
  • Add sbtimer to the dir_y variable in ~/uclinux-dist/user/Makefile
  • Create ~/uclinux-dist/user/sbtimer/Makefile.
  • Cd to ~/uclinux-dist and call make user.
  • Upload sbtimer with FTP to the target

Makfile example

EXEC = sbtimer
 
all: install
 
# This adds an implicit rule for generating $(EXEC).o from $(EXEC).c:
$(EXEC): $(EXEC).o
	$(CC) $(LDFLAGS) -o $@ $(EXEC).o $(LDLIBS)
	cp $(EXEC) /targetfs/
 
romfs:
	$(ROMFSINST) /bin/$(EXEC)
 
clean:
	-rm -f $(EXEC) *.elf *.gdb *.o
 
install: $(EXEC)
	lftp -c "open root:wago@wago; cd bin; put $(EXEC); chmod a+x $(EXEC)"

What gets included?

FIXME

$(CFLAGS) :?:2) 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.

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.

Install cron

FIXME

Io-Api

  • /proc/driver/kbus/pab gibt Auskunft über die gesteckten IO-Module und deren Byte-Adressen
  • kbusdemo liegt in entgegen dem Manual in user/wagokbusdemo

Misc

  • Allgemeine Wago-Produkte-Doku / 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

  • NFS benutzen

Open Ends / To Do

  • Ist eine Austauschplattform (Wiki, Forum, FAQ's) zum 750-860 im Internet vorhanden?
  • Compiler: Woher kommen die Datentypen __u16, __u8, ...
  • c++-code mit /usr/local/bin/arm-elf-g++ verwendbar? Mit welchen Paramtern aufzurufen?
1)
see manual→5.10.2
2)
Where is CFLAGS?
Cookies helfen bei der Bereitstellung von Inhalten. Diese Website verwendet Cookies. Mit der Nutzung der Website erklären Sie sich damit einverstanden, dass Cookies auf Ihrem Computer gespeichert werden. Außerdem bestätigen Sie, dass Sie unsere Datenschutzerklärung gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website. Weitere Information
becki/linux/wago_750-860_tips.1262882467.txt.gz · Zuletzt geändert: 2010-01-07 16:41 von becki

Impressum - Datenschutzerklärung