Professional Documents
Culture Documents
System
using Zoom ColdFire
M5474LiteKit Development
Board
• Limitation Scope
– 32Bit Processor
– Processor with MMU (Memory Management Unit)
– Few Mbyte Code Size
Usef ull inf o: EmbeddedLinuxTalkUniForum.ppt
Embedded Linux Basic
BootLoader
• BOOTLOADERS Target Board
– Used to initialize the hardware Bootloader
– Provides mechanism for initial interaction
Kernel
with board
– Provides mechanism to boot kernel File system
– Configured and built for specific board
• Common bootloader
– ColdFire: Colilo, u-boot, dBUG
– Power Architecture™: u-boot
– ARM: blob, redboot, u-boot
– I386: GRUB, LILO
Source: linux_presentation1.pdf
Embedded Linux Basic
Kernel
• KERNEL Target Board
– Continued initialization of the board Bootloader
– Provides mechanism to interact Kernel
with devices (drivers)
File system
– Provides underlying protocol
support
– (TCP/IP) and OS
– The Linux kernel configuration
allows many features to be
selected and configured
Embedded Linux Basic
Kernel Modules
• KERNEL MODULES Target Board
Bootloader
– Implement device drivers Kernel
– Provide additional File system
functionality to kernel Kernel Modules
Source: Lab1_linux_arch_and_commands.ppt
Building Embedded Linux
• Toolchain and library
– Cross Compiler Gcc, Glibc, uClibc, Binutils
• Linux Kernel Source Code
• File system and basic application
– BusyBox: combined several native linux command
• Preconfigured Buildtools:
– Buildroot
– SnapGear
– LTIB: Linux the image builder
– Comercial licensed: IAR, Green Hils, etc.
Linux Kernel Source Code Tree
Linux File System Structure
From HW. Spec Says 4MB Boot Flash, but the upper 2MB access had been blocked by hardware
Conclusion:
Current flash size will only hold the bootloader code, the linux system may only run via a server,
a tftp server needed to deploy the kernel image and a nfs server to deploy the file server
Some changes to be made in the linux the image builder (LTIB) due to unsupported model.
Future work:
Asking for firmware CPLD code to vendor, to enable the compact flash access to get the system had ability to run
linux in standalone mode.
LTIB – Linux The Image Builder
Software Prerequisite
Requerment to build:
• Source Code m547x_8x_evb_20080811-final-ltib.iso, Available to download
at:
http://www.freescale.com/webapp/sps/download/license.jsp?colCode=CWF -MCF547X-548X-2-6-
KL&location=null&fpsp=1&WT_TYPE=Board%20Support%20Packages&WT_VENDOR=FREESCALE&WT
_FILE_FORMAT=iso&WT_ASSET=Downloads&Parent_nodeId=1100875301996736292646&Parent_pageT
ype=product
LPT
LAN with Cable PC
PC Cross Cable Windows
Running Xp
Linux Serial Cable
Cross F-F
Since we running as non root, it will output an error, but we must not run as
root to prevent any damage to system
Installing LTIB
• Change user to root
> Su
> Password: <type in
Password>
> Visudo
• Add the above needed
lines into user privilaged
section
Note: Change user name
„huntu2‟ to your local
username
To finish type in
“:wq”
Installing LTIB
• Now Change back to normal user from root by type in
> Exit
• Run the ltib again
> ./ltib
• To Follow the process, open in a new shell type in:
> cd <install_dir>/ ltib-m5475evb-20080808
> tail host_config.log –f
• Upon Succesfull build thoolchain are located at “/opt”, while other
remains at install dir. You may use it for creating your applications.
/<root> /<install_dir>/ltib-m5475evb-20080808/
/opt
freescale/usr/local/gcc-4.2.125-eglibc-2.5.125/m68k-linux
doc/
Uboot and kernel
rootfs/ boot u-boot.bin, uImage
image
release_log/ Directory that hold source
rpm/ BUILD/ code if modified
RPMS m68k *.rpm Rpm sources
tmp/
packages
Configuring the u-boot
• Current Board default for
M5475EVB
– Differ from M5474Lite
which don‟t have second
code flash
• Available u-boot
config don‟t have
M5474lite option
Configuring the u-boot
• From the u-boot Readme
files of the source it self,
there are M5475AFE to
M5475GFE model
supported by u-boot
Reference:1000331_Rev_B.pdf (ColdFire
Lite Development Kit QuickStart Guide)
Configuring the u-boot
• Press “i” to insert new character
• Add These lines below last option
conf ig PKG_U_BOOT_M5475AFE
bool "UBoot M5475AFE boot2MB,RAM64MB"
conf ig PKG_U_BOOT_M5475BFE
bool "UBoot M5475BFE boot2MB,code16MB,RAM 64MB“
conf ig PKG_U_BOOT_M5475CFE
bool "UBoot M5475CFE
boot2MB,code16MB,Video,USB,RAM64MB"
conf ig PKG_U_BOOT_M5475DFE
bool "UBoot M5475DFE boot2MB,USB,RAM64MB"
conf ig PKG_U_BOOT_M5475EFE
bool "UBoot M5475EFE boot2MB,Video,USB,RAM64MB"
conf ig PKG_U_BOOT_M5475FFE
bool "UBoot M5475FFE
boot2MB,code32MB,Video,USB,RAM128MB"
conf ig PKG_U_BOOT_M5475GFE
bool "UBoot M5475GFE boot2MB,RAM64MB”
• Choose the AFE (closest ones) model, exit and save, LTIB will
Compile and producing all images
Deploying u-boot
• The simplest way is to use the
CFlasher from windows xp
• You may also use dBug console
to flash the u-boot image
U-boot Result
• Upon sussesfull u-boot
load tou may check the
board info using “bdinfo”
and check the
environment using
“printenv” or in short “pri”
Configuring Kernel
• Recall “./ltib –
configure”
• Check on “configure
kernel” and “leave
kernel source”
• Exit and save
• LTIB will copy linux
source to
“rpm/BUILD/linux”
Configuring Kernel
• On The Kernel
configuration, click
paltform dependent
setup
• Click on
MCF547x/548x
support
Configuring Kernel
• The processor model
available are listed in the
menu, choose the same
as the u-boot model, that
will be MCF5474AFE
• Click select then exit and
save
• The LTIB will then
compile the kernel and
produced all images
• This kernel cannot be use,
since it still involve SEC
driver as previous finding,
if deployed to the board,
the kernel will halt at
loading M5484_device
Configuring Kernel
• The kernel source code placed in
the “rpm/BUILD/linux” directory
since we checked the “leave kernel
source” option.
• The processor spesific option are
placed at the “arch/” directory, as
explained before.
• Go to the
> cd rpm/BUILD/linux-
2.6.25/arch/m68k/coldfire/
> vi mcf548x-devices.c
• Press „I‟ to insert „//‟ in front of
“platform_device_register(&coldfire
_sec_device);” lines
• Press “:wq” to write and exit
Final LTIB Compilation Image
• Recall “./ltib” to compile all over again, this
time no need to configure because are
config are already in the correct place
• The ltib will produce all usabele images:
– u-boot.bin -> binary bootloader
– uImage -> binary kernel image
– rootfs/ -> root folder for nfs deployment
– rootfs.jffs2 -> root file system image for deploy
in flash
Host PC: Setting TFTP Server
• Re login as root by type in
> su
> password: <type in our
password>
• Call YAST to configure server
> yast
• Choose Network server->tftp
server->enable
• Click ok and finish.
> exit
• Copy uImage to /tftpboot
> cp rootfs/boot/uImage
/tftpboot/.
• Your kernel image is ready at
tftp server
Host PC: Setting NFS Server
• Copy the “rootfs/”
directory to “/tftpboot”
> cp –vrf rootfs/ /tftpboot/.
• Call “yast” to configure
server
• Choose “network service”
-> “NFS Server”
• Checklist “start”, disable
“NFSv4”, then press
“next”
Host PC: Setting NFS Server
• Choose “add” then browse to
“/tftpboot/rootfs”
• On the host wildcard, type in:
“rw,no_root_squash,async,no_
subtree_check”
• Click finish and exit
• Your NFS server are ready
u-boot Script
• TO make the u-boot to be able to
boot linux you must edit u-boot
environment.
• Set the ip address and server
> set ipaddr <board_ip>
> set serverip <server_ip>
• Set the boot argument to pass as
kernel command line that will be
executed by kernel
> set bootargs root=/dev/nfs rw
nfsroot=192.168.0.20:/tftpboot/rootfs
ip=192.168.0.30:192.168.0.20:192.168
.0.30:255.255.255.0::eth0:off
mtdparts=physmap-
flash.0:4M(uboot)ro
• Set the bootcmd that will executed
automaticly each u-boot resart
> set bootcmd „tftp 2000000 uImage;
bootm 2000000‟
• Save the environment to flash
> save
Linux First Run
• Reset the board, it will
execute script in the
u-boot environment
setting.
• First it will load kernel
(uImage) via tftp
server then loading
file system via nfs
server.
Linux First Run
• Congratulation you have
succeeded running linux
on your embedded board,
• You may use installed
application, adding new
application by
reconfiguring ltib (kernel,
package and busybox)
and or creating your own
application, just like
programming in native
linux running on PC.
Thank You