• No results found

1. 2008 MPC8313eRDB BSP install

This guide describes how to install the development environment for the MPC8313e-RDB RevC development board. There are significant changes between the development board versions, so the 20081226 BSP will only work with the RevC version. Older boards need the BSP CD that came with the board.

- install a Linux distro like ubuntu

- download bsp iso from Freescale for MPC8313E-RDB - mount iso, cd to it

- run installer

<iso_directory>./install

Follow instructions on screen. Point the install dir to your homedir or something. You don’t need to be root for running the package, so your homedir should be a nice place to put it.

- cd to the freshly installed dir cd ~/ltib-mpc8313erdb-20081222

- run LTIB as a normal user ./ltib

* if you don't have the right packages installed, ltib will tell you now, so install them with apt-get install <package>(search for the right names with Google or something, 'devel' is sometimes abbreviated to dev, build-essentials is for the most recent gcc version) - run ./ltib again

./ltib

* ltib could tell you to update sudo-config file, so do that.

* if ltib complains about # error "Never use <bits/byteswap.h> directly; include

<byteswap.h> instead.", just comment that out.

Some other problems could arise; go to

http://www.imxdev.org/wiki/index.php?title=All_Boards_LTIB for more help on building ltib.

2. Building the kernel

When you have your toolchain and packages working (successful build), then you can start building the real time kernel.

Run:

./ltib -m prep -p kernel

To extract the kernel package in <ltib install dir>/rpm/BUILD/Linux-2.6.23/

The patches in /opt/Freescale/pkgs/*.patch are applied in the last step of this process (details about what patches are applied and to disable them are in <ltib install

dir>/dist/lfs-5.1/kernel/kernel-2.6.23-MPC8313ERDB-revc.spec.in)

Now you can patch the kernel with the corresponding PREEMPT_RT patch, or switch it up with the ipipe-patch. After you're done, you can check the build with

./ltib -m scbuild -p <package>

Installing the built package

./ltib -m scinstall -p <package>

Deploy a package

./ltib -m scdeploy -p <package>

When everything goes ok, you can merge the changes into the main tree with ./ltib -m patchmerge -p <package>

It will generate a patch with the changes made.

The pre-clean process (make distclean) will remove some files, so the patch will contain some useless, but harmless entries

The patch is added to the default config in:

<ltib home dir>/dist/lfs-5.1/kernel/kernel-2.6.23-mpc8313erdb.spec.in

Run ltib again to config the build (and enable kernel config to enable real time extensions)

./ltib -c

IPIPE problems

Ipipe patch with denx-Linux instead of vanilla-Linux needs the patches applied, if one fails, check if you can fix it manually, I got 2 problems: A makefile, that i could add manually(lines were switched up) and a c-file where I copied the missing function from the original, patched kernel source. Without this function you will get a link error in the build process.

Command to patch the kernel manually:

patch -p1 < <patchname>.patch PREEMPT_RT problems

If you get the following compile error (PREEMPT_RT patch):

include/Linux/kallsyms.h:56: error: `NULL' undeclared

Add "#include <Linux/stddef.h>" to the file.

3. Loading the new kernel into board

I could not get TFTP running under Linux, so I ran Tftpd32-3.35-setup.exe from windows.

This works like a TFTP server out of the box. No NFS support tough.

Board TFTP setup

Connect a serial cable between the pc and the development board

Connect a Ethernet cable between the pc and the development board (most right, lower connector located on the 6 port Ethernet connector block)

Connect ATX supply

start a TFTP server on the pc, listening on the standard port for TFTP with IP address 192.168.1.11, and set the base directory to a directory with the files from your freshly build kernel. The files that are needed for booting can be found in '<ltib home dir>' and '<ltib home dir>/rootfs/boot'

These files are required:

mpc8313erdb.dtb rootfs.ext2.gz.uboot uImage

Start up a terminal program like putty on the pc with 115200baud, 8bit, no parity.

Push the power button located on the board.

Press any key in the terminal program to halt the boot process.

Type the following commands in U-Boot when booting for the first time:

setenv fdtaddr 400000 setenv loadaddr 600000 setenv ftdaddr 800000 setenv ramdiskaddr 1000000

setenv ramdiskfile rootfs.ext2.gz.uboot setenv serverip 192.168.1.11

setenv ethact TSEC0

setenv bootcmd run ramboot saveenv

Reboot the board, and if all is well, the board should download the kernel trough TFTP, and boot it.

Bijlage VIII: API

There is a Application Programming Interface(API) defined to use the test device. This API is very simple in design. There are only 3 commands:

Start start the test

Stop stop test prematurely

Status give status information like error conut, and seconds passed since start.

And 4 responses:

Info: a string with diagnostic info. It will start with 'Info:' and end with a newline Done test is done

Stopped test is stopped prematurely

These commands are send trough a telnet connection (standard port 23). This means that there has to be an Ethernet connection with the board. Telnet also needs an IP address. This address is written on the top of the test device.

Before we can send anything, we also need to tell the board what to send. To do this, we upload a test file called 'test.bin' to the home directory trough FTP. Login username is 'user' and password is 'user'. When we have the test file in the board, we can start the simulation by sending the telnet command 'Start'. The program will respond with some status ('Info:') messages through telnet, and continue running until the test is either stopped, or the program has reached the end of the test file. It will then send out some more status ('Info:') messages, and the response 'Done'. It is now ready for another start command.

When the command 'Stop' is send, the program will immediately stop the test. It will respond with 'Stopped'. It is now ready for another start command.

'Status' responds immediately with the current status ('Info:') messages.

Status info contains the following fields, separated by a space character, and a newline at the end:

'timeout_error_count=[value]' 'current_time=[value]'

'total_packages_send=[value]' 'pps_present=[true/false]' 'ticks_per_sec=[value]'