View unanswered posts | View active topics It is currently Sun Nov 19, 2017 6:31 am



Reply to topic  [ 8 posts ] 
 Booting from SDcard (almost) 
Author Message

Joined: Sun Apr 10, 2011 5:23 am
Posts: 32
Post Booting from SDcard (almost)
So, I'm able to boot from SD card, although I seem to be forgetting something basic, because although I can get to a login prompt, at that point, my serial console refuses to accept input.

But it's a start :)

I seem to be having some issues with my sdcard, so this is how I went about it:
Power on the TrimSlice with the serial console up and running per instructions included with the dev-kit.
Watching the console, wait for it to say it's loading boot/uImage, and then slide the SD card in to the slot. Wait for it to boot, and then login as the user, also provided on the instructions.

You should see the sdcard. Ubuntu (LTS) automatically mounts it, I unmounted it, and then ran fdisk and made 1 partition (it's also an 8GB card);
Code:
sudo su -
fdisk /dev/mmcblk3
n
p
1
<default>
<default>
w


format the partition as ext3;
Code:
mkfs.ext3 -i 4096 /dev/mmcblk3p1

mount /dev/mmcblk3p1 /mnt/

cd /mnt/


Download armv7a stage3ball from your favorite mirror.

Code:
tar -jxpf stage3*


Code:
mount -o bind /dev /mnt/dev
mount -t proc proc /mnt/proc
cp -L /etc/resolv.conf /mnt/etc/
chroot /mnt/ /bin/bash
env-update && source /etc/profile
cp -L /usr/share/zoneinfo/<yourtimezone> /etc/localtime

Code:
date
(make sure it is set correctly)
Code:
emerge --sync

<optional>
Code:
nano -w /etc/make.conf
MAKEOPTS="-j5"

</optional>
Code:
emerge u-boot-tools

(I had a prior checkout of the kernel so I copied that on to the sdcard before chrooting)
Quote:
cd /usr/src/linux
make trimslice_config
make menuconfig (make any changes)
make -j5

<wait ~32 minutes> (it's a class 10 sd card)
Code:
make uImage
make modules_install
cp arch/arm/boot/uImage /boot/

(at this point I copied the boot.scr from a different terminal on to the sdcard)
<DIFFERENT TERMINAL>
Code:
sudo cp /boot/boot.scr /mnt/boot/boot.scr
sudo cp /boot.scr /mnt/boot.scr

(I believe these are redundant and you'll only ever need 1, if you have a separate /boot, then it should be there; iirc, u-boot does ext2load, so /boot should be ext2 or ext3)
I then modified it, since we're going to be booting from the sdcard for the forseeable future.
<in chroot>
Code:
cp /boot.scr /boot.script
nano -w /boot.script

<change /dev/sda1 to /dev/mmcblk3p1 (or whatever your root partition is)>
Code:
mkimage -A arm -T script -C none -d /boot.script /boot.scr
mkimage -A arm -T script -C none -d /boot.script /boot/boot.scr
nano -w /etc/fstab

<make changes so your file system(s) show up>
Code:
nano -w /etc/inittab

<change s0's line from 9600 to 115200>
Code:
nano -w /etc/hosts

<add your host name>
Code:
nano -w /etc/conf.d/hostname

Code:
emerge dhcpcd
(or your dhcp client of choice)
emerge system logger, crontab, wpa_supplicant, or whatever, I like to do sshd, but sadly, I haven't yet, I'm sure if I did, I could ssh in
Code:
passwd

<set the password for the root user>
Code:
exit
umount /mnt/{sys,dev,proc,boot,}

<cross fingers, and reboot>

Now, in another thread, it was mentioned that you're supposed to hold down the button next to the microsd card slot to boot. I've found that I don't actually need to, as long as the sdcard is in before it gets powered on.

At this point, it boots, successfully, but as mentioned, I can't login via serial console. Also don't have video out yet, I'm assuming that I unchecked a video option somewhere. I'm probably going to look into the mainline kernel soon, or at least, the latest RC of 2.6.39 since it should have trimslice support.


Sat Apr 16, 2011 10:38 am
Profile

Joined: Sun Apr 10, 2011 5:23 am
Posts: 32
Post Re: Booting from SDcard (almost)
In looking closer, it looks like I jumped the gun on the kernel and forgot to switch to the dev-kit branch :/ Will be doing a new kernel later :D


Sat Apr 16, 2011 10:52 am
Profile
Site Admin

Joined: Sun Mar 13, 2011 11:52 am
Posts: 390
Post Re: Booting from SDcard (almost)
Just to clarify:
the recovery procedure described in the quote below is only relevant if the boot headers / u-boot in the on-board SPI flash got corrupted or erased.

In case you need to boot the kernel / file-system from an SD card, you do not need the procedure - you should just boot regularly and use u-boot command set to load the images from the SD card into RAM.

Quote:
(1) SW2 button switches the Trim-Slice boot sequence in order to allow full firmware recovery. Holding SW2 during reset or power cycling will force the Tegra to boot from the front SD socket (instead of the default boot from on-board SPI flash). The SD card included with the Dev-Kit is pre-flashed with the required boot firmware and u-boot.

_________________
---------------------------
Igor Vaisbein
Utilite Product Manager

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


Sat Apr 16, 2011 12:42 pm
Profile

Joined: Sun Apr 10, 2011 5:23 am
Posts: 32
Post Re: Booting from SDcard (almost)
Hi Igor,

Thanks for the reply... I think I may have the boot.scr file wrong. If booting from an SD card, should I still be doing usbstart 1 as the first command?


Tue Apr 19, 2011 3:07 am
Profile
Site Admin

Joined: Sun Mar 13, 2011 11:52 am
Posts: 390
Post Re: Booting from SDcard (almost)
Usb start should not be required for SD boot.

_________________
---------------------------
Igor Vaisbein
Utilite Product Manager

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


Tue Apr 19, 2011 9:17 am
Profile

Joined: Sun Apr 10, 2011 5:23 am
Posts: 32
Post Re: Booting from SDcard (almost)
You were right, I went over the boot.scr too quickly. My new boot.scr(s) are as follows:

(boot.script; this one is used with the kernel from gitorious)

Code:
setenv bootargs root=/dev/mmcblk3p1 rw rootwait console=tty1 console=ttyS0,115200n8 mem=448M@0M mem=512M@512M nvmem=64M@448M vmalloc=320M nohdparm
ext2load mmc 0:1 4080000 /boot/uImage
bootm 4080000

(boot.script-2.6.39-rc4; this one is used with the mainline kernel)

Code:
setenv bootargs root=/dev/mmcblk0p1 rw rootwait console=tty1 console=ttyS0,115200n8 mem=448M@0M mem=512M@512M nvmem=64M@448M vmalloc=320M nohdparm video=tegrafb
ext2load mmc 0:1 4080000 /boot/uImage-2.6.39-rc4
bootm 4080000


Wed Apr 20, 2011 10:27 am
Profile

Joined: Sun Mar 13, 2011 8:48 pm
Posts: 1
Post Re: Booting from SDcard (almost)
Hi,

Thanks for all the detailed instructions which worked great.
At first I just copied the kernel from the root fs that came with the device and used that
with the Gento filesystem.

I needed to build my own kernel in the end, as I wanted the some modules for USB hardware I'm using.

Code:
git clone git://gitorious.org/trimslice-kernel/trimslice-kernel.git
git checkout -b dev-kit --track origin/trimslice/dev-kit
make trimslice_embedded_world_defconfig
make menuconfig
make uImage


I built the kernel on the trimslice itself after finding that the one I built with the linaro cross toolchain didn't want to work.

I also found that the first boot on the new kernel might fail, but after a full power down it worked.
I also found that typing 'run mmcboot' in the uBoot prompt might work when just waiting for an auto boot failed and reverted to a usbboot (from the SSD)

I now have the modules I want (for USB serial adapter) and have an alternative boot device in case I screw up the SSD, so thanks for your post as it was exactly what I needed in getting to grips with stuff.

Johnno


Sat Apr 23, 2011 1:38 pm
Profile

Joined: Wed May 25, 2011 11:05 am
Posts: 521
Post Re: Booting from SDcard (almost)
I'm having a go at this, running into early problems

git clone git://gitorious.org/trimslice-kernel/tr ... kernel.git
That was fine, done it already

git checkout -b dev-kit --track origin/trimslice/dev-kit
fatal: Not a git repository (or any of the parent directories): .git

So how do I get the .config file?
make trimslice_embedded_world_defconfig
That must be with dev-kit?

Also, should you have make (would make -j3 make sense?), and make modules_install

Dave


Thu Jun 02, 2011 1:45 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


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
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.