Welcome, guest ( Login )

WikiHome » OperatingSystems » µClinux » Force Update zImage

Force Update zImage

Version 1, changed by guest. 07/21/2006.   Show version history

Generally it takes quite a while (time) to configure, recompile, and create the zImage in order to upload a change to the NIOS II processor. This is especially true when developing a user application. The CompileHello example gives you a simple method for testing out user applications by simply copying the compiled binary executable to the romfs or the rootfs. While this method works OK, make linux will not update the zImage every single time and this leaves you in a bit of frustration. You have two choices, either you can put your user program into the user applications in the uClinux source tree or you can force the zImage file to be updated. Adding your user application to the source tree is the "proper" thing to do however it requires that you clean the whole project and make the whole uClinux project. This takes about 5 - 10 minutes. Very very slow.

When I began my quest to have the zImage update I would::

make
make linux
make image

... then copy images/zImage to transfer to the NIOS II processor.

This mysteriously would not update all of the time (hardly ever).

So I found (after a few days of trying different things) I could do this:
make clean
make linux_hwselect SYSPTF=insert your.ptf
make
make linux
make image

... the copy images/zImage to transfer to the NIOS II Processor.

This worked however it takes a while (5 - 10 minutes) to do all of that. So I poked around the Makefile and on the wiki and finally stumbled upon some words of wisdom:

{
Whenever you update the ~/rootfs you have to compile the kernel and update the initramfs.

CHK usr/initramfs_list
CPIO usr/initramfs_data.cpio
GZIP usr/initramfs_data.cpio.gz
AS usr/initramfs_data.o
LD usr/built-in.o


If you didn't see the "CPIO" and "GZIP" in compile message, the initramfs is not updated. You will have to remove the file usr/initramfs_list in kernel dir, and compile again to force the update of initramfs.

} // Extracted from the BuildrootGuide

This works. The key being the makefile checking to see if the initramfs_list file has been changed/modified/or missing.

In my case the file is in uClinux-dist-test/linux-2.6.x/usr/

So now the proper thing to do is:
rm -f linux-2.6.x/usr/initramfs_list
make (only if you want to recompile a user program in the user source tree)
make linux
make image

... copy the images/zImage elsewhere to use

Now it takes only 1 minute or less to compile my user application and test it on the NIOS II processor.

Comments (1)

guest said, 09/15/2006:

Where is this page being linked from ?

Attachments (0)

  File By Size Attached Ver.