Using the buildroot scripts

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

sst
Posts: 26
Joined: Fri Mar 16, 2007 3:41 pm

Using the buildroot scripts

Fri Mar 16, 2007 11:14 pm

Hi,
I was trying to run the buildroot scripts to make a custom install on the AT9SAM9260-EK board to eventually make it to my own board.

I havn't yet been able to get buildroot to run correctly so I'm not sure exactly what output it will generate. So my question is will I basically get ALL the files required to get my board to boot from scratch? Will I be able to use this output on my custom board too (ofcourse hardware will be similar)

I downloaded buildroot-20070116-RC2.tar.bz2 from the FTP site, tried doing a make menuconfig and selected the at91sam9260ek-2007-01-06.config file. and ran make.
I get errors while its trying to compile lxdialog/dialog.h: saying it cannot find curses.h. Any idea?
I'm using FC6 with the development tools yum group.

Thanks.
csharman
Posts: 18
Joined: Wed Jan 10, 2007 8:13 am

Mon Mar 19, 2007 3:25 am

You need the ncurses development libraries package installed so buildroot can build the menu configuration tool i think.

Sorry not sure what package or how to install on FC.
sst
Posts: 26
Joined: Fri Mar 16, 2007 3:41 pm

Tue Mar 20, 2007 8:11 pm

ok so I moved slightly ahead with the buildroot scripts :

now I get this error :
1.1.5 -C /root/buildroot-20070116-RC2/target_build_arm_small/at91sam9260ek/u-boot-1.1.5/tools
make[1]: Entering directory `/root/buildroot-20070116-RC2/target_build_arm_small/at91sam9260ek/u-boot-1.1.5/tools'
Makefile:237: /rules.mk: No such file or directory
make[1]: *** No rule to make target `/rules.mk'. Stop.
make[1]: Leaving directory `/root/buildroot-20070116-RC2/target_build_arm_small/at91sam9260ek/u-boot-1.1.5/tools'
make: *** [/root/buildroot-20070116-RC2/target_build_arm_small/at91sam9260ek/u-boot-1.1.5/tools/mkimage] Error 2

uboot-1.1.5 has been downloaded into the /usr/local/install/downloads directory.
Any ideas?
pkavan
Location: Omaha, Nebraska, USA
Posts: 38
Joined: Wed Mar 21, 2007 4:40 pm

Wed Mar 21, 2007 4:44 pm

sst wrote:ok so I moved slightly ahead with the buildroot scripts :

now I get this error :
1.1.5 -C /root/buildroot-20070116-RC2/target_build_arm_small/at91sam9260ek/u-boot-1.1.5/tools
make[1]: Entering directory `/root/buildroot-20070116-RC2/target_build_arm_small/at91sam9260ek/u-boot-1.1.5/tools'
Makefile:237: /rules.mk: No such file or directory
make[1]: *** No rule to make target `/rules.mk'. Stop.
make[1]: Leaving directory `/root/buildroot-20070116-RC2/target_build_arm_small/at91sam9260ek/u-boot-1.1.5/tools'
make: *** [/root/buildroot-20070116-RC2/target_build_arm_small/at91sam9260ek/u-boot-1.1.5/tools/mkimage] Error 2

uboot-1.1.5 has been downloaded into the /usr/local/install/downloads directory.
Any ideas?
do you have mkimage on your system....also list the entire make command you are using.

I have a 9260-ek running linux 2.6.20.3 with a decent rfs, so it can be done. Sometimes it just takes a little time getting your host set up correctly.

I will try to write up a procedure as soon as I have time that details exactly the procedure I used to get buildroot configured and working for the 9260
sst
Posts: 26
Joined: Fri Mar 16, 2007 3:41 pm

Wed Mar 21, 2007 9:56 pm

WOW!!!
you actually have the whole toolchain/kernel etc running. 2.6.20 so I'm assuming even ethernet works well??

I was begining to give up hope (since I'm also trying to design the hardware in about week or so!!)
any chance you can put your host environement on a vmware appliance and host it somewhere?

ANY help would be GREATLY appreciated!
Carstijn
Location: The Netherlands
Posts: 2
Joined: Thu Mar 22, 2007 1:57 pm

Thu Mar 22, 2007 2:00 pm

I got the same problem over here....

Can sombody give us a hand?
pkavan
Location: Omaha, Nebraska, USA
Posts: 38
Joined: Wed Mar 21, 2007 4:40 pm

Thu Mar 22, 2007 6:11 pm

sst wrote:WOW!!!
you actually have the whole toolchain/kernel etc running. 2.6.20 so I'm assuming even ethernet works well??

I was begining to give up hope (since I'm also trying to design the hardware in about week or so!!)
any chance you can put your host environement on a vmware appliance and host it somewhere?

ANY help would be GREATLY appreciated!
Unfortunately I cannot host it anywhere. However, I will do what I can to help you get to the toolchain working. There are a few issues you will have along the way.

Yes, I have ethernet and as of this morning wifi working. Ethernet is tricky because there are certain drivers you need to include into the kernel .config and you will need to change a line in the source code for the 9260.

I am working on writing up the procedure to get buildroot working with the 9260-ek and should have it finished today sometime. I will post something here tonight with the procedure.

For starters I assume you have u-boot on the board correctly. Have you used a linux demo from either Atmel or LinuxLink? Although you will want to make your own kernel, starting with those can at least confirm you can get linux on it. Again, the most important thing is u-boot on the target and mkimage on your host.

Paul
sst
Posts: 26
Joined: Fri Mar 16, 2007 3:41 pm

Thu Mar 22, 2007 8:35 pm

Thank you muchly!!

Yep I have the linuxlink demo (from the atmel website) running on my board. it boots fine via uboot.
I don't have mkimage though, not quite sure which package to get.
my host is a FC6 machine, but I'm not tied to it, if you can let me know I'll have the same distro installed as you.

Any idea what happens beyond that.. i.e. whats the best way to install the bootstrap loader and uboot to a brand new board? Can we use those two programs from the atmel provided linuxlink files, and merely substitute the kernel and root fs image with these ones we compile?
stienman
Location: Ann Arbor, MI
Posts: 29
Joined: Wed Oct 05, 2005 9:33 pm

Sun Mar 25, 2007 1:29 am

There seem to be a number of issues with the Buildroot distributed:

mkimage needs to be taken from the FTP server where you get the buildroot from and place in /usr/local/bin/ - chmod it.

If you don't want to run as root you need to make the following directories and give your user permission to them:
/usr/local/arm
/user/local/install
/tftpboot

It doesn't appear that these locations are easily modifiable in make menuconfig

The following files don't download correctly, get them and place them into /usr/local/install/downloads/ :
dosfstools-2.11.src.tar.gz, fakeroot_1.5.8.tar.gz, u-boot-1.1.5-atmel.tar.bz2, and at91bootstrap-1.2.tar.gz

Copy the configuration file you want to .config, then do make menuconfig.

Under Board Support, then Atmel board support disable U-Boot, dataflash, and bootstrap. This seemed to "fix" the errors mentioned above (rules.mk, config.mk missing). Of course, if you need to build your own u-boot, bootstrap or dataflash stuff then you'll have to look for another solution.

Save and exit menuconfig, then do make. Any other errors should be easily resolved (missing packages and such).

The results ended up in /tftpboot as well as buildroot-20070116-RC2/binaries/at91sam9261ek:
at91sam9261ek-linux-2.6.19-2007-03-24.gz
u-boot-at91sam9261ek-2007-03-24.bin
u-boot-at91sam9261ek-2007-03-24.gz
rootfs.arm-2007-03-24.jffs2

The u-boot probably finished before I ran into the error, so it may be that one need only disable the bootstrap and dataflash options.

I haven't tried this kernel out yet, so it may be that there are other problems, but at least the buildroot finishes.

If it does work, I'm still working my way through "Building Embedded Linux Systems" and "Embedded Linux Primer/Handbook" and will probably end up doing it by hand. I need to understand the process anyway, even though an all-in-one solution is nice.

Please let me know if any of you have success in this. If I get this one working on the board I'll post again with my method (mostly to force me to make notes that I can follow later :-)

As a point of order, I'm building under Ubuntu 6.10 running on a Virtual PC running on Vista 64 on a Core Duo 2 6600 (2.4GHz, 2GB 5300 ram, 1066MHz fsb). The ubuntu virtual PC has 1GB memory allocated, and two virtual HD, running on a 10K raptor drive. (I'd run Linux directly on the hardware except that no stable standard distribution will run correctly on the intel p965 chipset or the JMB630 ATA controller. Bleah!)

I say this not to gloat, but to indicate that it took 4 hours with various stops to get the missing packages and resolve other errors. If you have a slower machine, it will take all day the first time. Bring a book.

What I, and I suspect others, need more than anything is a simple step-by-step procedure for building a custom linux kernel, root file system, and a good document describing how to get it on the board describing at least three different methods: TFTP, loaded from NAND, loaded from dataflash. As it is, I'm just piecing things together from so many sources it's annoying and difficult to deal with.

Paul - I'd still appreciate your input on how to get this working better.

-Adam
stienman
Location: Ann Arbor, MI
Posts: 29
Joined: Wed Oct 05, 2005 9:33 pm

Sun Mar 25, 2007 5:52 am

After much trial and tribulation I finally got the images produced by buildroot running on my AT91SAM9261EK.

So you should have a AT91SAM9261EK or similar with a recent UBoot installed, as well as the files I mentioned earlier (a kernel, a file system, etc)

I'm going to be using a ramdisk, rather than flash, so go back to the buildroot directory and do the following:
make menuconfig
Under Target Options unselect jffs2 root file system, and select ext2 file system. (JFFS2 requires a block device, such as flash memory. Since I'm going to run it from RAM I'm using EXT2.)
Select Compression method and then gzip.

Exit and save the configuration.

Run make, and you should now get the file rootfs.arm.ext2.gz . It'll be located in your buildroot directory, as well as the location mentioned in my previous email.

Run the following command (see http://lldn.timesys.com/docs/uboot_initrd for an explanation):
mkimage -A ARM -T ramdisk -C gzip -n 'Test Ramdisk Image' -d rootfs.arm.ext2.gz uRamdisk

This makes a UBoot compatible root filesystem out of the ext2 compressed image.

I'm going the TFTP route at the moment:

Load the dataflash boot and UBoot on your board. Make sure they are working (follow the instructions given in a recent linux dist for the board - I used the one from january with the MPlayer doing the V for Vendetta trailer).

Configure UBoot networking as follows so it'll connect to your TFTP server. In my case that meant setting the following:
Set Ethernet address :
- setenv ethaddr 12:34:56:78:99:aa
Set IP address :
- setenv ipaddr 192.168.0.2
Set TFTP server IP address :
- setenv serverip 192.168.0.1
Save UBoot environment variables in dataflash if you don't want to do these steps again
- saveenv

Set up your TFTP server. This varies - in my case I'm using windows for TFTP:
Create c:\tftp
Copy your image files into c:\tftp
Copy TFTPSRV.EXE into c:\tftp
Put TFTPSRV.EXE into your firewall exception list
Run TFTPSRV.EXE

Connect a serial cable to your board, and open a terminal program (115200-n-8-1).

Power the board up. Press a key to prevent it from auto booting into whatever it's configured for.

I usually rename my image files to kernel.img and ramdisk.img so I don't have to type in a long file name at bootup.

Type the following into the terminal program:
tftp 21500000 kernel.img
tftp 21700000 ramdisk.img
bootm 21500000 21700000

This loads the kernel and ramdisk into the SDRAM. The bootm then decompresses and executes the linux kernel, passing it the information for the ramdisk.

The terminal is now connected to the console of linux running on your board. Login as root (no password) and you're all set.

-Adam
pkavan
Location: Omaha, Nebraska, USA
Posts: 38
Joined: Wed Mar 21, 2007 4:40 pm

Sorry for the delay

Mon Mar 26, 2007 6:02 pm

Gentleman:

Sorry for the delay in posting. I have been away from the office on personal matters. I wll review this and get something on here today. Buildroot is the easiest method I have found thus far to get linux and a rfs up on the 9260. However, it can be tricky and I would recommend not using the most current build as it was giving me trouble last week when I tried to replicate my work. I am using revision 18126 without problems.

to get started:

Code: Select all

$‭ ‬svn co -r 18126 svn://uclibc.org/trunk/buildroot
Then configure:

Code: Select all

$‭ ‬cd buildroot
$‭ ‬make menuconfig
This will bring up a configuration utility.‭ ‬The following configuration options should be made.

Code: Select all

 Target Architecture‭ (‬arm‭)  ‬---‭>
  Target Architecture Variant‭ (‬arm926t‭)  ‬---‭>
  Target ABI‭ (‬OABI‭)  ‬---‭>

  Toolchain Options‭ ‬---‭>
	Kernel Headers‭ (‬Linux‭ ‬2.6.20.3‭ ‬kernel headers‭)
	uClibc C library Version‭ (‬daily snapshot‭)
	(20070102‭) ‬Date‭ (‬yyyymmdd‭) ‬of snapshot or‭ '‬snapshot‭' ‬for latest
	Binutils Version‭ (‬binutils‭ ‬2.17‭)
	GCC compiler Version‭ (‬gcc‭ ‬4.1.1‭)
	[*] Build gdb debugger for the Target
‭	[*] ‬Build gdb server for the Target
‭	[*] ‬Build gdb for the Host
‭		‬GDB debugger Version‭ (‬gdb‭ ‬6.5‭)

  Package Selection for the target‭  ‬---‭>
	[*] BusyBox
‭		‬BusyBox Version‭ (‬BusyBox‭ ‬1.2.2.1‭)
	[*] Install symlinks for BusyBox applets
‭	(‬package/busybox/busybox.config‭) ‬BusyBox configuration file to use‭?

	[*] portmap
‭	[*] ‬pppd
‭	[*] ‬udev
‭	[*] ‬udhcpc
‭	[*] ‬wireless tools

‭   ‬Target Options‭  ‬---‭>
	(/tftpboot‭) ‬also copy the image to...
make sure you have /tftpboot set with +rwx. Then under ~/buildroot:

Code: Select all

$ make ARCH=arm
Have you gotten this far? Is so, sorry for posting old stuff. If not, get here and I will post more soon.

--Paul
pkavan
Location: Omaha, Nebraska, USA
Posts: 38
Joined: Wed Mar 21, 2007 4:40 pm

Mon Mar 26, 2007 9:31 pm

btw: I have wireless tools selected in my buildroot configuration. If you are not going to use wifi, this would be unnecessary.
ulf
Location: Sweden
Posts: 134
Joined: Wed Feb 18, 2004 5:53 pm

Re: Using the buildroot scripts

Mon Mar 26, 2007 9:42 pm

sst wrote:Hi,
I was trying to run the buildroot scripts to make a custom install on the AT9SAM9260-EK board to eventually make it to my own board.

I havn't yet been able to get buildroot to run correctly so I'm not sure exactly what output it will generate. So my question is will I basically get ALL the files required to get my board to boot from scratch? Will I be able to use this output on my custom board too (ofcourse hardware will be similar)

I downloaded buildroot-20070116-RC2.tar.bz2 from the FTP site, tried doing a make menuconfig and selected the at91sam9260ek-2007-01-06.config file. and ran make.
I get errors while its trying to compile lxdialog/dialog.h: saying it cannot find curses.h. Any idea?
I'm using FC6 with the development tools yum group.

Thanks.
As the author of the buildroot scripts, I can only say
that I am running OpenSuSE 10.1 and upgrades that
as often as neccessary. Have not even remote plans to test on FC#
after spending endless hours trying to get that to work.

Someone killed the ftp repository and it has really not recovered yet,
but I hope to upgrade to a later version of buildroot soon,
with 2.4.20.4 support, u-boot-1.2.0 , more apps, AVR32 support
and a lot of other goodies.

As someone mentioned, you have to have some directories installed
like /tftpboot, /usr/local/arm etc.
if you know where it is done, you can fix your own buildroot.

If you find any problems, then you can always send a patch to
ulf@a-t-m-e-l.com (remove the hyphens)
I am doing this on my free time, so don't expect any fast reponse.
I usually find time to update this a couple of times per year.
Best Regards
Ulf Samuelsson
sst
Posts: 26
Joined: Fri Mar 16, 2007 3:41 pm

Mon Mar 26, 2007 10:02 pm

pkavan :
tried it with your instructions, a couple of things though :
ucLibc - 20070102 doesn't seem to be available (I compiled with snapshot)
GCC compiler Version (gcc 4.1.1) - 4.1.1 isn't listed, i'm trying with 4.1.2.

ulf:
your work is truly commendable, however it really sucks that atmel doesn't sponser a fully open/transparent and clean build environment that doesn't cost a whole bunch of $$$ via linuxlink!
sst
Posts: 26
Joined: Fri Mar 16, 2007 3:41 pm

Mon Mar 26, 2007 11:20 pm

pkavan :

anychance you could post your .config file? I'm running into a couple of problems (e.g. right now it tries to download fakeroot-1.6.4.tar.gz but there's no such version on the debian site etc)
there have been a couple of such problems along the way, so if your .config works it should work here too.

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 2 guests