Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 66 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: New Buildroot version uploaded in the www.at91.com project
PostPosted: Mon Apr 23, 2007 1:01 am 
Offline

Joined: Wed Feb 18, 2004 5:53 pm
Posts: 132
Location: Sweden
Latest version support

AT91-Bootstrap-2.3
Dataflashboot-1.05
U.Boot-1.2.0
Linux 2.4.20.4 with Maxim + Experimental patches.
gcc-4.1.2 using Binutils 2.17
Generates ext2 and jffs2 file systems for AT45DB642D dataflash.


This is not an official Atmel package, so don't bother
calling Atmel for support on this.

Download "make_boards.sh" and run it.

You need write access to
/tftpboot
/usr/local/arm
/usr/local/install/downloads
for this to succeeed.

You also need a cpio application, so Linux is recommended.
It has been tested on OpenSuse 10.2 for
* AT91RM9200DF (AT91RM9200EK running from dataflashcard)
* AT91SAM9261EK.
Should compile for
* AT91SAM9660DFC (EK running from dataflashcard)
* AT91SAM9263EK
Nand flash support has not been tested.

_________________
Best Regards
Ulf Samuelsson


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 23, 2007 1:03 am 
Offline

Joined: Wed Feb 18, 2004 5:53 pm
Posts: 132
Location: Sweden
#!/bin/bash
# make_boards.sh script to build at91 linux.

TOPDIR=`pwd`
BUILDROOT=buildroot-atmel
BUILDROOT_VER=2007-04-22
BUILDROOT_SOURCE=${BUILDROOT}-${BUILDROOT_VER}.cpio.bz2
BUILDROOT_SITE=ftp://at91dist:distrib@81.80.104.162/AT91_Third_Party_Design_Flow/Linux_Host/Source
DL_DIR=${TOPDIR}/Source
UNZIP=bzcat

function prepare_directories()
{
mkdir -p /tftpboot
mkdir -p /usr/local/arm
mkdir -p /usr/local/install/downloads
}

function get_buildroot()
{
if ! [ -d ${BUILDROOT} ] ; then
mkdir -p ${DL_DIR}
wget -P ${DL_DIR} ${BUILDROOT_SITE}/${BUILDROOT_SOURCE}
${UNZIP} ${DL_DIR}/${BUILDROOT_SOURCE} | cpio -idv
fi
}

function make_board()
{
cd ${BUILDROOT}
echo "building board $1"
make B=$1 board
make $2
make saveconfig
cd ${TOPDIR}
}

function make_all_boards()
{
make_board at91rm9200df $1
make_board at91sam9260dfc $1
make_board at91sam9261ek $1
make_board at91sam9263ek $1
}

prepare_directories
get_buildroot
make_all_boards source
make_all_boards

_________________
Best Regards
Ulf Samuelsson


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 24, 2007 12:57 am 
Offline

Joined: Wed Oct 05, 2005 9:33 pm
Posts: 29
Location: Ann Arbor, MI
Hurray!

Unfortunately mpfr.org is down, and not only does the script want mpfr-2.2.1, but also the patch which I can't seem to find elsewhere.

If anyone has it and can send it, let me know - I'll post here once I figure a way around it.

-Adam


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 24, 2007 1:19 am 
Offline

Joined: Wed Oct 05, 2005 9:33 pm
Posts: 29
Location: Ann Arbor, MI
At the moment I'm going to hope that the patch isn't needed. By remarking out the MPFR_PATCH=patches line in buildroot-atmel/packages/mpfr/mpfr.mk the buildroot script is going on its merry way.

I don't understand why MPFR is being called, though. It's not selected in the configs, and it doesn't appear that fortran (which depends on mpfr, it seems) is selected either.

At any rate, I'll post here later with more notes as the night goes on.

-Adam


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 24, 2007 4:23 am 
Offline

Joined: Wed Oct 05, 2005 9:33 pm
Posts: 29
Location: Ann Arbor, MI
Well, looks like I'm going to have to go back to the old build root for a little while, this new one is giving me problems - the kernel doesn't see the ramdisk.

I changed the buildroot config to gzip the ext3 file system, then use mkimage to wrap that into a ramdisk image. As you can see below, UBoot is fine with both the kernel and the ramdisk. This is for a 9261-EK board. As noted above I didn't have the patch for mpfr, but I wouldn't expect that to be the issue - however when I get it I'll try again. I'm running the buildroot script on Ubuntu 6.10, which is running on top of virtual pc on windows vista. I could try it on Suse, but I have a hard time believing that would be the difference.

Looks like the line "checking if image is initramfs...it isn't (bad gzip magic numbers); looks like an initrd" is the clue. I believe this should be treated as an initramfs. Perhaps the kernel's looking in the wrong area of memory, and I need to change the command line? I don't know...

If anyone has any suggestions, look over the following boot process:

Code:
RomBOOT
>

U-Boot 1.1.5 (Nov 14 2006 - 18:04:05)

DRAM:  64 MB
NAND:  NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (<NULL> NAND 256MiB 3,3
V 8-bit)
256 MiB
DataFlash:AT45DB642
Nb pages:   8192
Page Size:   1056
Size= 8650752 bytes
Logical address: 0xC0000000
Area 0:   C0000000 to C0003FFF (RO)
Area 1:   C0004000 to C0007FFF
Area 2:   C0008000 to C0037FFF (RO)
Area 3:   C0038000 to C083FFFF
In:    serial
Out:   serial
Err:   serial
dm9000 i/o: 0x30000000, id: 0x90000a46
MAC: 02:03:04:85:06:07
operating at 100M full duplex mode
Hit any key to stop autoboot:  3  2  1  0
dm9000 i/o: 0x30000000, id: 0x90000a46
MAC: 02:03:04:85:06:07
operating at 100M full duplex mode
TFTP from server 192.168.0.1; our IP address is 192.168.0.2
Filename 'kernel.img'.
Load address: 0x21500000
Loading:
<snip>
done
Bytes transferred = 1318916 (142004 hex)
dm9000 i/o: 0x30000000, id: 0x90000a46
MAC: 02:03:04:85:06:07
operating at 100M full duplex mode
TFTP from server 192.168.0.1; our IP address is 192.168.0.2
Filename 'ramdisk.img'.
Load address: 0x21700000
Loading:
<snip>
done
Bytes transferred = 2821936 (2b0f30 hex)
## Booting image at 21500000 ...
   Image Name:   Linux-2.6.20.4
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1318852 Bytes =  1.3 MB
   Load Address: 20008000
   Entry Point:  20008000
   Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 21700000 ...
   Image Name:   test ramdisk image
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    2821872 Bytes =  2.7 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK

Starting kernel ...

Uncompressing Linux.............................................................
......................... done, booting the kernel.
Linux version 2.6.20.4 (stienman@vizzini-u610) (gcc version 4.1.2) #1 Mon Apr 23
19:01:39 EDT 2007
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
Machine: Atmel AT91SAM9261-EK
Ignoring unrecognised tag 0x54410008
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 198 MHz, master 99 MHz, main 18.432 MHz
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
Built 1 zonelists.  Total pages: 16256
Kernel command line: mem=64M console=ttyS0,115200 initrd=0x20410000,3145728 root
=/dev/ram0 rw
AT91: 96 gpio irqs in 3 banks
PID hash table entries: 256 (order: 8, 1024 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 59024KB available (2404K code, 256K data, 108K init)
Security Framework v1.0.0 initialized
Capability LSM initialized
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
Generic PHY: Registered new driver
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 2048 bind 1024)
TCP reno registered
checking if image is initramfs...it isn't (bad gzip magic numbers); looks like a
n initrd
Freeing initrd memory: 3072K
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler anticipatory registered (default)
atmel_lcdfb atmel_lcdfb.0: 150KiB frame buffer at 20480000 (mapped at ffc00000)
Console: switching to colour frame buffer device 30x20
atmel_lcdfb atmel_lcdfb.0: fb0: Atmel LCDC at 0x00600000 (mapped at c485c000), i
rq 21
atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
RAMDISK driver initialized: 16 RAM disks of 15360K size 1024 blocksize
Davicom DM9161E: Registered new driver
Davicom DM9131: Registered new driver
PPP generic driver version 2.4.2
dm9000 Ethernet Driver
eth0: dm9000 at c485e000,c4860044 IRQ 107 MAC: 02:03:04:85:06:07
NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bi
t)
NAND bus width 16 instead 8 bit
No NAND device found!!!
atmel_spi atmel_spi.0: Atmel SPI Controller at 0xfffc8000 (irq 12)
mtd_dataflash spi0.0: AT45DB642x (8448 KBytes)
usbmon: debugfs is not available
at91_ohci at91_ohci: AT91 OHCI
at91_ohci at91_ohci: new USB bus registered, assigned bus number 1
at91_ohci at91_ohci: irq 20, io mem 0x00500000
usb usb1: Product: AT91 OHCI
usb usb1: Manufacturer: Linux 2.6.20.4 ohci_hcd
usb usb1: SerialNumber: at91
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usb 1-1: new low speed USB device using at91_ohci and address 2
usb 1-1: Product: USB Keyboard
usb 1-1: Manufacturer: Chicony
usb 1-1: configuration #1 chosen from 1 choice
usb 1-2: new full speed USB device using at91_ohci and address 3
usb 1-2: Product: Store 'n' Go
usb 1-2: Manufacturer: Verbatim
usb 1-2: SerialNumber: 0B71986132D0788E
usb 1-2: configuration #1 chosen from 1 choice
scsi0 : SCSI emulation for USB Mass Storage devices
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
input: Chicony  USB Keyboard as /class/input/input0
input: USB HID v1.10 Keyboard [Chicony  USB Keyboard] on usb-at91-1
input: Chicony  USB Keyboard as /class/input/input1
input: USB HID v1.10 Device [Chicony  USB Keyboard] on usb-at91-1
usbcore: registered new interface driver usbhid
drivers/usb/input/hid-core.c: v2.6:USB HID core driver
usbcore: registered new interface driver usbserial
drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
drivers/usb/serial/usb-serial.c: USB Serial Driver core
udc: at91_udc version 3 May 2006
mice: PS/2 mouse device common for all mice
i2c /dev entries driver
at91_i2c at91_i2c: AT91 i2c bus driver.
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
RAMDISK: Couldn't find valid RAM disk image starting at 0.
No filesystem could mount root, tried:  ext2 cramfs msdos vfat
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 24, 2007 4:32 am 
Offline

Joined: Wed Oct 05, 2005 9:33 pm
Posts: 29
Location: Ann Arbor, MI
I meant to say that I'm using an EXT2 filesystem, not EXT3.

-Adam


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 24, 2007 7:21 am 
Offline

Joined: Wed Feb 18, 2004 5:53 pm
Posts: 132
Location: Sweden
You may want to ponder a bit on the equation:

21500000 + 2B0F30 > 21700000

_________________
Best Regards
Ulf Samuelsson


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 24, 2007 11:25 pm 
Offline

Joined: Wed Oct 05, 2005 9:33 pm
Posts: 29
Location: Ann Arbor, MI
I spent a lot of time pondering that the last time I went through this, and as far as I can tell the equations still work out:

Filename 'kernel.img'.
Load address: 0x21500000
Bytes transferred = 1318916 (142004 hex)

Filename 'ramdisk.img'.
Load address: 0x21700000
Bytes transferred = 2821936 (2b0f30 hex)

Kernel: 0x2150 0000 to 0x2164 2004
Ramdisk: 0x2170 0000 to 0x219B 0F30

So as far as I understand there's no overlap. The kernel and ramdisk are about the same size as those from the previous build environment.

-Adam


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 25, 2007 12:17 am 
Offline

Joined: Wed Feb 18, 2004 5:53 pm
Posts: 132
Location: Sweden
I updated my buildroot-2007-04-22.cpåio.bz2
to wget mpfr stuff from aldot's dl page
so it should hopefully build now.
There are dependencies on mpfr in gcc.

I got this buildroot to load on an AT91SAM9261EK.

_________________
Best Regards
Ulf Samuelsson


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 25, 2007 12:26 am 
Offline

Joined: Wed Oct 05, 2005 9:33 pm
Posts: 29
Location: Ann Arbor, MI
mpfr.org is back up, so I went ahead and allowed it to download the patch. It didn't seem to change anything - same issue.

I have to work on other aspects of the project, but I was able to get the old kernel to boot the new root file system. The new kernel will not boot its rootfs, or the older rootfs.

I'll probably re-visit this buildroot later

Gotta love project priorities.

Out of curiosity, how exactly are you getting your kernel and rootfs onto your board? Can you give your uboot parameters?

-Adam


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 25, 2007 12:55 am 
Offline

Joined: Wed Feb 18, 2004 5:53 pm
Posts: 132
Location: Sweden
IIRC:

program at91boottrap -2.3 to 0x000 using SAMBA
program uboot-1.2.0-atmel to 0x8400 using samba

start
When you get the uboot prompt do:

defenv
run config
run get
bootm 21000000

defenv will setup a lot of environment variables
run config will download script generated by buildroot
you need to define some network specific stuff in the Target->Atmel
screens (serverip, ipaddr etc)
"get" will download your root fs and kernel from /tftpboot.

_________________
Best Regards
Ulf Samuelsson


Top
 Profile  
 
 Post subject: Build Customization
PostPosted: Thu Apr 26, 2007 6:10 pm 
Offline

Joined: Thu Apr 26, 2007 5:55 pm
Posts: 1
Location: Bulgaria
Hi Ulf,

Buildroot scripts passed just fine on an Ubuntu PC. I got everything built.

Could you please give some very brief information how some customizations have to be done?
For example changing kernel config, adding new drivers/modules to build (static and loadable), adding/changing root file system files, adding/removing packages and etc.

Thanks a lot in advance


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 26, 2007 7:38 pm 
Offline

Joined: Wed Feb 18, 2004 5:53 pm
Posts: 132
Location: Sweden
Most new AT91 related stuff is in
* target/linux
* target/device/Atmel/<board>
* target/device/Atmel/root - target_skeleton
* target/device/Atmel/u-boot
* target/device/Atmel/dataflashboot
* target/device/Atmel/at91bootstrap

The customization features partly work by copying
a file from the <board> directory to the build directory.
You can select linux kernel in make menuconfig, but I really
only tried out 2.6.20.4.
Some u-boot configs are copied into the u-boot include/custom.h
I make the u-boot config.h include this as well.


Stuff are built in target_build_dir/<hostname>
where hostname is the first parameter in make menuconfig.
This means that you can have several configurations for
each board.
If you want to have one root file system with and another without
samba, you can have two different config files and the
buildroot will create two different subdirectories under
target_build_dir.

All results are put in binaries/<hostname>

The u-boot has some nifty new commands like "defenv"
which will define the complete environment needed for MY board.
You need to fix your own network parameters in make menuconfig
Note that U-Boot will not like if you change the ethernet address
so you should leave ethaddr empty right now, if you care about this.
Eventually, I will probably do a patch which says that it is legal
to change the ethaddr if it is set to CONFIG_ETHADDR.

I have also added some new packages taken from the
AVR32 BSP 2.0, and added the patches.

The latest AVR32 compiler is not inside this yet though
and no testing has been done on the packages.


Tried enable all packages and then make source this morning
and the alsa stuff does not work yet.
Also a few other packages failed, but I think this is due to a server
beeing temporary down.

Some packages has new versions compared to vanilla U-Boot.

BTW: The cpio file on www.at91.com is likely to be slightly out of phase
from the one on the ftp server since it is so easy to ftp up.
Might add a Makefile command which cleans out my buildroot and moves everything needed to the ftp server...

_________________
Best Regards
Ulf Samuelsson


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 01, 2007 8:34 pm 
Offline

Joined: Tue May 01, 2007 8:18 pm
Posts: 4
Hi Ulf,

I am having issues booting the kernel produced by buildroot on my AT91SAM9263-EK board. I am using the default config file for the board found in buildroot-atmel/configs.
Quote:
U-Boot> bootm 21000000
## Booting image at 21000000 ...
Image Name: Linux-2.6.20.4
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1320364 Bytes = 1.3 MB
Load Address: 20008000
Entry Point: 20008000
Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux.............................................................
......................... done, booting the kernel.

Error: unrecognized/unsupported machine ID (r1 = 0x00000000).

Available machine support:

ID (hex) NAME
000004b2 Atmel AT91SAM9263-EK

Please check your kernel config and/or bootloader.

I have verified that the system type in linux26-menuconfig is set for the AT91SAM9263-EK. Any idea as to what I am missing?

Regards,
Aaron


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 02, 2007 12:08 am 
Offline

Joined: Wed Feb 18, 2004 5:53 pm
Posts: 132
Location: Sweden
Try the following commands in u-boot:

defenv
# fix ip addresses (serverip/gatewayip/ipaddr)
run config
# fix ip addresses (serverip/gatewayip/ipaddr)
run flash-kernel
run flash-ramdisk
setenv machid 1202
saveenv
run bootcmd

It is the
"setenv machid 1202"
that does the trick.

Sorry about that, but I did not get to test
on the SAM9263EK

_________________
Best Regards
Ulf Samuelsson


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 66 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron