LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   uboot a mostly unknow device with onwn kernel + rootfs , possible? (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/uboot-a-mostly-unknow-device-with-onwn-kernel-rootfs-possible-4175498595/)

a4z 03-18-2014 06:42 AM

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

theNbomr 03-19-2014 09:05 AM

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.

a4z 03-20-2014 05:43 AM

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

Shadow_7 03-20-2014 06:07 AM

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.

a4z 03-20-2014 07:01 AM

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

theNbomr 03-20-2014 09:10 AM

Quote:

Originally Posted by a4z (Post 5137963)
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.

a4z 03-20-2014 10:20 AM

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

Shadow_7 03-20-2014 12:33 PM

Quote:

Originally Posted by a4z (Post 5137995)
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.

theNbomr 03-20-2014 01:21 PM

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?

Shadow_7 03-20-2014 04:57 PM

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.

a4z 03-21-2014 06:33 AM

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.

Shadow_7 03-21-2014 10:11 PM

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.


All times are GMT -5. The time now is 05:35 AM.