Sign in

username:

password:



Not a member?

Search AT91SAM



Search tips

Subscribe to AT91SAM



Sponsor

controlSUITE™ software
Comprehensive.
Intuitive.
Optimized.

Real-world software for real-time control. Details Here!

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | AT91SAM ARM | Buildroot u-boot on an AT91SAM9261EK with SAM-BA?

For users of the Atmel AT91SAM7 and AT91SAM9 ARM CPU chips. Atmel has taken a new direction by combining on chip flash and ram with the ARM CPU on a single die. This provides low cost devices for small systems using the ARM CPU. This group is to exchange information to help users get started and learn how to use the devices.

Buildroot u-boot on an AT91SAM9261EK with SAM-BA? - Dan Lyke - Jan 17 17:04:23 2009

Hoping for an over-the-weekend answer:

I've been using the u-boot that comes with the Angstrom demo build, with
the TCL script that came with it. I need to put my own u-boot on the
device, but all of the other u-boots I find, including the ones I build
myself, seem to be looking for the u-boot environment somewhere other
than where the Angstrom TCL script puts it.

When I try to boot I'm getting:

*** Warning - bad CRC, using default environment

Anyone got a TCL script that puts a plain u-boot build in the right
place, or can tell me what I'm doing wrong?

Thanks.

Dan

------------------------------------



(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )


RE: Buildroot u-boot on an AT91SAM9261EK with SAM-BA? - Microbit_P43000 - Jan 18 3:58:21 2009

Hi Dan,

I don't know what the Angstrom script looks like, but the Atmel standard TCL
that came with my Olimex SAM9-L9260 looks like this, attached below :
(I've deleted the standard Atmel legal waffle for clarity - Oops, just
noticed the disclaimer states the notice must be included, so I'm adding it
in at the end, doesn't say it needs to be at the start :-)

Note that the same script works fine on Linux (with the CDC version of
SAM-BA), except that - for now - I have to use absolute paths to 'home ' for
the files.
This is until I've figured out the shell's env variables for the script
better.
SAM-BA doesn't like it with ~ referenced paths for some reason. (with
Ubuntu)

Probably a long shot, but perhaps this will help you. If I understood your
question right, you can define the addresses yourself in the script ?

############################################################################
####
# proc uboot_env: Convert u-boot variables in a string ready to be flashed
# in the region reserved for environment variables
############################################################################
####
proc set_uboot_env {nameOfLstOfVar} {
upvar $nameOfLstOfVar lstOfVar

# sector size is the size defined in u-boot CFG_ENV_SIZE
set sectorSize [expr 0x4200 - 4]

set strEnv [join $lstOfVar "\0"]
while {[string length $strEnv] < $sectorSize} {
append strEnv "\0"
}
set strCrc [binary format i [::vfs::crc $strEnv]]
return "$strCrc$strEnv"
}

############################################################################
####
# Main script: Load the linux demo in DataFlash,
# Update the environment variables
############################################################################
####
set bootstrapFile "at91sam9260-dataflashboot-2.3.bin"
set ubootFile "u-boot.bin"
set kernelFile "uImage"
set rootfsFile "sam9-l9260-rootfs.jffs2"

set ubootEnvFile "ubootEnvtFileDataFlash.bin"

## DataFlash Mapping
set baseAddr 0xD0000000
set bootStrapAddr 0x00000000
set ubootAddr 0x00008400
set ubootEnvAddr 0x00004200
set kernelAddr 0x00040000

# u-boot variable
set kernelUbootAddr [format "0x%08X" [expr $baseAddr + $kernelAddr]]
set kernelLoadAddr 0x22200000
## NandFlash Mapping
set rootfsAddr 0x00400000
set kernelSize [format "0x%08X" [file size $kernelFile]]

# "ethaddr=3a:1f:34:08:54:54"
lappend u_boot_variables \
"bootdelay=3" \
"baudrate=115200" \
"stdin=serial" \
"stdout=serial" \
"stderr=serial" \
"bootargs=mem=64M console=ttyS0,115200 root=/dev/mtdblock1 rw
rootfstype=jffs2" \
"bootcmd=cp.b $kernelUbootAddr $kernelLoadAddr $kernelSize; bootm
$kernelLoadAddr"

puts "-I- === Initialize the DataFlash access ==="
DATAFLASH::SelectDataflash AT91C_SPI0_CS1

puts "-I- === Erase all the DataFlash blocs and test the erasing ==="
DATAFLASH::EraseAllDataFlash

puts "-I- === Load the bootstrap in the first sector ==="
DATAFLASH::SendBootFile $bootstrapFile

puts "-I- === Load the u-boot in the next sectors ==="
send_file {DataFlash AT45DB/DCB} "$ubootFile" $ubootAddr 0

puts "-I- === Load the u-boot environment variables ==="
set fh [open "$ubootEnvFile" w]
fconfigure $fh -translation binary
puts -nonewline $fh [set_uboot_env u_boot_variables]
close $fh
send_file {DataFlash AT45DB/DCB} "$ubootEnvFile" $ubootEnvAddr 0

puts "-I- === Load the Kernel image ==="
send_file {DataFlash AT45DB/DCB} "$kernelFile" $kernelAddr 0

puts "-I- === Initialize the NAND access ==="
NANDFLASH::Init

puts "-I- === Erase all the NAND flash blocs and test the erasing ==="
NANDFLASH::EraseAllNandFlash

puts "-I- === Load the linux file system ==="
send_file {NandFlash} "$rootfsFile" $rootfsAddr 0
#
----------------------------------------------------------------------------
# ATMEL Microcontroller Software Support
#
----------------------------------------------------------------------------
# Copyright (c) 2008, Atmel Corporation
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the disclaimer below.
#
# Atmel's name may not be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
# DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE,
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
----------------------------------------------------------------------------
Best Regards,
Kris

-----Original Message-----
From: A...@yahoogroups.com [mailto:A...@yahoogroups.com] On Behalf Of
Dan Lyke
Sent: Sunday, 18 January 2009 9:04 AM
To: A...@yahoogroups.com
Subject: [AT91SAM] Buildroot u-boot on an AT91SAM9261EK with SAM-BA?

Hoping for an over-the-weekend answer:

I've been using the u-boot that comes with the Angstrom demo build, with
the TCL script that came with it. I need to put my own u-boot on the
device, but all of the other u-boots I find, including the ones I build
myself, seem to be looking for the u-boot environment somewhere other
than where the Angstrom TCL script puts it.

When I try to boot I'm getting:

*** Warning - bad CRC, using default environment

Anyone got a TCL script that puts a plain u-boot build in the right
place, or can tell me what I'm doing wrong?

Thanks.

Dan

------------------------------------



(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )

Re: Buildroot u-boot on an AT91SAM9261EK with SAM-BA? - scsibob - Jan 19 14:39:38 2009

Have you tried executing the u-boot command "saveenv"? On my
Freescale PPC platform, the environment variables get stored in Flash
memory, but they don't get put there automatically. When they aren't
found, u-boot uses defaults that are built into the firmware image.
The saveenv command will put them out where they belong. (at least on
my platform)
Bob D.

--- In A...@yahoogroups.com, Dan Lyke wrote:
>
> Hoping for an over-the-weekend answer:
>
> I've been using the u-boot that comes with the Angstrom demo build, with
> the TCL script that came with it. I need to put my own u-boot on the
> device, but all of the other u-boots I find, including the ones I build
> myself, seem to be looking for the u-boot environment somewhere other
> than where the Angstrom TCL script puts it.
>
> When I try to boot I'm getting:
>
> *** Warning - bad CRC, using default environment
>
> Anyone got a TCL script that puts a plain u-boot build in the right
> place, or can tell me what I'm doing wrong?
>
> Thanks.
>
> Dan
>

------------------------------------



(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )

Re: Re: Buildroot u-boot on an AT91SAM9261EK with SAM-BA? - Dan Lyke - Jan 19 15:05:21 2009

On Mon, 19 Jan 2009 19:39:30 -0000
"scsibob" wrote:
> Have you tried executing the u-boot command "saveenv"? On my
> Freescale PPC platform, the environment variables get stored in Flash
> memory, but they don't get put there automatically.

So my TCL file isn't loading the u-boot environment correctly. When I
try to type in the boot commands manually, I'm getting

## Booting image at 22200000 ...
Image Name: Linux-2.6.27.7
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1378796 Bytes = 1.3 MB
Load Address: 20008000
Entry Point: 20008000
Verifying Checksum ... Bad Data CRC

Exact same kernel image that was working with the binaries that came
with the Angstrom demo. In fact I can just load the new u-boot and this
happens. All the locations are the same.

So I can build a kernel with buildroot that loads fine with the
Angstrom u-boot, and I can build a u-boot that does what I need, but
can't understand my kernel.

Anyone got a command line that builds a kernel appropriately, either on
Linux or Windows with GNUARM or Yagarto (or whatever else I can
download), that works with their u-boot?

Dan

------------------------------------

______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )