LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 03-18-2014, 06:42 AM   #1
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,395

Rep: Reputation: 597Reputation: 597Reputation: 597Reputation: 597Reputation: 597Reputation: 597
uboot a mostly unknow device with onwn kernel + rootfs , possible?


I have a small board on my table and the only thing I know is the processor, freescale iMX28

I can ()u)boot the device and have the debug console, so a serial connetion is available, also ethernet works.
(I have setup a tftp server and can run tftpboot what will download a kernel)

is it possible to boot this device with my own kernel + rootfs ?
for example to use with the freescale iMX28 SDK

ps: being a developer my general knowledge about setup a SoC is rather low, so if I have to explain something special please tell me
 
Old 03-19-2014, 09:05 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
It is probable that you can boot Linux, however, if you want all of the peripherals on the SoC to be functional, you will have to know what they are and build the accordant drivers. Maybe post a picture of the device and someone will be able to identify it and suggest a source for a working kernel + drivers. uBoot is commonly used to boot Linux, so I would speculate that a working kernel does exist. If you can identify the vendor, it seems quite possible that there is a supported kernel available from the vendor.
 
Old 03-20-2014, 05:43 AM   #3
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,395

Original Poster
Rep: Reputation: 597Reputation: 597Reputation: 597Reputation: 597Reputation: 597Reputation: 597
full working peripherials are not important at the moment
It would be enough to boot a custom kernel and have a shell

I tftp load my kernel, build via ltib and the iMX SDK source
but nothing is booting,
it looks like this
Code:
tftpboot
Using FEC0 device
TFTP from server 192.168.0.1; our IP address is 192.168.0.2
Filename 'uImage'.
Load address: 0x42000000
Loading: #################################################################
         #################################################################
         ############################################
done
Bytes transferred = 2551128 (26ed58 hex)
RI-ETU U-Boot > bootm 0x42000000
## Booting kernel from Legacy Image at 42000000 ...
   Image Name:   Linux-2.6.35.3-571-gcca29a0
   Created:      2014-03-20  10:10:58 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2551064 Bytes = 2.4 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
and than it stops and does nothing.

so I assume that I do something wrong... but what
 
Old 03-20-2014, 06:07 AM   #4
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,166
Blog Entries: 1

Rep: Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674
http://www.freescale.com/webapp/sps/...de=MCIMX28EVKJ

uboot is what arm devices use to boot linux images. You should probably start with a supplied image for the device to know how it works first. Copy the /boot/config and other device specific things as a base.

http://cache.freescale.com/files/32b...geType=product

Page 9 with bootmode select info might be useful.
 
Old 03-20-2014, 07:01 AM   #5
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,395

Original Poster
Rep: Reputation: 597Reputation: 597Reputation: 597Reputation: 597Reputation: 597Reputation: 597
I have used the SDK for the iMX28 to build the kernel,
I do not know how to copy /boot/config without destroying (overwriting) the existing nand.
so I thought I could load the kernel I have built via network and test it.
I have a nfs setup, but this seems to be total wrong
 
Old 03-20-2014, 09:10 AM   #6
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
Originally Posted by a4z View Post
full working peripherials are not important at the moment


...it stops and does nothing.

so I assume that I do something wrong... but what
Not so fast.

What does the kernel you've loaded use as a console? If there is no built-in driver for whatever the console device is, then you won't see anything. Even if the driver is there, the default configuration may be to use a device you've not hooked up. I assume you're looking at a serial port to see the uboot console. You may have to use uboot to specify the correct console parameters; device name and possibly configuration parameters like baud, parity etc if it's a serial console. That's why you need to know some things about the hardware and the peripherals included.

Do you have a root filesystem to boot? The kernel may actually be running, trying to find it's root filesystem. Is there a built-in initramfs/initrd? I don't see anything in your uboot commands to specify a root filesystem or init process.

Last edited by theNbomr; 03-20-2014 at 10:43 AM.
 
Old 03-20-2014, 10:20 AM   #7
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,395

Original Poster
Rep: Reputation: 597Reputation: 597Reputation: 597Reputation: 597Reputation: 597Reputation: 597
well, there was a rootfs in the nand, but I destroyed it with uploading a new one :-(
Code:
ubifsmount rootfs
UBIFS error (pid 0): ubifs_read_node: bad node type (0 but expected 6)
UBIFS error (pid 0): ubifs_read_node: bad node at LEB 0:0
Error reading superblock on volume 'ubi:rootfs'!
console=ttyAMA0 and baudrate=115200 are setup in the uboot environment (variables)

--
just found the kernel config and a device tree file for the device
I have to update the kernel to an other version and see if this works
 
Old 03-20-2014, 12:33 PM   #8
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,166
Blog Entries: 1

Rep: Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674
Quote:
Originally Posted by a4z View Post
I do not know how to copy /boot/config without destroying (overwriting) the existing nand.
If the device is network capable and you have other hardware you can use netcat to send a file.

$ nc -v -l -p 31337 > file.ext
(on the receiving end)

$ nc -n <ip of destination> <port> < input_file
(on the sending end)

nc doesn't know when the transfer is complete and keeps listening until the listening end is stopped. And various other methods via ftp or other options available on most linux's by default. As long as the firewalls don't block it. Or as long as both devices have displays you can cat | less the file and manually duplicate it. Various means to an end. USB sticks and other options. All of which implies an already working linux.
 
Old 03-20-2014, 01:21 PM   #9
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Shadow_7, I think I'm missing the point of doing that. Are you suggesting that netcat can somehow be embedded in or run from uboot? If not, then why would one choose to use netcat for file transfer, as opposed to any other dedicated file transfer mechanisms (sftp, scp, even ftp, or tftp)? If availability is the question, and if a working network and stack exists, then surely at least one of those or something similar would also be present. What's to say netcat would be available in the absence of a 'real' file transfer protocol implementation?
 
Old 03-20-2014, 04:57 PM   #10
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,166
Blog Entries: 1

Rep: Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674
For one offs it's a lot simpler than installing and configuring an ftp or sftp server. In your case that device has like 64MB of RAM, which isn't a lot of wiggle room for servers and the likes. It's just one option of many and offers a fairly consistent option across multiple platforms.
 
Old 03-21-2014, 06:33 AM   #11
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,395

Original Poster
Rep: Reputation: 597Reputation: 597Reputation: 597Reputation: 597Reputation: 597Reputation: 597
my uboot here has no netcat,
I can load files via tftp and nfs to ram, and write to nand,
(what I did with the rootfs (ubi image) and what ended bad :-( ->kaputt)
now I would like to restore the thing somehow. as said, I have the kernel config and the device tree file at the moment.

Last edited by a4z; 03-21-2014 at 06:34 AM. Reason: typo sad -> said
 
Old 03-21-2014, 10:11 PM   #12
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,166
Blog Entries: 1

Rep: Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674Reputation: 674
There should be an "image" that you can put onto the nand which is a flavor of linux. That flavor should have the nc and config and other things that you need to do useful things. uboot is like grub for arm. But I'm not familiar with it and don't know if it does much if anything more than boot what is on the nand and only on the nand. With maybe some tools to make the nand NOT blank. It's a devkit so you'd think that it'd be semi-brick proof.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to port applications in to rootfs.ext2.gz.uboot Mallem kondaiah Linux - Embedded & Single-board computer 1 05-27-2013 05:48 PM
qemu - run Linux from Scracth gives a cannot mount rootfs hda - unkown device MarcosPauloBR Linux - Virtualization and Cloud 3 10-17-2011 08:47 AM
Uboot and Kernel code similarity priyadarshan Linux - Software 1 01-04-2011 01:02 PM
kernel panic...... unknow block mrlucio79 Red Hat 6 09-02-2004 08:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 11:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration