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 )