No devices under /dev when using Atmel buildroot

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, all--

I've tried compiling buildroot using the latest version posted on the Atmel website (buildroot-avr32-v2.1.0). The compile is successful, and the root file system is created under /project_build_avr32_nofpu/atngw100/root. However, the /dev directory in my root file image does not contain any devices! The only two files that are in the directory are 'console' and 'null'.

I have uboot up and running, but I have created a JFFS2 image using


mkfs.jffs2 --output=/home/nkinar/Desktop/custom_image/myimage.img --root=/home/nkinar/Desktop/buildroot/buildroot-avr32-v2.1.0/project_build_avr32_nofpu/atngw100/root --big-endian --pagesize=4096 --eraseblock=65536

...and the image refuses to boot. Perhaps this is due to no mtd-device being listed under /dev? Does anyone know what is happening? Why isn't the /dev directory populated with files created using mknod?

I am compiling Atmel buildroot using:


make atngw100_defconfig
make source
make

Nicholas

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The not due to any missing mtd. The /dev/ folder is poulated with mdev commands that resides in one of the intit scripts, so only two ertries are correct. What happends if you halt u-boot and types ls? Do you see your files then? What commands are you using for programming the flash?

Life's to short for waiting on slow CPU's

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why don't you just let buildroot build the flash image for you too? It'll make sure everything in there is just nice. Generally missing dev files means that you broke symlinks by copying the filesystem around in an unsafe way.

-S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

nkinar wrote:
...
The only two files that are in the directory are 'console' and 'null'.
...
Nicholas

As you can see the dev and the two entries required are all there :)

Life's to short for waiting on slow CPU's

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you so much for your replies, S and eaanon01.

Buildroot is exhibiting very weird behavior on my Ubuntu Gutsy (32-bit) box. I tried running buildroot, and it worked without errors, but the flash image has a size of 0 bytes! This is the reason why I had to try and build the image myself.

In addition, I need to find a way to eventually change the kernel to turn on additional USARTS and disable ethernet for a custom board that does not have ethernet. I've found some postings on AVR freaks forum detailing how to modify the kernel to turn on USART ports.

Here is the output of uboot as it starts up on my board:


U-Boot 1.3.0.atmel.2 (Feb  7 2008 - 20:00:21)

U-Boot code: 00000000 -> 00010260  data: 00016128 -> 0004c798
SDRAM: 32 MB at address 0x10000000
Testing SDRAM...OK
malloc: Using memory from 0x11f73000 to 0x11fb3000
DMA: Using memory from 0x11f6f000 to 0x11f73000
Flash:  8 MB at address 0x00000000
DRAM Configuration:
Bank #0: 10000000 32 MB
In:    serial
Out:   serial
Err:   serial
Net:   macb0, macb1
Press SPACE to abort autoboot in 1 seconds
### JFFS2 loading '/boot/uImage' to 0x90300000
Scanning JFFS2 FS: ....... done.
### JFFS2 load complete: 1167013 bytes loaded to 0x90300000
## Booting image at 90300000 ...
   Image Name:   Linux-2.6.23
   Image Type:   AVR32 Linux Kernel Image (gzip compressed)
   Data Size:    1166949 Bytes =  1.1 MB
   Load Address: 10000000
   Entry Point:  90000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel at 90000000 (params at 11f73008)...


..and this is where the booting process hangs.

Stopping u-boot and running ls reveals that the file structure is present in the image:


U-Boot 1.3.0.atmel.2 (Feb  7 2008 - 20:00:21)

U-Boot code: 00000000 -> 00010260  data: 00016128 -> 0004c798
SDRAM: 32 MB at address 0x10000000
Testing SDRAM...OK
malloc: Using memory from 0x11f73000 to 0x11fb3000
DMA: Using memory from 0x11f6f000 to 0x11f73000
Flash:  8 MB at address 0x00000000
DRAM Configuration:
Bank #0: 10000000 32 MB
In:    serial
Out:   serial
Err:   serial
Net:   macb0, macb1
Press SPACE to abort autoboot in 1 seconds
Uboot> ls
Scanning JFFS2 FS: ....... done.
 drwxr-xr-x        0 Thu Feb 07 19:53:42 2008 bin
 drwxr-xr-x        0 Thu Feb 07 19:53:28 2008 boot
 drwxr-xr-x        0 Thu Feb 07 19:53:42 2008 config
 drwxr-xr-x        0 Thu Feb 07 19:53:42 2008 dev
 drwxr-xr-x        0 Thu Feb 07 19:53:42 2008 etc
 drwxrwxrwx        0 Thu Feb 07 19:53:42 2008 home
 drwxr-xr-x        0 Thu Feb 07 19:53:42 2008 lib
 lrwxrwxrwx       11 Thu Feb 07 19:52:40 2008 linuxrc -> bin/busybox
 drwx------        0 Thu Feb 07 19:53:42 2008 lost+found
 drwxr-xr-x        0 Thu Feb 07 19:53:42 2008 media
 drwxr-xr-x        0 Thu Feb 07 19:53:42 2008 proc
 drwxr-xr-x        0 Thu Feb 07 19:53:42 2008 sbin
 drwxr-xr-x        0 Thu Feb 07 19:53:42 2008 sys
 drwxrwxrwt        0 Thu Feb 07 19:53:42 2008 tmp
 drwxr-xr-x        0 Thu Feb 07 19:52:59 2008 usr
 drwxr-xr-x        0 Thu Feb 07 19:53:42 2008 var
 drwxr-xr-x        0 Thu Feb 07 19:57:26 2008 www
Uboot>

The commands that I am using for programming the flash is via the serial port. I am using the instructions posted on the wiki:

https://www.avrfreaks.net/wiki/in...

I'm going to try running buildroot with the sudo command. It seems that sudo fixes everything on Ubuntu. I'll make another posting here if I'm successful...something should indeed work eventually.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This file will contain 0 bytes:

rootfs.avr32_nofpu.jffs2

But these files will be about 7 MB each

rootfs.avr32_nofpu.jffs2-root,  rootfs.avr32_nofpu.jffs2-usr

Life's to short for waiting on slow CPU's

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

nkinar wrote:
Here is the output of uboot as it starts up on my board:


U-Boot 1.3.0.atmel.2 (Feb  7 2008 - 20:00:21)

U-Boot code: 00000000 -> 00010260  data: 00016128 -> 0004c798
SDRAM: 32 MB at address 0x10000000
Testing SDRAM...OK
malloc: Using memory from 0x11f73000 to 0x11fb3000
DMA: Using memory from 0x11f6f000 to 0x11f73000
Flash:  8 MB at address 0x00000000
DRAM Configuration:
Bank #0: 10000000 32 MB
In:    serial
Out:   serial
Err:   serial
Net:   macb0, macb1
Press SPACE to abort autoboot in 1 seconds
### JFFS2 loading '/boot/uImage' to 0x90300000
Scanning JFFS2 FS: ....... done.
### JFFS2 load complete: 1167013 bytes loaded to 0x90300000
## Booting image at 90300000 ...
   Image Name:   Linux-2.6.23
   Image Type:   AVR32 Linux Kernel Image (gzip compressed)
   Data Size:    1166949 Bytes =  1.1 MB
   Load Address: 10000000
   Entry Point:  90000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel at 90000000 (params at 11f73008)...


After a period of time does your ngw's red light start blinking? Usually seeing the terminal hang here just means your kernel is sending boot messages to the wrong place. Check your bootargs and make sure it has a bit saying "console=ttyS0 (not ttyUS0 or anything else).

nkinar wrote:
I'm going to try running buildroot with the sudo command. It seems that sudo fixes everything on Ubuntu. I'll make another posting here if I'm successful...something should indeed work eventually.
Now there's a statement to make any sysadmin run off and cry ;-). Running commands as root can genuinely dangerous under Linux (unlike, eg, Administrator on windows) so please at least use fakeroot :-)

-S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi S.-- and eaanon01:

You are absolutely right when you claim that the kernel is sending boot messages to the wrong place.

From this thread, I learned from eaanon01 that in the current version of Atmel buildroot, there are jffs2 files created for the /usr and /root partitions. I realized that the files were being created correctly by buildroot. I simply needed to rename the file extensions to .img to be able to upload via serial port. I also learned that the required files were listed in /dev.

However, despite my best efforts, nothing showed up when the kernel was booting.

The reason has to do with my modification of the kernel code. On the custom board that I designed, the debug serial port had been placed on USART0 instead of USART1.

Apparently in the current version of the kernel shipped with Atmel buildroot, there is a bug in the timer for USART0. I managed to find the patch contributed by S.-- and HS at Atmel. From this, I realized that solving the program was as simple as changing

DEV_CLK(usart, atmel_usart0, pba , 4);

to

DEV_CLK(usart, atmel_usart0, pba, 3);

in the file arch/avr32/mach-at32ap/at32ap70000.c

Like magic, the serial port started showing exactly what was happening when Linux boots.

I hope that this fix gets put into buildroot soon!

So thank you, Squidgit! And I have also learned a lot from eaanon01! This thread on AVR freaks helped me to narrow down the possibilities until I found exactly what I was doing wrong.

Nicholas :D

Last Edited: Sun. Feb 10, 2008 - 05:28 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

:D :D :D