Tiny Core Linux

dCore Import Debian Packages to Mountable SCE extensions => dCore Armv7 => Allwinner A10 => Topic started by: Redhair on March 24, 2013, 12:42:59 PM

Title: Cubieboard Install
Post by: Redhair on March 24, 2013, 12:42:59 PM
Hi, I've just received a Cubieboard (1GB) and want to install Tiny Core to a microSD card (1GB) but I guess I need a step-by-step guide for dummies. I was not able to find one. So, this is what I've tried so far:

1) downloaded a10Core.img.gz from tinycore dot net/4.x/armv7/ and extracted
2) downloaded sunxi-spl.bin and u-boot.bin from /4.x/armv7/hardware/Cubieboard/
3) downloaded cubieboard_script.bin from /4.x/armv7/hardware/script.bin/
4) dd if=a10Core-20130226.img of=/dev/sdb bs=1M
9+0 Datensätze ein
9+0 Datensätze aus
9437184 Bytes (9,4 MB) kopiert, 2,90576 s, 3,2 MB/s

5) dd if=sunxi-spl.bin of=/dev/sdb bs=1024 seek=8
20+1 Datensätze ein
20+1 Datensätze aus
20992 Bytes (21 kB) kopiert, 0,118392 s, 177 kB/s

6) dd if=u-boot.bin of=/dev/sdb bs=1024 seek=32
247+1 Datensätze ein
247+1 Datensätze aus
253296 Bytes (253 kB) kopiert, 0,34416 s, 736 kB/s

7) cp cubieboard_script.bin /media/B7E5-8B09/script.bin
sync

...but I get nothing but a black screen. Did I miss something or what I am doing wrong? Any hint is much appreciated!
Title: Re: Cubieboard Install
Post by: hlavery on March 24, 2013, 02:45:38 PM
Hello,  your steps and reported file transfer sizes appear to be correct.  I suspect that your SD card is the problem.  I have several small and/or old cards which will not boot TC (on my A10 Hackberry board...and some will not boot any version of Linux).  Best results with Class 10 cards, although some Class 6 will work.  Other users have had issues with microSD adapters making corrupted copies, so check md5sums.  The cards are a headache, although eventually you will get a workable set.
Title: Re: Cubieboard Install
Post by: Rich on March 24, 2013, 06:15:04 PM
Hi Redhair
I think you overwrote part of  a10Core-20130226.img  with  sunxi-spl.bin.
Step 4 shows you wrote 9Meg bytes, step 5 shows you skipping 8 blocks which default to a size if 512 bytes or 4K total.
From the man page:
Code: [Select]
obs=BYTES
write BYTES bytes at a time (default: 512)
seek=BLOCKS
skip BLOCKS obs-sized blocks at start of output
BLOCKS and BYTES may be followed by the following multiplicative suffixes: c =1, w =2, b =512, kB =1000, K =1024, MB =1000*1000, M =1024*1024, xM =M GB =1000*1000*1000, G =1024*1024*1024, and so on for T, P, E, Z, Y.
I think in step 5 skip should be set equal to  9437184 / 512  or  18432b  and step 6 should add  20992 / 512  or  41b  to
that number.
Code: [Select]
dd if=a10Core-20130226.img of=/dev/sdb bs=1M
dd if=sunxi-spl.bin of=/dev/sdb bs=1024 seek=18432b
dd if=u-boot.bin of=/dev/sdb bs=1024 seek=18473b
cp cubieboard_script.bin /media/B7E5-8B09/script.bin
Title: Re: Cubieboard Install
Post by: hlavery on March 24, 2013, 07:04:39 PM
Actually, the over-writing of part of the process is on purpose here, since the TC Mele u-boot.bin and sunxi-spl.bin are being replaced by those of the target device (cubieboard).  Appending them to the end of the image won't give the intended result, since the original boot details will still be read and probably fail.
Title: Re: Cubieboard Install
Post by: Rich on March 24, 2013, 07:14:53 PM
Hi hlavery
In that case, I stand corrected. Thanks for setting me straight.
Title: Re: Cubieboard Install
Post by: Redhair on March 24, 2013, 10:00:04 PM
Thanks for your help! I've ordered a new card...
Title: Re: Cubieboard Install
Post by: roberts on March 25, 2013, 08:47:40 PM
Before writing the image to sdcard, often I will zero out the beginning of a card. Sometimes it has helped with troublesome cards.
dd if=/dev/zero of=/dev/sdX bs=1M count=50
Title: Re: Cubieboard Install
Post by: Redhair on March 28, 2013, 03:33:51 PM
Before writing the image to sdcard, often I will zero out the beginning of a card. Sometimes it has helped with troublesome cards.
dd if=/dev/zero of=/dev/sdX bs=1M count=50
I've tried this with the same old card and it's working, thanks a lot!
Title: Re: Cubieboard Install
Post by: Barmallini on May 21, 2013, 08:56:23 AM
I have problem with Cubie and TC.
Cloned a10Core-20130510.img to SDHC (4Gb) via DD. All fine. Cubie loaded, but no prompt.
Tryed different USB-VCP cables, nothing. Commands sended (ls, cd and so on), but no echo and nothing happens.
Default firmware work fine. After loading i have command prompt like ordinary Linux.

Any idea?

Changed tty0 to ttyS0 - does not help.
This uEnv from original Tom's distro (console working fine):
extraargs=console=ttyS0,115200 console=tty0 disp.screen0_output_mode=1280x720p60 hdmi.audio=EDID:0 mmc0_led=1 mac_addr=ca:28:f0:49:3e:7d rootfstype=ext4 bootdelay=1

Top USB does not work too in TC. I put USB flash to bottom USB - its detected, put it to top - nothing happens. Tom's distro detects both USB sockets (first time i thinked cubie is broken).

P.S. Log (CRC error):

U-Boot SPL 2013.01 (Feb 08 2013 - 13:16:49)
Board: Cubieboard
DRAM: 1024MB
SUNXI SD/MMC: 0


U-Boot 2013.01 (Feb 08 2013 - 13:16:49) Allwinner Technology

CPU:   SUNXI Family
Board: Cubieboard
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   wemac
Title: Re: Cubieboard Install
Post by: roberts on May 23, 2013, 07:56:57 AM
Don't have the debug board or comm port (virtual or otherwise) to test serial output. Works with hdmi
Title: Re: Cubieboard Install
Post by: athouston on June 17, 2013, 11:24:51 PM
I had the same problem (on a MK802) until I used Gparted to set the partition bootable.
Title: Re: Cubieboard Install
Post by: beerstein on August 24, 2013, 09:53:34 AM
I just received a cubieboard A20
Question:
Can I use the A10 version with this A20 cubiebard?
Title: Re: Cubieboard Install
Post by: roberts on August 24, 2013, 10:03:18 AM
From what I have heard it is supposed to be code compatible.
Try it. If not...

Likely would need new kernel with squashfs and initrd support.
Check kernel that ships with Cubieboard.
Likely would need new or updated u-boot and friends (uEnv.txt, boot.scr, script.bin) as well.
 
Title: Re: Cubieboard Install
Post by: yesbdb on August 25, 2013, 08:15:51 AM
I always like TC, because TC has given me the freedom to build a linux system fits the way I like. I have tried using other Linux distributions, but in the end I always get back with TC.

Hi roberts,

The same here, I received my cubieboard2 (A20) yesterday.

Just wonder, will TC have a plan to develop an Army cord for the Allwinner A20 (Cubieboard2) in the near future?   

Thanks!
Title: Re: Cubieboard Install
Post by: roberts on August 25, 2013, 09:48:12 PM
I personally do not have such a device nor do I plan, nor can I afford, so many arm devices.
There are so many arm devices and they all vary so much. No standards as with x86.

Of course, I will try to be as helpful as possible for anyone who wishes to pursue this, but without actually having the hardware, it will be very difficult.

I was loaned a gk802 so that is how that came to be. So that is always a possibility.

It does seems that there is not that much interest in arm, as I am aware of only a couple of arm Core users. I could be wrong. But this is what I see.

Still I have had an interest and that is why I have continued. I personally use an arm machine for both armv7 development and daily use. I like the concept of tiny hardware with tinycore.
Title: Re: Cubieboard Install
Post by: Peter Pudney on January 12, 2014, 03:32:51 PM
UPDATE: I have now got TC5 to boot to the command prompt on a Cubieboard 2; see the updated instructions in Reply #19.

I am trying to install TC5 (http://distro.ibiblio.org/tinycorelinux/5.x/armv7/Allwinner-A10/) on a CubieBoard 2 (A20) SD card. The kernel is starting, but stalls after the message:

  <6>Calibrating delay loop...

I am writing my SD card from a Mac. The steps were:


I have attached a file of boot messages.

What should I try next?
Title: Re: Cubieboard Install
Post by: beerstein on January 15, 2014, 05:32:57 AM
Hi: I have cubietruck. Are you sure that the media needs to unmounted when you run the dd command?
Title: Re: Cubieboard Install
Post by: Peter Pudney on January 15, 2014, 02:05:20 PM
The SD card does have to be unmounted when you use the dd commands, otherwise you get (on a Mac):

    dd: /dev/disk1: Resource busy


On a Mac, the SD card will automatically remount after each dd command, and so you have to unmount it before each dd command. You can do this from Disk Utility by control-clicking on the volume.

As far as I can tell, I have successfully written the SD card. My problem occurs while booting the Cubie2. I can see what is happening by connecting the Cubie2's USB/serial cable to the serial pins on the Cubie2 board and monitoring the serial port using CoolTerm on the Mac. The boot messages are attached to my previous message. It all seems to proceed as expected until "Calibrating delay loop...", then stalls.
Title: Re: Cubieboard Install
Post by: beerstein on January 16, 2014, 05:16:33 AM
Hi: You might be right. When I did the dd on Mint14 CLI the SD was mounted. After the image was written, the SD was unmounted. May be Linux unmount s  it automatically. The dd error or success messages are not very helpful!
As far as I remember, when I tried to dd while the sd card was mounted, i got an error message such as "can not write to..." I will double check. Within the ARM world, the new sd card needs to be formatted as FAT! Not a ms fdisk FAT. It must be a Linux FAT. (gparted or cli or so) If you have MAC how did you do it?
The sd card needs a boot loader plus a boot partition holding the kernel and some other files. In addition to that you need a root partition for the rest of the operating system.
This is the case for all ARM boards with Allwinner SoC.!
Boot- and root partition need to be ext2 or ext3. So the best way to make a sd is to use a Linux distri.
You could doctor with a hex editor and look whether there is the initial "pre loader" on your sd card at sector 16.
The u-boot boot loader is about 512kB in size. Behind that you must have various configuration information  up to sector 2048. The first partition on the sd card must be FAT or ext2 - nothing else - and must start at sector 2048. Otherwise you will have a conflict with the boot loader. Please let me know the results.

The boot process in ARM is more difficult than in the X86 world. But as allays, once we know it, it is easy. I am about to learn that stuff and have posted an idea for a cubieCore in my most recent post.
Please let me know what you think.
Title: Re: Cubieboard Install
Post by: Peter Pudney on January 16, 2014, 04:35:15 PM
I have successfully got TC5 to boot to the command prompt on a Cubieboard 2 (A20). Here are instructions for creating a bootable SD card using Mac OS X. The process using Linux should be similar; the key is to use the boot files and kernel (iImage) from the Cubieboard2 hardware pack.

In the instructions below, make sure that you change diskx to the disk number (disk1, disk2, ...) of your SD card. You can find the disk number of the SD card using the mount command from an OS X terminal.



Insert the SD card into the Cubieboard 2 and apply power. Within 10 seconds the HDMI screen should show the TC5 prompt

    tc@box:~$

My next task is to get the GUI working.
Title: Re: Cubieboard Install
Post by: beerstein on January 17, 2014, 03:20:08 AM
good morning:
thank you for sharing that info with me. I will try o do the same asap on my cubietruck. Yesterday I used dd to write an excellent server image (CTDebian) to my sd card. You are right, I left the sd card unmounted and it worked. Using dd a few weeks ago on an unmounted sd card brought me the "no media found" error. Strange? Ok but now I know.

If you are interested, the debian server images are on the cubyboard forum. It helps to be a member there also. Please find more info here:
http://www.cubieforums.com/index.php?action=printpage;topic=1275.0
As far as I know it works on CB2 also.
This server is a great work and boots lightning fast into command line. I also would like to put a light gui onto that server and use it as a mini desktop. The procedure should be similar to the Core gui.

Title: Re: Cubieboard Install
Post by: beerstein on January 17, 2014, 07:21:54 AM
Hi again: I followed your instructions - formatted the 2GB sd card FAT16 using gparted in Linux. Then I cleaned it.
Close to the URL folder  where your hawpack for cubieboard2 is located, I found a cubietruck_hwpack and used this one.
It had the  folders with the same name like your in cubietruck hwpack.

/bootloader
/kernel
/rootfs

Questions: Do I have to copy these three folders including its content  into my FAT16 partition? or just the script.bin?
Where do I copy the uCore. uEnv.txt and boot.scr?

My partition has no folders and just the files in it:
 /boot.scr
 /script.bin
 /uCore
 /uEnv.txt
 /uImage /boot.scr
 /script.bin
 /uCore
 /uEnv.txt
 /uImage

Which one of these files must executable? Could there be a problem with ownership?

Thank you for your help

Title: Re: Cubieboard Install
Post by: coreplayer2 on January 17, 2014, 08:47:07 AM
I followed your instructions - formatted the 2GB sd card FAT16 using gparted in Linux. Then I cleaned it.
I am curious how you cleaned a NAND based card ?
Title: Re: Cubieboard Install
Post by: beerstein on January 17, 2014, 09:13:03 AM
Hi:
cubietruck has nand memory and a slot for a microsd card. I am trying to put core for A10 onto the cubietruck which is A20.
To clean a sd card Robert and Peter Pudney recommended to clean the sd card before writing on it:
sudo dd if=/dev/zero of=/dev/diskx bs=1m count=1
You probably thought I took it to the cleaner.  Now you know. :)
Title: Re: Cubieboard Install
Post by: coreplayer2 on January 17, 2014, 09:27:34 AM
Was just curious, because normally writing zero's to nand flash actually fill's the cells and severely degrades it's immediate writing performance.  Writing 1's on the other hand empty's the cells

Will have to find a method which works,  will get back to you on that
Title: Re: Cubieboard Install
Post by: beerstein on January 17, 2014, 09:43:54 AM
good point - never thought of that.
nand memory I call the built in memory in cubietruck.
sd memory I am calling the microSD cards, which fit into a slot on the cb3 board and act like a hard drive.
RaspberryPi f.i. has no nand - just an SD card slot
Title: Re: Cubieboard Install
Post by: Peter Pudney on January 17, 2014, 02:43:04 PM
I am not sure how necessary it is to write zeroes to the beginning of the SD card, but it is recommended on several forums. I have omitted this step a few times, without any problems.

Copy just the files, not the folders, from the hardware pack and TC distribution to the SD card. My SD card looks like this:

$ ls -l
total 12864
-rwxrwxrwx@ 1 pjp  staff      304 17 Mar  2013 boot.scr
-rwxrwxrwx@ 1 pjp  staff    45088 23 Jun  2013 script.bin
-rwxrwxrwx@ 1 pjp  staff  2925169  2 Jan 06:10 uCore
-rwxrwxrwx@ 1 pjp  staff      117  3 Sep 22:35 uEnv.txt
-rwxrwxrwx@ 1 pjp  staff  3487576 23 Jun  2013 uImage


uImage and script.bin are from the kernel folder in the Cubie hardware pack; boot.scr, uCore and uEnv.txt are from the TC distribution.

I copied the files to the SD card using the Mac OS X GUI, which set the permissions as shown above. My SD card also contains a few hidden files that OS X uses for icons and trash, but these do not appear to effect anything.

You can monitor the boot process using a serial TTL to USB cable (supplied with my Cubieboard 2): http://linux-sunxi.org/Cubieboard/TTL
Title: Re: Cubieboard Install
Post by: tinypoodle on January 17, 2014, 03:34:49 PM
Hi again: I followed your instructions - formatted the 2GB sd card FAT16 using gparted in Linux.
Which one of these files must executable? Could there be a problem with ownership?

msdos/fat filesystems do not provide for POSIX permissions at all   ;)
Title: Re: Cubieboard Install
Post by: beerstein on January 18, 2014, 04:00:52 AM
Hi Peter Pudney:
Thanks for the info. I tried several approaches and - no luck. In one case I produced a microSD which boots my CT into the NAND android 4.2.2 -- wow this is strange. The other cards did not boot at all.
My ct is Allwinner A20 2x cortex A7. The CB2 is also A20 and 2x cortex A7. But I am still not sure whether I should use the files from:
http://dl.linux-sunxi.org/users/oliver/cubietruck_hwpack.tar.xz
or from:
http://dl.linux-sunxi.org/users/hramrach/cubieboard2-linux3.3_hwpack.tar.xz --> you used his one

Here is how my content of the cubietruck_hwpack.tar.xz file looks like:
cubietruck hwpack content:

/cubietruck_hwpack/bootloader
/cubietruck_hwpack/kernel
/cubietruck_hwpack/rootfs

in /cubietruck_hwpack/bootloader there are the following files:

/cubietruck_hwpack/bootloader/sunxi-spl.bin
/cubietruck_hwpack/bootloader/u-boot.bin
/cubietruck_hwpack/bootloader/u-boot.img

I discovered that I have an additional file here named:u-boot.img
I do not know what to do with this file?

Question: When you dd the two .bin files to your sd card, did that generate the two partitions needed for a bootable sd card?
A bootable sd card needs the boot loader at the beginning of the partition up to sector 2048. After that the "boot stuff" is looking for an ext2 partition. In an older http://linux-sunxi.org/index.php.. article "Bootable SD card" it is recommended that you format this separate /boot partition FAT and after the dd. This does not make sense because it overwrites the code in front of  sector 2048 and in this case  the FAT partition starts at sector 1. Which means no u-boot no boot at all.

I might be almost there if I would know which sunxi-spl.bin and which u-boot.bin I should use. The ones from cubieboard2 or from cubietruck. In addition I need to know what to with that u-boot.img from the cubietruck  hwpack?

After that is done I could create a 64 MB ext2 partition starting at sector 2048 which would be the boot partition. Fies: uCore, uEnv.txt and boot.scr probably belong into this partition.

Behind the boot 64 MB boot partition the rext4 root partition could start at sector 133120. So now what belongs into this root partition?
I could put the content from the hw_pack /cubietruck_hwpack/rootfs folder into it?

If somebody could help me here I might be able to have a Core for cubietruck

Title: Re: Cubieboard Install
Post by: Peter Pudney on January 18, 2014, 04:17:34 PM
I suspect you should be using the cubietruck hardware pack.

The "Bootloader" section of the Bootable SD card article (http://linux-sunxi.org/Bootable_SD_card) has an example where u-boot.img is placed at sector 40 instead of placing u-boot.bin at sector 32.

When I partitioned my SD card, the single partition was placed at sector 8192. When I examine the SD card using fdisk I get:


Disk: /dev/disk2   geometry: 966/255/63 [15523840 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: 0B 1023 254  63 - 1023 254  63 [      8192 -   15515648] Win95 FAT-32
 2: 00    0   0   0 -    0   0   0 [         0 -          0] unused     
 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused     
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused     


The "Starting" and "Ending" values do not look right, but my fdisk man page says most modern systems use the "start" and "size" fields instead.

The "Partitioning" section of the Bootable SD card article says you can use only one partition; it is an experimental feature, but it works for me.

When I dd the two bin files they are placed at sectors 8 and 32, well before the single partition.

I ignored the roofs folder from the Cubie hardware pack---TinyCore does not appear to need it.

What messages do you get from the serial port while booting?
Title: Re: Cubieboard Install
Post by: beerstein on January 21, 2014, 05:21:38 AM
hi peter pudney:
thanx for your help. I do not get any messages when I try to boot from sd in cubietruck. Screen stays dark. No LED blinking.
Here is what I did:
1. cleaned as recommended in "Bottable SD card" description from linux-sunsi.org
2. formatted 2GB sd card FAT16
3. copied (sunxi-spl.bin and u-boot.bin) files from  cubietruck_hwpack using dd to formatted FAT partiion. This destroys the FAT 16 partition and places the code in front of sector 2048.
4. Now I followed the instructions "Single Partition" from the card description mentioned above (experimental)
5. here I needed the --force option to create a partition. $ cat <<EOT | sfdisk --in-order -uS /dev/sdc did not work. I needed $ cat <<EOT | sfdisk --force -uS /dev/sdc to get that partition.
6. Then the description recommends to format ext4 - should I use FAt 16 here? I can see from your last post that you have FAT?
7. then I created a /boot partition and copied uImage and script.bin from CT hw_pack into that /boot folder.
8. then copied uCore, uEnv.txt and boot.scr from A10  Tyne Core website also into /boot
9. result: no boot

May be the A10 stuff from TinyCore works with A10 on CB2 but not on CT?

There is also an additional u-boot.img in that cubietruck hw pack. I have no idea for what is this for?
 

Title: Re: Cubieboard Install
Post by: Peter Pudney on January 21, 2014, 01:43:39 PM
The boot messages are not on the HDMI screen, they are from the Cubie serial port. You need to connect a TTL-serial to USB cable to the Cubie board and monitor it with a terminal program. The instructions are here: http://linux-sunxi.org/Cubieboard/TTL

When you initially partition your card, you have to place the partition and file system after sector 2048, so it does not get overwritten by the dd commands. I used FAT because it was easy. I also tried ext2, but ext2 is not supported natively on Mac OS X and the ext2 file system I created did not work on the Cubie.

What do you get if you examine your SD card with fdisk, before and after copying sunxi-spl.bin and u-boot.bin?

I did not create a separate boot partition, and I did not place uCore, uEnv.txt and boot.scr in a /boot folder.
Title: Re: Cubieboard Install
Post by: beerstein on January 22, 2014, 12:34:24 PM
I got it. It was a bit tricky but it works with CB2 now. Since I had trouble to get it running on my CT I made an sd card for the CB2. It boots nicely on my CB2. But - now what?
the dCore has busybox installed and the the dhcp client is running and connected to the net. The same sd card works in CT also, but no dhcp running. For hat I need to do a ct card.

Here are some questions where I would like to get help from our community.
1. How to find extensions for that dCore version? Where are they? And how can I install those extensions?
2. I assume that dCore means debian or? So can we use applications from the Allwinner A20 repos of debian?

I discovered that this dCore version works only on HDMI. Even a HDMI - VGA converter cable did not work OK.
I have a HDMI DVI converter cable and will try that out too.

So before we get an X system there will be some work to do. I will try to produce a CT sd card asap.
Title: Re: Cubieboard Install
Post by: beerstein on January 22, 2014, 04:08:37 PM
I managed to get A10Core running on my Cubieboard3 = cubietruck.
It boots within a few seconds into command line. There is no eth0 network card recognized. I have no idea how to install a network interface card.
May be somebody can help me here.
 
Title: Re: Cubieboard Install
Post by: beerstein on February 05, 2014, 08:43:34 AM
Hi Peter Pudney: Please take not of my new post on Allwinner A20.
Have you been able to get x running?
Title: Re: Cubieboard Install
Post by: Peter Pudney on February 05, 2014, 01:44:25 PM
I have not yet had a chance to try installing X. I see from your notes that I need to change my FAT partition to an ext2 partition so that permissions work properly.

I will follow your progress on the Allwinner A20 thread, and let you know if I make any progress.