SuSE 10 build environment for NGW100 kernels

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

I'm pulling this out of the former thread on NGW100/uboot because there were too many discussions going and I didn't want to clutter it up with questions and notes specific to SuSE 10.

This post includes some results from initial attempts to build the NGW image SuSE 10. Some solutions, some questions re: issues I hit along the way.

So, the results of my first trial build on my SuSE 10.1 using the build-linux-environment script was:

spanky:/home/ko/Documents/AVR32/scripts # ./build-linux-environment.sh ../software ../builds/ngw/ ../mybuilds
U-boot - unpacking                                  OK
U-Boot - patching                                   OK
U-boot - config and make                            OK
flash upgrade utility (u-boot upgrade)              OK
Creating new root for Basic                         OK
uClibc - unpacking                                  OK
uClibc - patching                                   OK
uClibc - make oldconfig and make install            OK
Linux kernel - unpacking                            OK
Linux kernel - patching                             OK
Linux kernel - make oldconfig and make              OK
Busybox - unpacking                                 OK
Busybox - patching                                  OK
Busybox - make and make install                     OK
strace - unpacking                                  OK
strace - patching                                   OK
strace - configure, make, install                   OK
Zlib - unpacking                                    OK
Zlib - configure, make, copy library to root        OK
ncurses - unpack                                    OK
ncurses - patching                                  OK
ncurses - configure, make, make install             OK
ftpd - unpacking                                    OK
ftpd - patching                                     OK
ftpd - make and copy to target                      OK
joe - unpacking                                     OK
joe - patching                                      OK
joe - configure, make, make install                 OK
gdbserver - autoconf and configure                  OK
gdbserver - make and make install                   OK
dropbear - unpacking                                OK
dropbear - patching                                 OK
dropbear - configure, make and make install         OK
ntp - unpacking                                     tar: A lone zero block at 17300
OK
ntp - patching                                      OK
ntp - configure, make and make install              OK
net-tools - unpacking                               OK
net-tools - patching                                OK
net-tools - configure, make and make install        OK
dnsmasq - unpacking                                 OK
dnsmasq - patching                                  OK
dnsmasq - configure, make and make install          OK
Creating /etc/release for Basic                     OK
Creating runtime image for Basic                    FAILED
e2fsimage program not found, skipping image creation.

I looked for e2fsimage via yast2, but it's not supplied.

e2fsimage isn't available directly from SuSE DVD/yast2.

Need to install e2fsimage 0.2.2 but it has dependency on e2fsprogs headers.

Solution is to install e2fsprog (e2fsprogs-devel to be precise) from yast2 or consult this link: http://support.novell.com/techce...

rpm -Fvh e2fsprogs.rpm

The home page for e2fsprogs is at:
http://e2fsprogs.sourceforge.net...

After e2fsprogs is configured/installed with devel headers,

Then download e2fsimage-0.2.2 from http://sourceforge.net/projects/...

spanky:/tmp/e2fsimage-0.2.2 # ./configure
/usr /usr/local
Found: ext2fs/ext2fs.h at /usr/include
Found: e2p/e2p.h at /usr/include
Found: libext2fs.so at /usr/lib
Found: libcom_err.so at /usr/lib

The version of the e2fs library is: 1.38, 30-Jun-2005

LDFLAGS   : -lext2fs -lcom_err
PREFIX    :/usr/local
CPPFLAGS  :
CFLAGS    :-Wall
VERSION   :0.2.2

GNU Make 3.80
GNU Make 3.80

A usable make executable was found in /usr/bin/make

Got much further into kernel build but then bombed on:

DirectFB - configure, make and make install OK
pong - make and make install FAILED
make failed, see make.out

make.out was complaining it couldn't find the DirectFB headers (package which got built right before pong.) In any case, when I looked at the ./build-linux-environment.sh script, this "pong" was coming from the STK1000 standard linux image build...it had already finished the Basic build used by both the STK1000 and the NGW.

So, my question is: is there any reason, if I'm working exclusively with the NGW100, that I need to be building anything for the STK1000 standard image? For the moment, I will comment out the build components for the STK1000.

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

Comment out building pong, you do not need it.

Hans-Christian

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

Thanks, yes, I did that right off.

My question was more around whether there was a reason to build STK1000 components and image at all if all I'm concerned with is the NGW100? I'm wondering if there's a later step in this process where I'll need some component the STK1000 build covered but the NGW build didn't.

Thanks

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

Correct, the NGW build uses the builds from the STK1000 build I think. I do not have that great knowledge about this script. I am, like you, just a user of it :)

Hans-Christian

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

The build script has two sections, one which apparently builds an image that that is "Basic AVR32 Linux image" and the comment above it says "includes all packages used by both the STK1000 and the NGW. Then below that build section is another build section that seems to be only for STK1000 "STK1000 Linux image - standard" - it's the second one in which "pong" was a part of which is obviously not applicable to the NGW.

So, I have commented out the entire 2nd STK1000 build section and have left in the "Basic AVR32 Linux image" build script all the way up to "create_image".

I was able get it to successfully generate an image for me. This is what it generated in my "mybuilds" directory when I ran the script:

total 15299
drwxr-xr-x 7 root root      296 2007-04-23 22:42 avr32-linux-image-basic
-rw-r--r-- 1 root root 15483675 2007-04-23 22:45 avr32-linux-image-basic.img.gz
drwxr-xr-x 7 root root      296 2007-04-23 22:10 avr32-linux-image-stk1000
-rwxr-xr-x 1 root root    94672 2007-04-23 22:23 u-boot.bin
-rw-r--r-- 1 root root    61775 2007-04-23 22:23 u-boot-upgrade-1.1.4-at1-from-bsp-1.0.uimg

So, I believe I just got my first kernel build from SuSE 10.

Now I'd like to try to flash my NGW with it. I didn't see any tutorials in the docs on how to set up uboot for a TFTP flashing. The BSP wiki docs section "AVR32 Linux Development/U-Boot" didn't cover very much. I'm probably missing it. If someone could point me to the right place in the docs that'd be great...otherwise, if there's a documented procedure somewhere else, that's fine, too.

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

I found the TFTP stuff on the BSP wiki on the page titled "AVR32 Linux Development/Filesystem over NFS for AVR32 Linux"

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

I found some problems with the BSP wiki docs related to TFTP. It mentions setting 'tfpserver' to the IP of the TFTP server.

In order to get it to work I set the tftpip variable not "tfpserver" as the wiki states. Also, in my environment I copied my 'mybuilds' directory to the TFTP root, so I needed to add the subdirectory 'avr32-linux-image-basic' to the uImage filename. That's not an error per-se, just a difference in how I set it up. Here's the setup and boot:

Uboot> set bootcmd 'set bootfile avr32-linux-image-basic/uImage;dhcp;bootm'
Uboot> printenv
baudrate=115200
ethaddr=00:04:25:1C:50:DC
bootdelay=1
eth1addr=00:04:25:1C:50:DD
bootargs=console=ttyS0 root=/dev/mtdblock1 rootfstype=jffs2
tftpip=192.168.5.177
serverip=192.168.5.177
stdin=serial
stdout=serial
stderr=serial
bootfile=uImage
ethact=macb0
bootcmd=set bootfile avr32-linux-image-basic/uImage;dhcp;bootm

Environment size: 318/65532 bytes
Uboot> boot
macb0: Starting autonegotiation...
macb0: Autonegotiation complete
macb0: link up, 10Mbps half-duplex (lpa: 0x0021)
BOOTP broadcast 1
BOOTP broadcast 2
DHCP client bound to address 192.168.5.170
Using macb0 device
TFTP from server 192.168.5.177; our IP address is 192.168.5.170
Filename 'avr32-linux-image-basic/uImage'.
Load address: 0x10200000
Loading: T #################################################################
         #################################################################
         ##########################################
done
Bytes transferred = 879312 (d6ad0 hex)
## Booting image at 10200000 ...
   Image Name:   Linux-2.6.18-at1
   Image Type:   AVR32 Linux Kernel Image (gzip compressed)
   Data Size:    879248 Bytes = 858.6 kB
   Load Address: 10000000
   Entry Point:  90000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

As you can see I was able to transfer and boot an image by TFTP. Given the fact busybox init is a lot different from the stock console output of the factory flashed image and failed to setup eth1, GPIO s99gpio: 8 failed, this must have been the image I built. Not sure how else to verify that it booted my image, but it looks like it did.

So, the next major question is why, if I used the build-linux script from the BSP, doesn't the resulting boot work the same as the stock board? I'm obviously missing something in the process. What I want to get to is this:

Use the BSP build scripts to build an image, boot it on the NGW100 and get the same results as the stock flashed image. Once I have that repeatable baseline, I feel like I could continue with actual app development.

What should be my next steps to resolve this so I can do a basic build with the BSP scripts and get it to work like the stock flash?

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

Here's the full output of my first kernel build boot log where you can see it failed in various busybox inits:

Loading: T #################################################################
         #################################################################
         ##########################################
done
Bytes transferred = 879312 (d6ad0 hex)
## Booting image at 10200000 ...
   Image Name:   Linux-2.6.18-at1
   Image Type:   AVR32 Linux Kernel Image (gzip compressed)
   Data Size:    879248 Bytes = 858.6 kB
   Load Address: 10000000
   Entry Point:  90000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

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

clk pixclk: new parent pll0 (was (null))
clk pixclk: new rate 130000000 (actual rate 130000000)
pdc pdc.0: Atmel Peripheral DMA Controller enabled
EIM: External Interrupt Module at 0xfff00000, IRQ 19
EIM: Handling 4 external IRQs, starting with IRQ 64
smc smc.0: Atmel Static Memory Controller at 0xfff03400
pio0: Atmel Port Multiplexer at 0xffe02800 (irq 13)
pio0: Handling 32 external IRQs, starting with IRQ 96
pio1: Atmel Port Multiplexer at 0xffe02c00 (irq 14)
pio1: Handling 32 external IRQs, starting with IRQ 128
pio2: Atmel Port Multiplexer at 0xffe03000 (irq 15)
pio2: Handling 32 external IRQs, starting with IRQ 160
pio3: Atmel Port Multiplexer at 0xffe03400 (irq 16)
pio3: Handling 32 external IRQs, starting with IRQ 192
dmac0: DesignWare DMA controller at 0xff200000 irq 2
NET: Registered protocol family 2
IP route cache hash table entries: 256 (order: -2, 1024 bytes)
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 1024 bind 512)
TCP reno registered
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
io scheduler noop registered (default)
sidsafb: 76800B framebuffer too small for 320x240x24
sidsafb: 76800B framebuffer too small for 320x240x24
sidsafb: No suitable video mode found
Serial: Atmel USART3 driver
usart.1: ttyS0 at MMIO 0xffe01000 (irq = 7) is a USART3
usart.2: ttyS1 at MMIO 0xffe01400 (irq = 8) is a USART3
usart.3: ttyS2 at MMIO 0xffe01800 (irq = 9) is a USART3
eth0: Atmel MACB at 0xfff01800 irq 25 (00:04:25:1c:50:dc)
physmap platform flash device: 00800000 at 00000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
 Amd/Fujitsu Extended Query Table at 0x0041
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
RedBoot partition parsing not available
Using physmap partition information
Creating 3 MTD partitions on "physmap-flash.0":
0x00000000-0x00020000 : "u-boot"
0x00020000-0x007f0000 : "root"
0x007f0000-0x00800000 : "env"
atmel_spi atmel_spi.0: Atmel SPI Controller at 0xffe00000 (irq 3)
mmc0: Atmel MCI controller at 0xfff02400 irq 28
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Time: avr32 clocksource has been installed.
VFS: Mounted root (jffs2 filesystem).
Freeing init memory: 52K (90000000 - 9000d000)
init started:  BusyBox v1.2.2 (2006.12.13-14:13+0000) multi-call binary
 * mounting virtual filesystems: /proc /sys /dev/pts /dev/shm /config /var/log /var/log/samba /var/log/ntpstats /tmp
 * setting hostname ...          'ngw.example.net'
 * network loopback ...          [ OK ]
 * starting syslogd ...          [ OK ]
 * log messages to syslog ...    [ OK ]
 * starting klogd ...            [ OK ]
 * set mdev hotplug ...          [ OK ]
 * mdev ...                      [ OK ]
 * probing modules ...           vfat failed, mmc_block failed, atmel-mci failed, [ OK ]
 * mounting filesystems:         [ FAILED ]
 * setup eth0 ...                /etc/init.d/S10networking: /etc/init.d/S10networking: 23: awk: not found
[ STATIC ] ()
 * setup eth1 ...                [ FAILED ]
 * Network ...                   [ FAILED ]
 * get board type for GPIO ...   /etc/init.d/S99gpio: /etc/init.d/S99gpio: 8: cut: not found
[ FAILED ]

Network Gateway ready

So, my question is, since I built this image from the build script on the BSP, what would account for these failures and what should I do to start correcting these so I can get on top of a good kernel build?

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

BTW - related to the other thread on USART mapping to /dev/tty devices, check out the output above:

usart.1: ttyS0 at MMIO 0xffe01000 (irq = 7) is a USART3 
usart.2: ttyS1 at MMIO 0xffe01400 (irq = 8) is a USART3 
usart.3: ttyS2 at MMIO 0xffe01800 (irq = 9) is a USART3 

I went to my /dev on this build and see /dev/ttyS0, /dev/ttyS1 and /dev/ttyS2. I haven't yet soldered any headers on my board to actually try out the auxilliary uarts, but this makes it look like it found it. Again, just brings up more questions about why this build from the BSP would act so differently than the stock image.

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

You have made a kernel for the ATSTK1000, you need to apply the atngw_defconfig instead:

make ARCH=avr32 CROSS_COMPILE=avr32-linux- atngw_defconfig

And you need the patch to put PORT E as GPIO.

Hans-Christian

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

hmmm...I used the build-linux script from the BSP script directory and even had the STK1000 portion "STK1000 Linux image - standard" of the build commented out.

# Build Basic Linux image
# This includes all pacakges used by both the STK1000 and the NGW
ROOT=${ROOT_BASIC}
ROOT_REF=$sd_image_ref
ROOT_IMAGE_NAME="Basic AVR32 Linux image"
ROOT_IMAGE_SIZE=120000
create_root
build_uclibc
build_kernel
build_busybox
build_strace
build_zlib
build_ncurses
build_ftpd
build_joe
build_gdbserver
build_dropbear
build_ntp
build_net_tools
build_dnsmasq
create_etc_release
create_image


# Build STK1000 Standard Linux image
#ROOT=${ROOT_STK1000}
#ROOT_REF=${ROOT_BASIC}
#ROOT_IMAGE_NAME="STK1000 Linux image - standard"
#ROOT_IMAGE_SIZE=120000
#create_root
#build_libpng
#build_libungif
#build_libjpeg
#build_fbv
#build_fbset
#build_alsa_lib
#build_alsa_utils
#build_fusion
#build_freetype
#build_directfb
#build_pong
#build_gawk
#get_stk1000_web
#create_etc_release
#create_image

So, what else would I need to comment out of the script in order to build an NGW only build?

Where can I find the procedure to patch the PORT E/GPIO?

I also wanted to know if there were instructions anywhere which discussed how to load the 3 types of images: uImage, the jffs usr img, and the jffs root img. These 3 images get built when I run the build scripts from the BSP. Is there any tutorial for how they should be loaded and flashed into the device? How can I load and test them before I flash them into the device?

Sorry I'm still green at this and can use pointers. I'm documenting as I go, so hopefully anyone following with similar questions will be able to do it as well.

Thanks for your help,

Landon

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

So, digging into the build-linux-environment.sh script, I need to ask - do I add the atngw_defconfig to every instance of

make ARCH=avr32 CROSS_COMPILE=avr32-linux- 

that I see in the build script? Or am I missing a default config variable somewhere where I can change it once and it will affect the whole build?

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

I copied the patch file from this thread: Quick and dirty patch for Port E GPIO to my software/linux directory and added it to the end of the linux/series text file.

Based on reading the build script, I think it should get picked up automatically during the patch phase of the build. Is this the correct way to incorporate patches - toss them into the software/linux directory and modify the series txt file?

I need some guidance as to where to include the atngw_defconfig modification in the script to build an NGW only image.

I copied back over the build-linux-environment.sh script from the BSP to my dev machine to make sure I was starting with exactly what came off the BSP and just commented out the "pong" build.

Seems like there must be some build env variable I'm missing that would let me just specify the NGW build so I don't accidentally build STK1000 (also/only.)

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

No I don't think you're missing anything, that script is just pretty heavily stk1000-only. It's set up such that the script's author can add the ngw-specific bits later, but it appears that those changes either don't yet exist or haven't made it on to the BSP2.0.0.

Your assumptions about the patching of porte are correct, yep. That should all work.

As for where to place the config, I don't have the script on me to tell you exactly but you should find a step (or series of steps) in the kernel build portion of the script which makes the correct config. The lines might either copy a config from somewhere then 'make [FLAGS] oldconfig', or they might 'make [FLAGS] defconfig'. Either way, this line which generates the config is the one which should be changed to 'make [FLAGS] atngw_defconfig.

You may find that the defconfig doesn't in fact have everything you'll want, in which case jump in the the Linux menuconfig, select all you do want and save the config. Then copy the .config to somewhere safe and chage the build script to copy this config file in to the source directory after patching, then get it to run 'make [FLAGS] oldconfig'.

Hope this helps a little, I shall attack the script when I get home and see if I can make it a bit more user-friendly :)

-S.

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

So, it's clear now that the build scripts on the BSP were never used to build the NGW images that ship with the board. Whatever was used to build the stock images wasn't supplied by Atmel. I think it should be, so hopefully Atmel is listening and will supply build scripts that really build an NGW image.

I'm trying a couple of things right now. In the build-linux-environment.sh script I'm creating a new NGW build root type:

ROOT_BASIC="`cd ${BUILDDIR}/avr32-linux-image-basic && pwd`"
#ROOT_STK1000="`cd ${BUILDDIR}/avr32-linux-image-stk1000 && pwd`"
ROOT_NGW100="`cd ${BUILDDIR}/avr32-linux-image-ngw100 && pwd`"

Then changing the name of the image to be specific to ngw:

# Build NGW100 Standard Linux image
ROOT=${ROOT_NGW100}
ROOT_REF=${ROOT_BASIC}
ROOT_IMAGE_NAME="NGW100 Linux image - standard"
ROOT_IMAGE_SIZE=120000

and using the atngw_defconfig during the make config stage:

    task_start "Linux kernel - make oldconfig and make"

    # Update version number in Makefile
    sed -e "s/EXTRAVERSION =/EXTRAVERSION = ${LINUX_ATMEL_EXTRAVERSION} #/g" \
        Makefile > tmp_Makefile
    mv -f tmp_Makefile Makefile

    make ARCH=avr32 KBUILD_HAVE_NLS=$KBUILD_HAVE_NLS atngw_defconfig  \
        > make.oldconfig.out 2>&1 || task_error "See make.oldconfig.out"

Now I'm running:

./build-linux-environment.sh ../software/ ../builds/ngw/ ../mybuilds/

Will see how it fairs. Even if it succeeds, it's not going to be the same as the Atmel stock build. It really seems like a prerequisite (requirement) that whatever was used to build the factory image should be supplied on the BSP so it's possible to always go back to a baseline.

As it is with the NGW right now, there's no way to start with a baseline build. I know they supply the images, but they don't supply the mechanism to make the images. So for all intents and purposes, it's black magic and non-repeatable until the mechanism is provided (or we figure one out that works, but that doesn't seem like the point of having a BSP.)

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

You are partly correct, the images has to be heavily modified after the source is built, see the "strip" guide below for some pointers.

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

Hans-Christian

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

Thanks for your response.

Are there plans to provide a script to build NGW images so they can be built in a consistent way for purposes of a BSP baseline?

For example, I'm still not sure if I'm using the atngw_defconfig in the correct place or building an NGW image correctly. I still don't see any Wiki page or other docs on how to modify the build-linux-environment.sh to produce an NGW image to start with.

Is there anyone who has a build-linux-environment.sh script that successfully builds the correct NGW artifacts?

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

To answer a previous question I had about the procedure to handle the 3 image types and reflash the device, I apparently missed this wiki entry, so I'm pointing to it here:

https://www.avrfreaks.net/wiki/index.php/Documentation:NGW/Firmware_upgrade for anyone else looking for it that's in this thread.

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

Quote:
Are there plans to provide a script to build NGW images so they can be built in a consistent way for purposes of a BSP baseline?
Yes :)

Quote:
For example, I'm still not sure if I'm using the atngw_defconfig in the correct place or building an NGW image correctly. I still don't see any Wiki page or other docs on how to modify the build-linux-environment.sh to produce an NGW image to start with.
For u-boot:

make atngw_config

For the Linux kernel:

make ARCH=avr32 CROSS_COMPILE=avr32-linux- atngw_defconfig

If you get an error have a look in arch/avr32/configs.

Hans-Christian

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

Hi Landon,

First of all, thanks for documenting this process.. It has helped me (and I'm sure many others) a lot in navigating the build process in terms of differences from the STK1000.. I've successfully set up the build system on Ubuntu based on your posts and have built the basic build.. The next step is to add the atngw_defconfig, atngw_config and GPIO patches, as well as the ngw-specific name changes, but it would be helpful if I knew that this would do the trick..

It seems like you were almost there as of your last post.. Can you update us as to what has/hasn't worked since then.. Also, if you've been successful, would it be possible to post your hacked build-linux-environment.sh?

I'd be happy to turn this into a wiki entry until Atmel ships a proper ngw build script..

Thanks a million..

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

Thanks for the encouragement - I'm glad you found it of use so far. To tell you the truth I have been buried since that last post and haven't had a chance to get back into it. I want to soon, so unfortunately I don't have any news to report at this point.

I would love it if Atmel would supply us a build script for the NGW100 - the same one they use to build the factory images. It still seems like until we get that from Atmel, we will (I'm sure) get something that will work, but will never be sure we're on solid footing unless we can build it the way Atmel does and can repeat the process.

HCE, any news on an official, Atmel supplied NGW100 build script? Thanks,

Landon

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

I've emailed avr32@atmel.com and requested the build script.. Please do the same if you would like a solid starting point for development with the NGW..

HCE: Is there any specific person we can contact at Atmel who can just post a proper build script for the current NGW image to the wiki? I'd assume there is an internal build script or at the very least instructions so that the image would be consistent across builds..

Also, where does the T2 SDE support for AVR32 play into all of this?

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

landoncox wrote:
I would love it if Atmel would supply us a build script for the NGW100 - the same one they use to build the factory images.
I think one issue might be that no script was used to build the factory images. I'm just guessing here, but I know I've build up some root fs images for ngw100 semi-manually, cherry-picking the bits I want from my stk1000 root fs and manually adding the extra bits I need. Consistency across builds is achieved by the fact that the root filesystem is stored in a version-controlled staging directory which is then just pulled to an image when I need to.
landoncox wrote:
Also, where does the T2 SDE support for AVR32 play into all of this?
I did hear tell that someone was working on a port, it would certainly be a useful tool. Not a critical one though (IMHO).

-S.

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

It is documented in the Wiki how to build the NGW images:

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

Yes, you have to manually strip some directories and software, and you have to make the JFFS2 images by hand. Other than that it is based on the same software that is shipped with the Linux BSP 2.0.

Although busybox is upgraded to latest stable release, the same for Samba.

New build system will most likely be published within the next months. More robust, more features, more general :)

Have a nice weekend.

Hans-Christian

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

I was building up a new SuSE 10 build environment and happened to run across a different error, it blew up building ncurses, which I hadn't seen when I first started this thread. After pawing through the make.out of ncurses, this error manifested itself as:

./gen '' B K >Key_Definitions
./gen: error while loading shared libraries: /home/lcox/Documents/avr32/software/ncurses/ncurses-5.5/lib/libncurses.so.5: ELF file data encoding not little-endian

while building ncurses.

Context was Ada95 ncurses build:

make[1]: Leaving directory `/home/lcox/Documents/AVR32NGW100/software/ncurses/ncurses-5.5/c++'
cd Ada95 && make DESTDIR="" all
make[1]: Entering directory `/home/lcox/Documents/AVR32NGW100/software/ncurses/ncurses-5.5/Ada95'
for d in gen src samples; do \
        (cd $d ; make  all) ;\
done
make[2]: Entering directory `/home/lcox/Documents/AVR32NGW100/software/ncurses/ncurses-5.5/Ada95/gen'
gcc -I. -I../../include -DHAVE_CONFIG_H -I. -O2 -c -o gen.o ./gen.c
gcc -I. -I../../include -DHAVE_CONFIG_H -I. -O2 gen.o    -Wl,-rpath,/home/lcox/Documents/avr32/software/ncurses/ncurses-5.5/lib  -L../../lib -lncurses -o gen
/usr/lib/gcc/i586-suse-linux/4.1.0/../../../../i586-suse-linux/bin/ld: skipping incompatible ../../lib/libncurses.so when searching for -lncurses
./gen '' B K >Key_Definitions
./gen: error while loading shared libraries: /home/lcox/Documents/avr32/software/ncurses/ncurses-5.5/lib/libncurses.so.5: ELF file data encoding not little-endian
make[2]: *** [Key_Definitions] Error 127
make[2]: Leaving directory `/home/lcox/Documents/AVR32NGW100/software/ncurses/ncurses-5.5/Ada95/gen'
make[2]: Entering directory `/home/lcox/Documents/AVR32NGW100/software/ncurses/ncurses-5.5/Ada95/src'
gnatmake -O3 -gnatpn  -I. -I. -c -o terminal_interface.o ./terminal_in

Something in ncurses didn't seem to want to obey the correct CC or HOSTCC environment that was being used for everything else in the case when it was building Ada95 support. Naturally, I didn't care about Ada95, so found the configure flag to not build it, which was --without-ada.

So, in the build-linux-environment script, I had to add it to this line within the function build_ncurses() section:

    ./configure --host=avr32-linux --prefix=/usr --without-normal \
        --without-debug --without-ada --with-shared --program-transform-name='' \
        > configure.out 2>&1 || task_error "configure failed, see configure.out"

Once I added that, I built ncurses with no problems and proceeded through the rest of the build-linux-environment script. So, not sure why I didn't come across this the first time I set up SuSE 10, but if you hit this issue, this is one solution I found.

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

Yeah I've run in to this problem building ncurses outside the script. The error is just that Ada95 needs to host compile some helper bits after making ncurses.so but tries to link them against this newly created ncurses.so. Kinda makes sense for host compile, avoids a bootstrapping issue if you don't have any ncurses to start with, but cross compiling of course breaks.

Everything is working as the programmer asked, just a cross-compiling thinko in there.

Good to hear it's all flying right for you now.

-S.

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

Yes it seems to be similar to this bug/thread except that was written against an earlier version of ncurses.

So, I'm just about back to where I was before where I need to build an ngw100-only kernel. May be asking for more help soon so I can pick it up where I left off and try to get end-to-end on a SuSE10 build for NGW100. Thanks,

Landon

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

Sounds good, no worries. YMMV but building a kernel is orders of magnitude easier than a root filesystem, all you need to worry about is having checks in the right Kconfig boxes and the amount of coffee you drink during the endless compilations ;)

-S.

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

I need to ask some very specific questions about where to include the "atngw_defconfig" in order to adapt the build-linux-environment.sh script to build NGW100 specific software. I understand from the previous discussion that it needs to be incorporated into the building of uboot and the kernel, so I'm focusing on the build_uboot() and build_kernel() functions in the build-linux-environment.sh script. If there are other places, I need to focus on, let me know.

Starting with build_uboot(), where do I need to incorporate the atngw_defconfig? If I replace the "atstk1002_config" with an atngw_defconfig in the build_uboot code, below, a u-boot.bin is not found/built when I run the script:

function build_uboot() {
    task_start "U-boot - unpacking"
    do_pushd u-boot
    rm -rf u-boot-${U_BOOT_VERSION}
    rm -rf u-boot-${U_BOOT_VERSION}_org
    tar jxf u-boot-${U_BOOT_VERSION}.tar.bz2
    task_success

    task_start "U-Boot - patching"
    do_pushd u-boot-${U_BOOT_VERSION}
    for i in `cat ../series `; do patch -p1 < ../$i > patch.out 2>&1\
        || task_error "patch $i failed. See patch.out"; done
    do_popd
    task_success

    task_start "U-boot - config and make"
        pwd
    do_pushd u-boot-${U_BOOT_VERSION}
        pwd
    make atstk1002_config > make.config.out 2>&1
    # make atngw_defconfig > make.config.out 2>&1

    # NOTE: Can't make with - j here, so we don't use the do_make function.
    make > make.out 2>&1
    cp u-boot.bin "$BUILDDIR"/u-boot.bin
    do_popd
    do_popd
    task_success
}

The code above, with the atstk1002_config builds fine, but with the atngw_defconfig uncommented and atstk1002_config commented out, it doesn't.

So, I'm at an impasse (caused by my lack of understanding) about how to create an ngw100 specific u-boot.

My build_kernel() function is similar in that if I modify it like this:

function build_kernel() {
    task_start "Linux kernel - unpacking"
    do_pushd linux
    rm -rf linux-${LINUX_VERSION}
    rm -rf linux-${LINUX_VERSION}${LINUX_ATMEL_EXTRAVERSION}
    tar jxf linux-${LINUX_VERSION}.tar.bz2 || task_error "tar failed."
    mv linux-${LINUX_VERSION} linux-${LINUX_VERSION}${LINUX_ATMEL_EXTRAVERSION}
    task_success

    task_start "Linux kernel - patching"
    do_pushd linux-${LINUX_VERSION}${LINUX_ATMEL_EXTRAVERSION}

    # Remember Linux kernel source
    AVR32_LINUX_KERNEL_SOURCE="`pwd`"

    for i in `cat ../series `; do patch -p1 < ../$i > patch.out 2>&1 \
        || task_error "patch $i failed."; done
    task_success

    task_start "Linux kernel - make oldconfig and make"

    # Update version number in Makefile
    sed -e "s/EXTRAVERSION =/EXTRAVERSION = ${LINUX_ATMEL_EXTRAVERSION} #/g" \
        Makefile > tmp_Makefile
    mv -f tmp_Makefile Makefile

    #make ARCH=avr32 KBUILD_HAVE_NLS=$KBUILD_HAVE_NLS atngw_defconfig  \
    make ARCH=avr32 KBUILD_HAVE_NLS=$KBUILD_HAVE_NLS atstk1002_defconfig  \
        > make.oldconfig.out 2>&1 || task_error "See make.oldconfig.out"

    # alternative: use menuconfig (requres ncurses)
    [ -x ../../u-boot/u-boot-${U_BOOT_VERSION}/tools/mkimage ] \
        || task_error "Couldn't find mkimage from U-Boot"

    PATH="../../u-boot/u-boot-${U_BOOT_VERSION}/tools:$PATH" \
    make ARCH=avr32 CROSS_COMPILE=avr32-linux- \
        KBUILD_HAVE_NLS=$KBUILD_HAVE_NLS $MAKEOPTS \
        > make.out 2>&1 || task_error "make uImage failed. See make.out"
    cp arch/avr32/boot/images/uImage $ROOT/ || \
        task_error "Failed to install kernel into $ROOT"

    make ARCH=avr32 CROSS_COMPILE=avr32-linux- atngw_defconfig \
       KBUILD_HAVE_NLS=$KBUILD_HAVE_NLS $MAKEOPTS \
       INSTALL_MOD_PATH=$ROOT/ modules_install \
       > make.modules_install.out 2>&1 || \
       task_error "make uImage failed. See make.modules_install.out"
    do_popd
    do_popd
    task_success
}

Note the last make has the atngw_defconfig in it. However, though this all builds and I get some .img files out of it, I don't honestly know what I built and whether it's correct.

So, I would appreciate some feedback on specifically where I need to incorporate the atngw_defconfig ( there are a number of instances of:

make ARCH=avr32 CROSS_COMPILE=avr32-linux

and not all are appropriate to include an atngw_defconfig.

If someone who has done this and is confident in their resulting build could post their build_uboot and build_kernel functions, or for that matter, their whole build-linux-environment.sh script for ngw100 builds, I think that would be a very helpful comparison.

Thanks in advance for the help,

Landon

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

To build u-boot: make atngw_config && make. It should give you the u-boot.bin
To build the kernel: make atngw100_defconfig ARCH=avr32 && make ARCH=avr32 CROSS_COMPILE=avr32-linux-

Make sure to have a patched source and you should be ready to go

11011110101011011100000011011110

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

The uboot one is in the right place but should be atngw_config. It's different between uboot and Linux, they're different projects with different conventions :).

In Linux your place looks right. The only thing there would be that you may have to remove the stk1000_defconfig line completely otherwise the trailing \ won't work as intended.

-S.

EDIT: @krangnes yeah but modifying the script is nice so it all gets installed to the right place in the root fs :)

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

Thanks for the responses. I'll make these modifications when I get a chance, hopefully tonight after work. ( I was able to flash the latest factory .img files, so I think once I get through these final build tweaks, I'll be ready to go. ) Again, thanks,

Landon

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

With those modifications, I was able to successfully build images. Will reflash the device with them, hopefully tonight, to see how they fair. Assuming they work, I'll post the script I used. I also just got the JTAG ICE MKII in the mail so will see 1) if I can figure out how to make it work and 2) use it to reflash my u-boot. If I can successfully reflash the u-boot with the one I made and have it all come up I'll feel like I've finally been full-circle on this environment.

Thanks again for all the help throughout,

Landon

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

Here are the results of flashing the root.img I built through the modified build-linux-environment.sh script. I pick up this thread at the point I copied the TFTP'd memory image to flash:

Uboot> cp.b 0x90000000 0x20000 0x620000
Copy to Flash... done
Uboot> protect on all
Protect Flash Bank # 1
Uboot> boot
### JFFS2 loading 'uImage' to 0x90000000
Scanning JFFS2 FS: ....... done.
### JFFS2 load complete: 904654 bytes loaded to 0x90000000
## Booting image at 90000000 ...
   Image Name:   Linux-2.6.18-at0
   Image Type:   AVR32 Linux Kernel Image (gzip compressed)
   Data Size:    904590 Bytes = 883.4 kB
   Load Address: 10000000
   Entry Point:  90000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... Error: inflate() returned -3
GUNZIP ERROR - must RESET board to recover

U-Boot 1.1.4-at0 (Jan  3 2007 - 10:30:09)

U-Boot code: 00000000 -> 000144f7  data: 24000000 -> 24002d80
SDRAM: 32 MB at address 0x10000000
Testing SDRAM...OK
malloc: Using memory from 0x11fc0000 to 0x12000000
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 'uImage' to 0x10200000
Scanning JFFS2 FS: ....... done.
### JFFS2 load complete: 904654 bytes loaded to 0x10200000
## Booting image at 10200000 ...
   Image Name:   Linux-2.6.18-at0
   Image Type:   AVR32 Linux Kernel Image (gzip compressed)
   Data Size:    904590 Bytes = 883.4 kB
   Load Address: 10000000
   Entry Point:  90000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

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

pio: invalid pin 128
Stack: (0x901ebf40 to 0x901ec000)
bf40: 900106fa 901ebf54 00000000 00000000 00000000 90002966 901ebf68 00000000
bf60: 00000000 00000000 90002fd6 901ebf8c 00000000 9000ba44 00000000 00000000
bf80: 90017adc 9000e5dc 00000000 900034f8 901ebfa0 9000ba7c 00000000 00000000
bfa0: 9000e63a 901ebfdc 9000b87c 9000d400 00000000 00000000 00400000 90011478
bfc0: 90011478 901ec000 00000000 00000000 00000000 00000000 00000000 90017adc
bfe0: 00000000 00000000 00000000 00000000 00000000 90017adc 9000e5dc 00000000
Call trace:
 [<900106e8>] show_stack+0x3c/0x44
 [<900106fa>] dump_stack+0xa/0xc
 [<90002966>] at32_select_gpio+0xba/0xc4
 [<90002fd6>] at32_add_device_mmci+0x62/0x8c
 [<900034f8>] atngw_init+0x4c/0x60
 [<9000e63a>] init+0x5e/0x1c0
 [<90017adc>] do_exit+0x0/0x598


pdc pdc.0: Atmel Peripheral DMA Controller enabled
EIM: External Interrupt Module at 0xfff00000, IRQ 19
EIM: Handling 4 external IRQs, starting with IRQ 64
smc smc.0: Atmel Static Memory Controller at 0xfff03400
pio0: Atmel Port Multiplexer at 0xffe02800 (irq 13)
pio0: Handling 32 external IRQs, starting with IRQ 96
pio1: Atmel Port Multiplexer at 0xffe02c00 (irq 14)
pio1: Handling 32 external IRQs, starting with IRQ 128
pio2: Atmel Port Multiplexer at 0xffe03000 (irq 15)
pio2: Handling 32 external IRQs, starting with IRQ 160
pio3: Atmel Port Multiplexer at 0xffe03400 (irq 16)
pio3: Handling 32 external IRQs, starting with IRQ 192
dmac0: DesignWare DMA controller at 0xff200000 irq 2
NET: Registered protocol family 2
IP route cache hash table entries: 256 (order: -2, 1024 bytes)
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 1024 bind 512)
TCP reno registered
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler cfq registered (default)
Serial: Atmel USART3 driver
usart.1: ttyS0 at MMIO 0xffe01000 (irq = 7) is a USART3
loop: loaded (max 8 devices)
eth0: Atmel MACB at 0xfff01800 irq 25 (00:04:25:1c:50:dc)
eth1: Atmel MACB at 0xfff01c00 irq 26 (00:04:25:1c:50:dd)
physmap platform flash device: 00800000 at 00000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
 Amd/Fujitsu Extended Query Table at 0x0041
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
cmdlinepart partition parsing not available
RedBoot partition parsing not available
Using physmap partition information
Creating 3 MTD partitions on "physmap-flash.0":
0x00000000-0x00020000 : "u-boot"
0x00020000-0x007f0000 : "root"
0x007f0000-0x00800000 : "env"
atmel_spi atmel_spi.0: Atmel SPI Controller at 0xffe00000 (irq 3)
mtd_dataflash spi0.0: AT45DB642x (8448 KBytes)
ip_conntrack version 2.4 (256 buckets, 2048 max) - 204 bytes per conntrack
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Time: avr32 clocksource has been installed.
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005e10a4: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005e10a8: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005e10ac: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005e10b0: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005e10b4: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005e10b8: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005e10bc: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005e10c0: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005e10c4: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005e10c8: 0x0017 instead
Further such events for this erase block will not be printed
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005f0000: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005f0004: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005f0008: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005f000c: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005f0010: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005f0014: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005f0018: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005f001c: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005f0020: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005f0024: 0x0017 instead
Further such events for this erase block will not be printed
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00600000: 0x0018 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00600004: 0x0018 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00600008: 0x0018 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0060000c: 0x0018 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00600010: 0x0018 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00600014: 0x0018 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00600018: 0x0018 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0060001c: 0x0018 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00600020: 0x0018 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00600024: 0x0018 instead
Further such events for this erase block will not be printed
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00610000: 0x0018 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00610004: 0x0018 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00610008: 0x0018 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0061000c: 0x0018 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00610010: 0x0018 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00610014: 0x0018 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00610018: 0x0018 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0061001c: 0x0018 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00610020: 0x0018 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00610024: 0x0018 instead
Further such events for this erase block will not be printed
VFS: Mounted root (jffs2 filesystem).
Freeing init memory: 56K (90000000 - 9000e000)
init started:  BusyBox v1.2.2 (2006.12.13-14:13+0000) multi-call binary
 * mounting virtual filesystems: /proc /sys /dev/pts /dev/shm /config /var/log /var/log/samba /var/log/ntpstats /tmp
 * setting hostname ...          'ngw.example.net'
 * network loopback ...          [ OK ]
 * starting syslogd ...          [ OK ]
 * log messages to syslog ...    [ OK ]
 * starting klogd ...            [ OK ]
 * set mdev hotplug ...          [ OK ]
 * mdev ...                      [ OK ]
 * probing modules ...           vfat loaded, mmc_block loaded, atmel-mci loaded, [ OK ]
 * mounting filesystems:         /usr
 * setup eth0 ...                [ OK ] (192.168.5.170)
 * setup eth1 ...                [ OK ]
 * network ...                   [ OK ]
 * starting telnetd ...          [ OK ]
 * enable ipv4 forwarding ...    [ OK ]
 * iptables postrouting ...      [ OK ]
 * iptables incoming trafic ...  [ OK ]
 * iptables outgoung trafic ...  [ OK ]
 * starting dnsmasq ...          [ OK ]
 * running ntpdate ...           [ OK ]
 * starting ntpd ...             [ OK ]
 * generate SSH RSA key ...      [ OK ]
 * generate SSH DSS key ...      [ OK ]
 * starting dropbear ...         [ OK ]
 * starting inted ...            [ OK ]
 * starting nmbd ...             [ OK ]
 * starting smbd ...             [ OK ]
 * starting winbindd ...         [ OK ]
 * starting httpd ...            [ OK ]
 * get board type for GPIO ...   'NGW'
 * setup GPIO boot LED ...       [ OK ]
 * setup GPIO LED A ...          [ OK ]
 * setup GPIO LED B ...          [ FAILED ]

Network Gateway ready



BusyBox v1.2.2 (2006.12.13-14:13+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

-sh: can't access tty; job control turned off
~ #

I ignored the various warnings, and proceeded - was thinking I would next flash my usr.img.

So, I went to do the /etc/init.d/S90reboot command to take the system down to the single user, but there was no /etc/init.d/S90reboot in the init.d directory. I only had these contents:

~ # ls /etc/init.d
S01mountvirtfs   S10mdev          S20samba         S50alsa-utils
S02hostname      S10modules-init  S20ssh           S91httpd
S08loopback      S10networking    S20telnet        S99fbset
S09klog          S11iptables      S23ntp           S99gpio
S09syslog        S15dnsmasq       S35mountall      S99splash
S10dhcp          S20inetd         S45firewall      rcS
~ #

So, given that I was off the rails at that point, I didn't spend any more time trying to figure out how to get an S90reboot script over there. The network was alive and I could ping my way around. The error:

-sh: can't access tty; job control turned off
~ #

only happens after the initial boot after reflashing my own image. After I reboot that image, the error disappears. Without the reboot it's not possible to ^C a command that's running...I had started a ping but couldn't break it, so rebooted and after that everything was normal and busybox didn't give me the tty error above again.

I should also mention that the message:

   Uncompressing Kernel Image ... Error: inflate() returned -3 
GUNZIP ERROR - must RESET board to recover 

is never output again after I manually reset the board.

I was able to reflash the 1.0.2 factory root back onto the device and get back to the baseline.

So, my questions at this point in the process are:

1) Any ideas why my build-linux...script, with the changes of the atngw_defconfig (kernel) and atngw_config (uboot), would have not build a full root image (by full I mean it's missing some stuff like the init.d/S90reboot script...and I suspect other things as well.

2) Is it worth just copying an S90reboot script to the image I flashed, and attempt to flash my usr.img on as well, or is this build derailed enough that I should try to fix all the issues I see before worrying about usr.img?

Hopefully, there's some clues in the boot messages of my build that can give you kernel experts direction for me to go next. Would appreciate any ideas for what to focus on and how to fix it.

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

Ya I think it would be worth copying that script across. I don't know why the build script wouldn't put it in but looking through my rootfs I don't have it either. I can't remember where I got this filesystem from though, it's kinda been pieced together over a few weeks/months so it isn't too surprising in my case.

The stack dump at the top and the GPIO_B failing is because your kernel image doesn't have support for PIOE (the STK1000 has this connected to the EBI so there was no need for PIO control). There's a patch floating around posted by hce to fix this if it bothers you.

The magic bitmask cruft I thought was a result of the incorrect block size being passed to the mkfs.jffs2, but they could have been a symptom of a symptom kinda thing. The script generates a rootfs folder, you manually mkfs.jffs2'd it did you?

-S.

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

The shutdown scripts was added after the release of Linux BSP 2.0.

You also need the enable PORTE as GPIO patch laying on this forum, it will remove the invalid pin message.

And I think you should erase your entire flash before programming it, to get rid of the "jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00610024: 0x0018 instead". AFAICT those messages are from your mtd1 device.

Use flash_eraseall -j /dev/mtd1 (write cleanmarkers while erasing).

Hans-Christian

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

Many thanks for the responses. The script is what genereated the jffs2 images - I didn't take any extra steps, so what was put into my build directory is definitely what the script built. I also take a look around for the PORTE GPIO patch and incorporate that.

I will followup on the suggestions and report back my results. Thanks again for your help and advice.

Landon

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

Hi Landon,

Good to see that you're back at it.. We'll get this thing figured out soon enough..

So I got a response from my email to avr32@atmel.com claiming that the ngw build process was laid out on the avrfreaks wiki.. I then pointed to this thread saying that wasn't exactly true.. Here's what they said:

Quote:

> That's not exactly true.. Although it claims that the "Basic Linux
> Image" contains the files for the NGW, u-boot and the kernel are built
> specifically for the STK1000.. Also, this all still requires a patch
> to enable GPIO which is not on the latest BSP CD..

I did some diffs with the internal script I've got, and the one I've got differs somewhat from the one on the web. It adds some builds of the NGW, other than that they're copies. For the packages that's missing in the script you got from me: haserl.tar.gz, iptables.tar.gz, samba.tar.gz and webif.tar.gz, you'll find all of the packages at http://www.atmel.no/beta_ware/av.... Please note that the directory is not browseable, so you'll have to provide a full path in order to get the packages.

The script is lacking some build information. To build jffs2 images:

Howto build a root image for the ngw parallel flash:
mkfs.jffs2 --output=/path/to/images/atngw100_root.img --root=/path/to/root --big-endian --pagesize=4096 --eraseblock=65536

Howto build a root image for the ngw serial flash:
mkfs.jffs2 --output=/path/to/images/atngw100_usr.img --root=/path/to/root/usr --big-endian --no-cleanmarkers --pagesize=1056
--eraseblock=8448

Now I'm a little leery about this response because it doesn't mention the ngw specific things like "atngw_deconfig" and the GPIO patch (http://2313.avrfreaks.net/index....) that we've learned about on this thread..
But it does mention some things that are missing from the BSP 2.0 iso and how to get them..

I haven't had a chance to test the resulting image based on my hacked build script because I couldn't get nfs to behave and had to get some other things done..

Oh and I've attached the files avr32@atmel.com sent me.. Just remove the .txt

Attachment(s): 

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

hce wrote:
The shutdown scripts was added after the release of Linux BSP 2.0.

You also need the enable PORTE as GPIO patch laying on this forum, it will remove the invalid pin message.

And I think you should erase your entire flash before programming it, to get rid of the "jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00610024: 0x0018 instead". AFAICT those messages are from your mtd1 device.

Use flash_eraseall -j /dev/mtd1 (write cleanmarkers while erasing).

Thanks for the info. I went back to my software/linux directory and confirmed that I had the patch in that directory. This is the patch that I had in the directory. It was also listed on the very last entry of my series file, so I'm pretty sure this patch was included in the build.

Is there another patch I should have used? If not, then it appears this patch didn't work.

Next time, I will try the full erase as you suggested. Thank you.

Landon

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

fabuser wrote:

Oh and I've attached the files avr32@atmel.com sent me.. Just remove the .txt

Thanks for working the atmel support side of this. Their build-all.sh script that was attached above still has all the stk1000 configs in it. There aren't any ngw100 config makes for uboot or the kernel.

According to hce, if I do a full erase of flash I'll get rid of the block errors and then figure out why the add-pioe-gipo-initialization patch isn't doing what it should that I'll have a "clean" build of the root image.

I'll still need to copy the init.d/S90reboot script over after the fact. It's this type of thing that makes me wonder what else I'm missing. I should unroll the factory image and my build image and do a complete inventory compare to see what the differences are.

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

hce wrote:

And I think you should erase your entire flash before programming it, to get rid of the "jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00610024: 0x0018 instead". AFAICT those messages are from your mtd1 device.

Use flash_eraseall -j /dev/mtd1 (write cleanmarkers while erasing).

To followup on this, I flashed the factory 1.0.2 images into the device and then did an /etc/init.d/S90reboot. After it returned to the # prompt, I ran the flash erase command above. It successfully finished (at least no errors were reported.)

I then rebooted, broke into uboot, and flashed the root image I made from the build-linux-environment.sh script (the one modified with the atngw_defconfig kernel.) That followup boot still generated all the jffs2_scan_eraseblock errors that it did before. However, after the first boot which generates the errors, a second boot only produced a few compared to the first. The error block in its entirety is:

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005e10a4: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005e10a8: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005e10ac: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005e10b0: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005e10b4: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005e10b8: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005e10bc: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005e10c0: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005e10c4: 0x0017 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005e10c8: 0x0017 instead

It will also produce this error on the way up:


BusyBox v1.2.2 (2006.12.13-14:13+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ # Checked all inodes but still 0xc6dc8 bytes of unchecked space?
kernel BUG at fs/jffs2/gc.c:147!
Kernel BUG in arch/avr32/kernel/traps.c::do_illegal_opcode, line 397[#1]:
Modules linked in: atmel_mci mmc_block mmc_core vfat fat
PC is at jffs2_garbage_collect_pass+0x4e/0x4e8
LR is at 0x9014b9b0
pc : [<900904e6>]    lr : [<9014b9b0>]    Not tainted
sp : 91d2df30  r12: 00000042  r11: 00000001
r10: 00000000  r9 : 00000000  r8 : 9014b9b0
r7 : 91d2df48  r6 : 91cb39c8  r5 : 902f582c  r4 : 00000000
r3 : 00000001  r2 : 90017adc  r1 : 902f5800  r0 : 902f5800
Flags: qvnzc
Mode bits: hrje....g
CPU Mode: Supervisor
Call trace:
 [<90091472>] jffs2_garbage_collect_thread+0xb6/0xd8
 [<90017adc>] do_exit+0x0/0x598


Process jffs2_gcd_mtd3 (pid: 183, stack limit = 0x91d2c028)
Stack: (0x91d2df30 to 0x91d2e000)
df20:                                     000c6dc8 91d2df44 91d2c000 902f5800
df40: 00000000 90017120 90091472 91d2dfec 91d2c000 902f5800 00000000 00000000
df60: 90017adc 900913bc 902f5800 0074b7db 0074b7dc 0074b7dd 0074b7de 0074b7df
df80: 0074b7e0 0074b7e1 0074b7e2 0074b7e3 0074b7e4 0074b7e5 0074b7e6 0074b7e7
dfa0: 0074b7e8 9000e166 903fbaa4 90112dbe 902198c0 ffffffe8 00400000 90011478
dfc0: 90011478 91d2e000 00000000 00000000 00000000 00000000 00000000 00000000
dfe0: 00000000 00000000 00000000 90017adc 00000000 00000000 00000000 00000000

~ #

My question is: is that the right procedure/order to do this in? That is:

    S90reboot
    flash_eraseall (as hce stated)
    reboot
    reflash with new image

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

Even after following many tips listed inside this thread, I had the message "Warning: unable to open an initial console" when I booted my NGW100 system. This message is printed out by kernel, when it tries do open console, just before invoking init. Investigating build scripts and sd-image-reference, I couldn't find any console device inside dev dir (ttySn or console). Thus, I created it inside sd-image-reference and finally NGW100 booted using my new rootfs (just kernel, busybox and dropbear). Very pleasant experience !

Since nobody said anything related to this I would like to leave this warning related to device files. If I am wrong and misunderstood something, please correct me (note: I am using the original NGW100 CD).
BTW, I generated jffs2 image adding this line to the build script:

mkfs.jffs2 --output=$ROOT.jffs2.img --root=$ROOT \
     --pagesize=4096 --eraseblock=65536 --big-endian

and uploaded it using tftp:

protect off 0x20000 0x7effff
erase 0x20000 0x7effff
setenv ipaddr 
setenv tftpip 
tftp. 0x90000000 
cp.b 0x90000000 0x20000 
protect on all
boot

..:: I see boring people ::..

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

Also ... no one says anything concerning the size of the resulting image files,
created by the j2fsimage. The "disk" size is set to be 117mB (120000 kb).
It is not so important, when used mkfs.jffs2 for creating the images.
When I have created the kernel NGW_jffs2_root.img) it's size is acceptable,
even it is not the same as as Atmel's ones.
Created with some patches as GPIO and atngw_defconfig (replaced in two places in the main build script).
I have cretaed the usr part too (no modification, except --without-ada in ncurses and blocked PONG ).
But ... the image size is very big - about 17 mB.
I have deleted a lot of big files in usr/bin ... all of them greater thatn 1.2 mb. I have started the NGW100 and looked at the usr/bin. Thus I found what to delete and what to keep :)
The size becames acceptable ...

Probably it is time to flash the serial flash :)

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

Hi Jethro,

yes, I saw this as well when I was trying to use my humble 64MB SDCard :oops:
Afterwards, I changed to jffs2. Is it possible to use ramfs (cpio image) ?

..:: I see boring people ::..

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

Hello all !
Marcell, I really don't know ramfs.
I have decided to add myself into the forum, since
I lost a lot of time with this shit ;(
First I lost a week to create kernel under CugWin - not succes, because the C compiler says a lot of nosences concerning the cast the pointers e.t.c.
A installed (txt mode only) the suse 10.2 on virtual machine (Microsoft Virtual PC 2007), then load some utilities as mtd-utils e.t.c. Since I have a ftp server started in my home ... all of the file transfers I do via the FTP. Virtual PC cannot share the dirs, if the guest OS is not Windows (MS shit) ... :)
But the VirtualPC works fine :):)

I have a questions concerning the ngw kernel ...
Why we have uImage, which is enough (or not) ?
If we use uImage, why we need a boot_jffs2.img file ?
If we use boot_jffs2.img, why we need uImage, since the boot_jffs2.img already contains the uImage file ?
And as I saw the same uImage exists also in the user part compiled result ?!?!?

Thanks all in advance !
:)

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

Jethro wrote:
I have a questions concerning the ngw kernel ...
Why we have uImage, which is enough (or not) ?
If we use uImage, why we need a boot_jffs2.img file ?
If we use boot_jffs2.img, why we need uImage, since the boot_jffs2.img already contains the uImage file ?
And as I saw the same uImage exists also in the user part compiled result ?!?!?
uImage is the kernel binary. It's just a regular binary like all the ones you would find in /usr/bin except it's the one the bootloader executes to start Linux.

The boot_img file is an image which contains _everything_ needed to boot. This is much more than just a kernel image. It is the root filesystem and everything that is contained therein.

I don't know why uImage would be placed in /usr, I can't see any reason why it should be except backup should you muller something.

-S.

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

Jethro,

FYI:

/dev/mtd0 : u-boot (128k)
/dev/mtd1: kernel + root file system [/] (8000k)
/dev/mtd2: u-boot parameters (64k)
/dev/mtd3: additional usr programs, mounted at startup [/usr] (8MB)

Marcelo

..:: I see boring people ::..

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

Thanks to all !
Now is clean :)

Jethro