Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A20 => Topic started by: iso9660 on October 17, 2013, 06:58:28 PM

Title: How to install Debian on NAND in A20-MICRO?
Post by: iso9660 on October 17, 2013, 06:58:28 PM
Please, can anybody tell how to install Debian in the A20-MICRO nand?
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: Tom on October 18, 2013, 12:43:48 AM
Quote from: iso9660 on October 17, 2013, 06:58:28 PM
Please, can anybody tell how to install Debian in the A20-MICRO nand?

Afaik You can't. At the moment nand is waste of money :(.
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: martinayotte on October 18, 2013, 02:03:23 AM
Is it because "nand-part" from sunxi-tools doesn't seems to work yet on A20 as I mentionned 2 weeks ago ?

I still waiting for answer about that :

https://www.olimex.com/forum/index.php?topic=1983.0

Because as soon this will be fixed, I presume we will be able to put Debian on A20 NAND, since I've got previous success with A10s boards :

https://www.olimex.com/forum/index.php?topic=1628.0

It sure I didn't try yet this recipe on my A20 seeing that nand-part wasn't able to display current Android partitions like it should...

Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: miloose on October 21, 2013, 10:37:37 AM
I too would be very interested to install Debian on NAND. If you succeed, can you please update this post with an how-to ? Thanks a lot.

Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: Mad Demus on October 22, 2013, 12:47:16 PM
Today I successfully installed the official Debian Image into A20-OLinuXino's flash.

First, download and uncompress this file which contains the bootloader and an image of the flash partition scheme:

http://dtmh.de/files/olinuxino-a20-flashinstall.zip (http://dtmh.de/files/olinuxino-a20-flashinstall.zip)

After that, change into the folder which contains the uncompressed files.

Now, here is the quick recipe:

#############################################################################
# HOWTO install a running SD-card image to A20-OLinuXino NAND flash
#
# The following steps must be executed as root and on a running SD-card image!
#
# Sunxi kernel 3.4.43 or later is required.
# Tested with official Olimex Debian Wheezy image with kernel 3.4.61+
#
# The flash partition scheme will looks like follow:
# /dev/nanda is BOOT device
# /dev/nandc is ROOT device
# /dev/nandb is MAGIC device
#
#############################################################################

# First of all, make sure that all nand devices /dev/nand* are unmounted
# (check output of mount if you are not sure)

# Copy A20 flash partition image to NAND flash
tar -xzOf nand_part.gz | dd of=/dev/nand
sync


# reboot to make new partitions available
reboot

# after reboot: create filesystems
mkfs.vfat /dev/nanda
mkfs.ext4 /dev/nandc
echo -e 'ANDROID!\0\0\0\0\0\0\0\0\c' > /dev/nandb


# mount new filesystems
mkdir /mnt/nanda
mkdir /mnt/nandc
mount /dev/nanda /mnt/nanda
mount /dev/nandc /mnt/nandc


# install bootloader to /dev/nanda
rm -rf /mnt/nanda/*
rsync -avc bootloader/* /mnt/nanda


# copy script.bin and uImage into new root device under /boot
mount /dev/mmcblk0p1 /boot
rsync -avc /boot/script.bin /boot/uImage /mnt/nandc/boot/


# if you need additional kernel arguments, you can create a uEnv.txt file under
# /mnt/nandc/boot/ wich contains the following line:
Quoteextraargs=<your extra kernel args here>

# copy rootfs
rsync -avc --exclude-from=exclude.txt / /mnt/nandc
sync


# shutdown and remove SD card
shutdown -h now

# now power on the device and it should boot from NAND!

Enjoy!
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: iso9660 on October 23, 2013, 01:29:50 PM
Hi Mad Demus.

Many thanks for your help!
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: miloose on October 23, 2013, 05:26:30 PM
Waaw. Thanks a lot. Very clear how-to with every steps. I will give it a try.

Thanks again.
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: jacquesdirac on October 25, 2013, 03:54:12 PM
Thanks Mad Demus, for this great tutorial!
Followed the steps and it runs fine.

Only one remark:
When I make changes to the rootfs they are still available after a reboot, so it looks like the rootfs is loaded and running from NAND (and not running from RAM). Could this not do any harm if the NAND flash is written all the time by the rootfs (wearing out)?

How can the rootfs be mounted readonly to be sure?
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: Jox on November 18, 2013, 07:26:17 PM
First, thanks for the tutorial, but it seems it is not working anymore....  :(

/dev/nand does not appear in /dev, so I haven't been able to install the latest Debian image (release 5), as you can't copy anything there.

Any workaround for this ??
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: kalkov on November 20, 2013, 08:17:56 PM
 Hi, thanks for the great tutorial. How is the speed compared to sdcard? Did you run any benchmarks?
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: Mad Demus on November 29, 2013, 09:56:44 AM
Here are the results of a quick I/O benchmark, done by fio tool under different situations:

============================================================== 
== random workload, sequential read/write, 1 process
==============================================================

==========================
== Class 10 MicroSD
==========================
# fio --name=test --rw=readwrite --size=100M --direct=1 --bs=1024k --filename=file1
test: (g=0): rw=rw, bs=1M-1M/1M-1M/1M-1M, ioengine=sync, iodepth=1
fio-2.1.4-6-ge171
...
Run status group 0 (all jobs):
   READ: io=48128KB, aggrb=3856KB/s, minb=3856KB/s, maxb=3856KB/s, mint=12480msec, maxt=12480msec
  WRITE: io=54272KB, aggrb=4348KB/s, minb=4348KB/s, maxb=4348KB/s, mint=12480msec, maxt=12480msec

Disk stats (read/write):
  mmcblk0: ios=94/105, merge=0/2, ticks=3940/16810, in_queue=20900, util=97.47%

 
==========================
== NAND
==========================
# fio --name=test --rw=readwrite --size=100M --direct=1 --bs=1024k --filename=/mnt/benchfile
test: (g=0): rw=rw, bs=1M-1M/1M-1M/1M-1M, ioengine=sync, iodepth=1
fio-2.1.4-6-ge171
Starting 1 process
...
Run status group 0 (all jobs):
   READ: io=48128KB, aggrb=1346KB/s, minb=1346KB/s, maxb=1346KB/s, mint=35753msec, maxt=35753msec
  WRITE: io=54272KB, aggrb=1517KB/s, minb=1517KB/s, maxb=1517KB/s, mint=35753msec, maxt=35753msec

Disk stats (read/write):
  nand: ios=423/477, merge=0/6, ticks=24480/167780, in_queue=194920, util=97.92%
 

==========================
== RESULT
==========================
=> MicroSD is about 2.86 times faster in single-task, sequential R/W operations than NAND.
 
 
============================================================== 
== random workload, random read/write, 2 processes
==============================================================

==========================
== Class 10 MicroSD
==========================
# fio --name=test --rw=randrw --size=10M --numjobs=2 --direct=1 --filename=file1
test: (g=0): rw=randrw, bs=4K-4K/4K-4K/4K-4K, ioengine=sync, iodepth=1
test: (g=0): rw=randrw, bs=4K-4K/4K-4K/4K-4K, ioengine=sync, iodepth=1
fio-2.1.4-6-ge171
Starting 2 processes
Jobs: 2 (f=2): [mm] [96.4% done] [75KB/63KB/0KB /s] [18/15/0 iops] [eta 00m:01s]
...
Run status group 0 (all jobs):
   READ: io=10640KB, aggrb=401KB/s, minb=200KB/s, maxb=201KB/s, mint=26447msec, maxt=26475msec
  WRITE: io=9840KB, aggrb=371KB/s, minb=185KB/s, maxb=186KB/s, mint=26447msec, maxt=26475msec

Disk stats (read/write):
  mmcblk0: ios=2622/2437, merge=0/5, ticks=3890/26600, in_queue=30410, util=98.11%
 
==========================
== NAND
==========================
# fio --name=test --rw=randrw --size=10M --numjobs=2 --direct=1 --filename=/mnt/benchfile
test: (g=0): rw=randrw, bs=4K-4K/4K-4K/4K-4K, ioengine=sync, iodepth=1
test: (g=0): rw=randrw, bs=4K-4K/4K-4K/4K-4K, ioengine=sync, iodepth=1
fio-2.1.4-6-ge171
Starting 2 processes
Jobs: 2 (f=2): [mm] [100.0% done] [1089KB/1009KB/0KB /s] [272/252/0 iops] [eta 00m:00s]
...
Run status group 0 (all jobs):
   READ: io=10640KB, aggrb=620KB/s, minb=310KB/s, maxb=311KB/s, mint=17084msec, maxt=17144msec
  WRITE: io=9840KB, aggrb=573KB/s, minb=286KB/s, maxb=287KB/s, mint=17084msec, maxt=17144msec

Disk stats (read/write):
  nand: ios=2583/2399, merge=1/3, ticks=6470/14200, in_queue=20630, util=97.39%

==========================
== RESULT
==========================
=> NAND is about 1.5 times faster in random workload + random R/W operations than MicroSD.
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: Mad Demus on November 29, 2013, 10:34:04 AM
Quote from: jacquesdirac on October 25, 2013, 03:54:12 PM
How can the rootfs be mounted readonly to be sure?

Hi jacquesdirac,

as usual, you can use /etc/fstab to mount root as "read only" (ro):

/dev/nandc   /      ext4    ro,relatime,data=ordered 0 0

But you have to ensure, that there are places to store some things like logfiles or temp files, so you'll need additional mount points (e.g. mounting /var as tmpfs)
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: miloose on November 29, 2013, 10:01:38 PM
Does someone knows how to access to the nand with the release 5? the command fdisk -l doesn't show the nand, so I'm a little confused...

Thanks a lot
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: Mad Demus on December 01, 2013, 07:39:33 PM
will check this tomorrow...
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: Mad Demus on December 02, 2013, 12:24:10 PM
Quote from: Jox on November 18, 2013, 07:26:17 PM
/dev/nand does not appear in /dev, so I haven't been able to install the latest Debian image (release 5), as you can't copy anything there.

Any workaround for this ??

The problem seems to be in kernel configuration: CONFIG_SUNXI_NAND isn't set anymore (but was set in previous release, also CONFIG_SUNXI_PWM is missing and therefore PWM doesn't work anymore!)

You could try to build Release 5 again with a modified version of a20_defconfig, where you add the following 2 lines:

CONFIG_SUNXI_NAND=y
CONFIG_SUNXI_NAND_COMPAT_DEV=y


And for PWM, try to add the following line:

CONFIG_SUNXI_PWM=y
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: Jox on December 04, 2013, 12:22:32 AM
Thanks a lot. Will try that during the weekend, though watching those benchmarks may set me back...

Got to think about it. I would rather wear out a SD card than NAND and the improvement is not that big...
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: catch33 on December 04, 2013, 07:43:16 PM
Quote from: Jox on December 04, 2013, 12:22:32 AMWill try that during the weekend, though watching those benchmarks may set me back...

Honestly I don't know how this "fio" benchmark works in detail, but when I try out the same commands posted by Mad Demus on my Fedora machine, I get this:

====
fio --name=test --rw=readwrite --size=100M --direct=1 --bs=1024k --filename=file1
====

== Crucial m4 SSD ==
   READ: io=49152KB, aggrb=92390KB/s, minb=92390KB/s, maxb=92390KB/s, mint=532msec, maxt=532msec
  WRITE: io=53248KB, aggrb=100090KB/s, minb=100090KB/s, maxb=100090KB/s, mint=532msec, maxt=532msec

== Generic 7200rpm 2,5" HDD ==
   READ: io=51200KB, aggrb=853333KB/s, minb=853333KB/s, maxb=853333KB/s, mint=60msec, maxt=60msec
  WRITE: io=51200KB, aggrb=853333KB/s, minb=853333KB/s, maxb=853333KB/s, mint=60msec, maxt=60msec

====
fio --name=test --rw=randrw --size=10M --numjobs=2 --direct=1 --filename=file1
====

== SSD ==
   READ: io=10192KB, aggrb=9454KB/s, minb=4730KB/s, maxb=4812KB/s, mint=1058msec, maxt=1078msec
  WRITE: io=10288KB, aggrb=9543KB/s, minb=4768KB/s, maxb=4865KB/s, mint=1058msec, maxt=1078msec

== HDD ==
   READ: io=10260KB, aggrb=64125KB/s, minb=31900KB/s, maxb=32632KB/s, mint=158msec, maxt=160msec
  WRITE: io=10220KB, aggrb=63875KB/s, minb=32100KB/s, maxb=32177KB/s, mint=158msec, maxt=160msec


Which, overall, tells me my hard drive is 6-9 times faster than my SSD ???
OK, my SSD could have a serious problem, but besides that, I can't believe I can write 100MB to my HDD with >850MB per second! This leaves me uncertain on how valuable this benchmark's data is concerning the A20-Micro.
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: Mad Demus on December 17, 2013, 11:17:16 AM
Seems like there was still some kernel page caching involved... over 800 MB/s is a way too much ;-)

However, I have done some further benchmarks using "sysbench" (also using O_DIRECT flag to bypass the page cache) and here are the results:


# sysbench --test=fileio --max-time=60 --max-requests=1000000  --file-num=1 --file-extra-flags=direct --file-fsync-freq=0  --file-total-size=128M prepare
# sysbench --test=fileio --max-time=60 --max-requests=1000000  --file-num=1 --file-extra-flags=direct --file-fsync-freq=0  --file-total-size=128M --file-test-mode=rndrd run

==========================
== Class 10 MicroSD
==========================
Operations performed:  32289 Read, 0 Write, 0 Other = 32289 Total
Read 504.52Mb  Written 0b  Total transferred 504.52Mb  (8.4085Mb/sec)
  538.14 Requests/sec executed

Test execution summary:
    total time:                          60.0008s
    total number of events:              32289
    total time taken by event execution: 59.7645
    per-request statistics:
         min:                                  1.58ms
         avg:                                  1.85ms
         max:                                 45.40ms
         approx.  95 percentile:               1.95ms

Threads fairness:
    events (avg/stddev):           32289.0000/0.00
    execution time (avg/stddev):   59.7645/0.00


==========================
== NAND
==========================
Operations performed:  39577 Read, 0 Write, 0 Other = 39577 Total
Read 618.39Mb  Written 0b  Total transferred 618.39Mb  (10.306Mb/sec)
  659.59 Requests/sec executed

Test execution summary:
    total time:                          60.0021s
    total number of events:              39577
    total time taken by event execution: 59.5524
    per-request statistics:
         min:                                  0.25ms
         avg:                                  1.50ms
         max:                                 18.29ms
         approx.  95 percentile:               1.66ms

Threads fairness:
    events (avg/stddev):           39577.0000/0.00
    execution time (avg/stddev):   59.5524/0.00


==========
So here we have quite better results with 10.31 MB/s (NAND) vs. 8.41 MB/s (uSD).
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: ludo on December 18, 2013, 05:04:25 PM
Hello Mad Demus,

I'am following your tuto to put debian on my NAND, but it seems that the link for the flashinstaller doesn't work anymore.

this one:
http://dtmh.de/files/olinuxino-a20-flashinstall.zip

I may miss something. Can i have some help please.

thanks you very much.

Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: Mad Demus on December 20, 2013, 09:11:57 AM
Quote from: ludo on December 18, 2013, 05:04:25 PM
Hello Mad Demus,

I'am following your tuto to put debian on my NAND, but it seems that the link for the flashinstaller doesn't work anymore.

this one:
http://dtmh.de/files/olinuxino-a20-flashinstall.zip

I may miss something. Can i have some help please.

thanks you very much.

My bad... now it is available again! Sorry ;-)
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: miloose on December 21, 2013, 04:41:32 PM
For those who are interested, you can find here (https://drive.google.com/file/d/0B9o2WVSuik0ISk5kdlN2c1hRVWs/edit?usp=sharing) the uImage with NAND support as well as PWM. It has been built following the tuto here (http://olimex.wordpress.com/2013/11/05/building-the-ultimate-debian-sd-card-for-linux-with-kernel-3-4-for-a20-olinuxino-micro/) and adding the following lines to a20_defconfig
CONFIG_SUNXI_NAND=y
CONFIG_SUNXI_NAND_COMPAT_DEV=y
CONFIG_SUNXI_PWM=y


Just replace the uImage on your sd card by this one and you should see the NAND. I didn't try the PWM as I don't even know what's the meaning of it :-)
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: andrea2277 on February 16, 2014, 12:53:31 PM
Hi guys,

I want install a Debian olimex distro on A20-OLinuXino-MICRO-4GB.

I have connect the A20 with serial cable and work fine,
but when execute the command (the first on tutorial):

tar -xzOf nand_part.gz | dd of=/dev/nand
sync



I receive on my terminal:

tar -xz0f nand_part.gz | dd of=/dev/nand
tar: Options `-[0-7][lmh]' not supported by *this* tar
Try `tar --help' or `tar --usage' for more information.
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.0132197 s, 0.0 kB/s


have any suggestion?

PS: i have search in the filesystem of SD-CARD with Debian but don't see /dev/nand ..is correctly??









Quote from: Mad Demus on October 22, 2013, 12:47:16 PM
Today I successfully installed the official Debian Image into A20-OLinuXino's flash.

First, download and uncompress this file which contains the bootloader and an image of the flash partition scheme:

http://dtmh.de/files/olinuxino-a20-flashinstall.zip (http://dtmh.de/files/olinuxino-a20-flashinstall.zip)

After that, change into the folder which contains the uncompressed files.

Now, here is the quick recipe:

#############################################################################
# HOWTO install a running SD-card image to A20-OLinuXino NAND flash
#
# The following steps must be executed as root and on a running SD-card image!
#
# Sunxi kernel 3.4.43 or later is required.
# Tested with official Olimex Debian Wheezy image with kernel 3.4.61+
#
# The flash partition scheme will looks like follow:
# /dev/nanda is BOOT device
# /dev/nandc is ROOT device
# /dev/nandb is MAGIC device
#
#############################################################################

# First of all, make sure that all nand devices /dev/nand* are unmounted
# (check output of mount if you are not sure)

# Copy A20 flash partition image to NAND flash
tar -xzOf nand_part.gz | dd of=/dev/nand
sync


# reboot to make new partitions available
reboot

# after reboot: create filesystems
mkfs.vfat /dev/nanda
mkfs.ext4 /dev/nandc
echo -e 'ANDROID!\0\0\0\0\0\0\0\0\c' > /dev/nandb


# mount new filesystems
mkdir /mnt/nanda
mkdir /mnt/nandc
mount /dev/nanda /mnt/nanda
mount /dev/nandc /mnt/nandc


# install bootloader to /dev/nanda
rm -rf /mnt/nanda/*
rsync -avc bootloader/* /mnt/nanda


# copy script.bin and uImage into new root device under /boot
mount /dev/mmcblk0p1 /boot
rsync -avc /boot/script.bin /boot/uImage /mnt/nandc/boot/


# if you need additional kernel arguments, you can create a uEnv.txt file under
# /mnt/nandc/boot/ wich contains the following line:
Quoteextraargs=<your extra kernel args here>

# copy rootfs
rsync -avc --exclude-from=exclude.txt / /mnt/nandc
sync


# shutdown and remove SD card
shutdown -h now

# now power on the device and it should boot from NAND!

Enjoy!
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: andrea2277 on February 17, 2014, 02:32:40 AM
Hi guys,

i have solved my problem..the command is not correct (used number 0 in "tar xzOf", but char O is correct).

I have a new problem.
When execute the command "mkfs.vfat /dev/nanda" i received:

"UNABLE TO GET DRIVE GEOMETRY, USING DEFAULT 255/63"

Have a idea for solve the problem???

thx
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: mauris on February 23, 2014, 11:54:48 PM
Hi,
When I execute the command "mkfs.vfat /dev/nanda" I recieved :

"/dev/nanda: No such file or directory"

Have a idea for solve the problem ?
Thanks in advance
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: dipsie on March 11, 2014, 12:01:51 PM
Thanks Mad Demus for the tutorial!

May I ask which version of u-boot did you use? Or what changes have you done to u-boot sources?
I need to shut up the serial console (then my cmdline should contain console= ) but I can't rebuild a working u-boot.bin as the one provided in the .zip file.

thx
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: aauer1 on April 23, 2014, 12:09:12 PM
Quote from: Mad Demus on December 20, 2013, 09:11:57 AM
Quote from: ludo on December 18, 2013, 05:04:25 PM
Hello Mad Demus,

I'am following your tuto to put debian on my NAND, but it seems that the link for the flashinstaller doesn't work anymore.

this one:
http://dtmh.de/files/olinuxino-a20-flashinstall.zip

I may miss something. Can i have some help please.

thanks you very much.

My bad... now it is available again! Sorry ;-)

Hello Mad Demus,

I think the link for downloading the flash install zip file isn't working again. I would appricicate if you can fix it. Or is it available from another host?

Best Regards,
Andreas
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: Mad Demus on June 07, 2014, 05:10:26 PM
Quote from: aauer1 on April 23, 2014, 12:09:12 PM

Hello Mad Demus,

I think the link for downloading the flash install zip file isn't working again. I would appricicate if you can fix it. Or is it available from another host?

Best Regards,
Andreas

Hello Andreas,

the link should be working now... Sorry again! ;-)
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: mauris on June 25, 2014, 07:55:43 PM
When I execute the command "mkfs.vfat /dev/nanda" I recieved :

"/dev/nanda: No such file or directory"

Where is the problem ?
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: jlucius on June 26, 2014, 10:51:58 AM
Quote from: mauris on June 25, 2014, 07:55:43 PM
When I execute the command "mkfs.vfat /dev/nanda" I recieved :

"/dev/nanda: No such file or directory"

Where is the problem ?

Most likly missing NAND drivers in kernel. See post #20 for this.
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: mauris on June 26, 2014, 03:34:03 PM
Thank you for your help,

The NAND driver is the "nand_driver" file of the "nand_driver.gz" ?
If I understand correctly, the command line "tar-xvf nand_part.gz | dd of = /dev/nand" and "sync" install the driver in the NAND then after a reboot the partions /dev/nanda,  /dev/nandb, /dev/nandc are recognized by the system ?
But I successfully uncompressed nand_part.gz into /dev/nand and reboot

Sincerely,
Mauris
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: jlucius on June 27, 2014, 01:56:56 AM
Quote from: mauris on June 26, 2014, 03:34:03 PM
Thank you for your help,

The NAND driver is the "nand_driver" file of the "nand_driver.gz" ?
If I understand correctly, the command line "tar-xvf nand_part.gz | dd of = /dev/nand" and "sync" install the driver in the NAND then after a reboot the partions /dev/nanda,  /dev/nandb, /dev/nandc are recognized by the system ?
But I successfully uncompressed nand_part.gz into /dev/nand and reboot

No the NAND first has to be recognized by the kernel. if you boot from sd-card you should have available /dev/nanda for example. if it is not htere, the kernel driver is missing and you need to compile your own kernel or get the one from the post above.
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: mauris on June 27, 2014, 12:40:48 PM
I use this image for the SD-card https://docs.google.com/file/d/0B-bAEPML8fwlX2tYS2FmNXV5OUU/edit (https://docs.google.com/file/d/0B-bAEPML8fwlX2tYS2FmNXV5OUU/edit)
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: jlucius on June 27, 2014, 02:30:21 PM
Quote from: mauris on June 27, 2014, 12:40:48 PM
I use this image for the SD-card https://docs.google.com/file/d/0B-bAEPML8fwlX2tYS2FmNXV5OUU/edit (https://docs.google.com/file/d/0B-bAEPML8fwlX2tYS2FmNXV5OUU/edit)

do you have an entry that shows /dev/nanda (ls /dev/nand*) ?

If not please replace your kernel by this one:

https://docs.google.com/file/d/0B9o2WVSuik0ISk5kdlN2c1hRVWs/edit

(mount sd card or enter in a windows system on first partition and replace uImage file)

then try again
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: pfandfrei on June 27, 2014, 08:28:20 PM
Installed dabian to NAND today, everything is fine now.

Some tips if you want to try for yourself (it costs me some extra time):
- be aware that you have to reinstall Android first, if you get any trouble while installing and you can not proceed
- you can use the latest image and change the uImage file from post #20
- be sure to mkdir.vfat installed, if not first install dosfstools packet
- be sure to rsync installed, if not first install rsync packet
- be sure you can create /mnt/nanda and /mnt/nandc dir
- double check every step

good luck!
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: mauris on June 27, 2014, 11:18:17 PM
Thank you for your help again,

When I execute mkfs.vfat ==> error : unable to get drive geometry, using default 255/63
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: pfandfrei on June 27, 2014, 11:29:26 PM
I had the same message and ignored it. Was no problem at all
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: mauris on June 28, 2014, 12:09:30 AM
With the command rsync -avc bootloader/* /mnt:nanda error ==> Operation not permitted, but I'm login as root
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: pfandfrei on June 28, 2014, 08:50:11 AM
try "sudo rsync ..."
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: mauris on June 28, 2014, 12:36:15 PM
No error but after a reboot the card not boot from the NAND
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: pfandfrei on June 30, 2014, 09:23:19 AM
That's strange, it worked for me. I think you missed something. Try again and start with reinstlling Android. That's what I had to do when I realized, that mkdir.vfat was not installed in first try.
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: kurzon on July 07, 2014, 10:59:02 PM
Does anyone have this "olinuxino-a20-flashinstall.zip" file please? The link is not working.
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: Alex293 on July 11, 2014, 03:59:15 PM
Hi guys, i have the same problem. I made a debian image but i can't dl your file to put it onto my nand. Can you fix your link to olinuxino-a20-flashinstall.zip file please ? Or can someone share it.
(edit) at least can someone dd his nand ?
Thanks

Sincerely, Alexis
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: Mad Demus on July 12, 2014, 08:57:42 PM
Quote from: kurzon on July 07, 2014, 10:59:02 PM
Does anyone have this "olinuxino-a20-flashinstall.zip" file please? The link is not working.

Should be working again. The damn virtual server have some issues from time to time, but now it is alive :-)
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: kurzon on July 12, 2014, 10:13:46 PM
Thanks a lot Mad Demus.
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: Alex293 on July 15, 2014, 11:16:53 AM
Thank Mad Demus, i'll try it today
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: Alex293 on July 15, 2014, 07:35:14 PM
Hi !

Thank a lot for your files ! Everything is now working !
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: mickours on August 01, 2014, 04:17:42 PM
Quote from: Mad Demus on October 22, 2013, 12:47:16 PM
Today I successfully installed the official Debian Image into A20-OLinuXino's flash.

First, download and uncompress this file which contains the bootloader and an image of the flash partition scheme:

http://dtmh.de/files/olinuxino-a20-flashinstall.zip (http://dtmh.de/files/olinuxino-a20-flashinstall.zip)

After that, change into the folder which contains the uncompressed files.

Now, here is the quick recipe:

#############################################################################
# HOWTO install a running SD-card image to A20-OLinuXino NAND flash
#
# The following steps must be executed as root and on a running SD-card image!
#
# Sunxi kernel 3.4.43 or later is required.
# Tested with official Olimex Debian Wheezy image with kernel 3.4.61+
#
# The flash partition scheme will looks like follow:
# /dev/nanda is BOOT device
# /dev/nandc is ROOT device
# /dev/nandb is MAGIC device
#
#############################################################################

# First of all, make sure that all nand devices /dev/nand* are unmounted
# (check output of mount if you are not sure)

# Copy A20 flash partition image to NAND flash
tar -xzOf nand_part.gz | dd of=/dev/nand
sync


# reboot to make new partitions available
reboot

# after reboot: create filesystems
mkfs.vfat /dev/nanda
mkfs.ext4 /dev/nandc
echo -e 'ANDROID!\0\0\0\0\0\0\0\0\c' > /dev/nandb


# mount new filesystems
mkdir /mnt/nanda
mkdir /mnt/nandc
mount /dev/nanda /mnt/nanda
mount /dev/nandc /mnt/nandc


# install bootloader to /dev/nanda
rm -rf /mnt/nanda/*
rsync -avc bootloader/* /mnt/nanda


# copy script.bin and uImage into new root device under /boot
mount /dev/mmcblk0p1 /boot
rsync -avc /boot/script.bin /boot/uImage /mnt/nandc/boot/


# if you need additional kernel arguments, you can create a uEnv.txt file under
# /mnt/nandc/boot/ wich contains the following line:
Quoteextraargs=<your extra kernel args here>

# copy rootfs
rsync -avc --exclude-from=exclude.txt / /mnt/nandc
sync


# shutdown and remove SD card
shutdown -h now

# now power on the device and it should boot from NAND!

Enjoy!
Thank you really much for this.

I'm trying to modify this to makes it boot on the SATA. I found out how to do it manually:
First, generate an Initrd with mkintramfs and mkimage
Then copy the root filsystem to a the SATA disk (here in /dev/sda2)
then stop the boot and type:

setenv root=/dev/sda2                                                 
setenv machid 10bb                                                     
setenv extraargs rootfstype=ext4 rootwait                             
setenv bootargs console=${console} root=${root} loglevel=${loglevel} ${panicarg} ${extraargs}
ext4load nand 2:0 0x43000000 /boot/script.bin                         
ext4load nand 2:0 0x41000000 /boot/uImage                             
ext4load nand 2:0 0x45000000 /boot/uInitrd                             
bootm 0x41000000 0x45000000               


The problem is that I can't do this automatically with the uEnv.txt because the way it is loaded
the uenvcmd do not run. And the memory is override after the load.

Here is the u-boot env:

sun7i#printenv
baudrate=115200
boot_fastboot=fastboot
boot_normal=bootm 48000000
boot_recovery=sunxi_flash read 40007800 recovery;boota 40007800
bootcmd=run setargs_nand boot_normal
bootdelay=1
bootenv=/uEnv.txt
console=ttyS0,115200
kernel=/uImage
kerneladdr=0x48000000
loadbootenv=mw 41000000 0 10000;ext4load nand 2:0 $scriptaddr /boot${bootenv} || fatload nand 0:0 $scriptaddr ${bootenv};env import 41000000 10000;setenv bootargs console=${console} root=${nand_root} loglevel=${loglevel} ${extraargs}
loadkernel=ext4load nand 2:0 $kerneladdr /boot${kernel} || fatload nand 0:0 $kerneladdr ${kernel}
loadscriptbin=ext4load nand 2:0 $scriptbinaddr /boot${scriptbin} || fatload nand 0:0 $scriptbinaddr ${scriptbin}
loglevel=8
nand_root=/dev/nand3
partitions=bootloader@nanda:boot@nandb:linux@nandc
scriptaddr=0x41000000
scriptbin=/script.bin
scriptbinaddr=0x43000000
setargs_nand=run loadbootenv loadscriptbin loadkernel setmachid
setmachid=setenv machid 10bb
stderr=serial
stdin=serial
stdout=serial



Can you provide the way of generating the bootloader files provided on the zip, so I can customize it?
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: ric.rug on August 22, 2014, 05:17:38 PM
Hi, does it work with A20-LIME?
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: Alex293 on August 22, 2014, 05:18:37 PM
@ric, yes with the same method !
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: ric.rug on August 22, 2014, 05:28:24 PM
Quote from: Alex293 on August 22, 2014, 05:18:37 PM
@ric, yes with the same method !

@Alex293, thanks a lot!
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: joost0405 on September 10, 2014, 04:06:50 PM
Hey guys,

Tried this on a A20-OLinuXino-LIME-4GB, but during boot i got:

VFS: Cannot open root device "nand3" or unknown-block(0,0): error -6

It's booting the kernel just fine

Linux version 3.4.90+ (root@debian) (gcc version 4.7.1 (Debian 4.7.1-7) ) #9 SMP PREEMPT Mon Jul 14 13:58:39 EEST 2014

But it can't find the rootfs installed to /mnt/nandc of the guide.

For clarity: I chose to install a debian wheezy debootstrapped rootfs here, but it also didn't work with the stock olimex debian image that came preinstalled on the SD card, so my guess is that it is something else.

My gut says I need to have a uEnv.txt with proper boot arguments. Any pointers?

Cheers,
Joost.


Nevermind, I was using a kernel that had nand support as a kernel module instead of having it built in. Therefore it could not find /dev/nand3 as the nand support was not loaded. Classic chicken-egg problem. Quick workaround: use the 3.4.67+ kernel posted in this thread. Better workaround: roll your own A20 kernel with nand built in instead of as a kernel module.

Thanks,
Joost.
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: mlg on September 13, 2014, 09:21:50 PM
I tried it on an A20 Lime but always get the error:

[  ] load kernel successed
[  ] start address = 0x4a000000
[  ] boot1: bad boot image magic, maybe not a boot.img


Any hints?
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: mlg on September 13, 2014, 11:03:36 PM
 :)

Solved it. Partition table was wrong, because I omitted the O option from tar. Seems to work now.

Great
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: otolizz on October 08, 2014, 05:53:36 PM
Hi,

I tried to install debian release 8 on the nand, but it freeze on the boot screen...
Anyone to help??

Thx.
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: gippy73 on October 14, 2014, 01:11:33 PM
Thanks for the tutorial!!!

It works like a charm ;)

For everyone's convenience I want to remark some detail that may sound obvious to skilled people:
+ on my debian Olimex's image gzip is at version 1.5, while many files like also "olinuxino-a20-flashinstall" need at least v. 2.0 (from "file" command's output). Instead of trying to update gzip I've preferred to install p7zip (sudo apt-get install p7zip) and use it (7z x olinuxino-a20-flashinstall.zip) to decompress that file
+ in order to (find and) run mkfs.vfat You'll need to install dosfstools package (sudo apt-get install dosfstools)
+ in order to (find and) run rsync You'll need to install rsync package (sudo apt-get install rsync)

As said it's obvious for skilled people, but may still be useful for those who aren't.
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: Leonardo on November 06, 2014, 09:57:40 AM
Quote from: otolizz on October 08, 2014, 05:53:36 PM
Hi,

I tried to install debian release 8 on the nand, but it freeze on the boot screen...
Anyone to help??

Thx.

Hi! I have the same problem, may some .ini file need a fix?

Leo
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: AzHofi on November 11, 2014, 11:16:33 AM
Hi,
I followed this tutorial, my debian works well. I filled the rootfs with stuff to about 90% capacity, and suddenly my new files started to fill wit FFs. For example if I compile a program, works well, but after a reboot (or maybe enough to clear the linux file caches - i dont know how to do this) my files are unusable, they contain only FF bytes.
Did someone experienced same issue?
Could someone test this on an a20 som?
Thanks in advance.
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: AzHofi on November 11, 2014, 07:23:40 PM
Can happen if the partitioning schema points over the physical boundaries of the nand and linux tries to write over the end of the available space? How can I test it?
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: Leonardo on November 25, 2014, 05:37:00 PM
Hello, i think the onboard NAND flash is interesting with a UBIFS formatted root partition on it. I tried to compile the u-boot taken from the lichee-dev-a20 branch and manually install it to /dev/nanda vfat partition with the kernel of Debian release 8 and it doesn't work. i could keep trying but from a working branch, anyone tried the rgwan/linux-sunxi and rgwan/u-boot-sunxi branches? As stated here https://linux-sunxi.org/NAND they should be the unstable version of kernel and u-boot with MTD-driver support.

Leo
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: edualfaia on December 11, 2014, 06:57:42 PM
Hi Guys,
I've installed Debian on NAND, but I have a sata hdd with Debian too, How could I booting from NAND and mount rootfs from hdd?

Thanks guys
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: AzHofi on December 11, 2014, 08:06:11 PM
Quote from: edualfaia on December 11, 2014, 06:57:42 PM
Hi Guys,
I've installed Debian on NAND, but I have a sata hdd with Debian too, How could I booting from NAND and mount rootfs from hdd?

My opinion is You can't boot directly from sata disk, but dont worry, you can install a small boot partition to nand with kernel (including builtin, not module sata support) and uEnv.txt, where You can set the root partition.

Best regards
Attila
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: edualfaia on December 17, 2014, 06:53:31 PM
Hi guys,

does anyone have the u-boot source to NAND?

Thanks
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: fingolfin on February 09, 2015, 11:19:01 AM
Hi Mad Demus!!!!!!!!!
I am using board A20-OLinuXino-Micro-4GB
I am having running SD card with Debian.
I followed the procedure "HOWTO install a running SD-card image to A20-OLinuXino NAND flash"
Procedure is all done...
But when board boots from NAND and displays kernel messages....it stucks at one perticular location
Part of the Log is given below........
///////////////////////////////////////////////////////////////////////////
[    4.288896]   #0: sunxi-CODEC  Audio Codec
VFS: Cannot open root device "nand3" or unknown-block(0,0): error -6
[    4.299831] VFS: Cannot open root device "nand3" or unknown-block(0,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
[    4.314304] Please append a correct "root=" boot option; here are the available partitions:
<0>Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    4.329893] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[<c0015098>] (unwind_backtrace+0x0/0x138) from [<c0572d60>] (panic+0x8c/0x1d0)
[    4.345128] [<c0015098>] (unwind_backtrace+0x0/0x138) from [<c0572d60>] (panic+0x8c/0x1d0)
[<c0572d60>] (panic+0x8c/0x1d0) from [<c07e9d70>] (mount_block_root+0x174/0x228)
[    4.360519] [<c0572d60>] (panic+0x8c/0x1d0) from [<c07e9d70>] (mount_block_root+0x174/0x228)
[<c07e9d70>] (mount_block_root+0x174/0x228) from [<c07ea004>] (mount_root+0xf4/0x114)
[    4.376506] [<c07e9d70>] (mount_block_root+0x174/0x228) from [<c07ea004>] (mount_root+0xf4/0x114)
[<c07ea004>] (mount_root+0xf4/0x114) from [<c07ea188>] (prepare_namespace+0x164/0x1c8)
[    4.393014] [<c07ea004>] (mount_root+0xf4/0x114) from [<c07ea188>] (prepare_namespace+0x164/0x1c8)
[<c07ea188>] (prepare_namespace+0x164/0x1c8) from [<c07e9a24>] (kernel_init+0x1d4/0x218)
[    4.409781] [<c07ea188>] (prepare_namespace+0x164/0x1c8) from [<c07e9a24>] (kernel_init+0x1d4/0x218)
[<c07e9a24>] (kernel_init+0x1d4/0x218) from [<c000f7a8>] (kernel_thread_exit+0x0/0x8)
[    4.426462] [<c07e9a24>] (kernel_init+0x1d4/0x218) from [<c000f7a8>] (kernel_thread_exit+0x0/0x8)
<2>CPU1: stopping
[    4.437004] CPU1: stopping
[<c0015098>] (unwind_backtrace+0x0/0x138) from [<c0013bb0>] (handle_IPI+0x194/0x1c8)
[    4.447186] [<c0015098>] (unwind_backtrace+0x0/0x138) from [<c0013bb0>] (handle_IPI+0x194/0x1c8)
[<c0013bb0>] (handle_IPI+0x194/0x1c8) from [<c00084fc>] (gic_handle_irq+0x50/0x58)
[    4.463259] [<c0013bb0>] (handle_IPI+0x194/0x1c8) from [<c00084fc>] (gic_handle_irq+0x50/0x58)
[<c00084fc>] (gic_handle_irq+0x50/0x58) from [<c000e880>] (__irq_svc+0x40/0x70)
[    4.478896] [<c00084fc>] (gic_handle_irq+0x50/0x58) from [<c000e880>] (__irq_svc+0x40/0x70)
Exception stack(0xef065f88 to 0xef065fd0)
[    4.490977] Exception stack(0xef065f88 to 0xef065fd0)
5f80:                   ffffffed 00000001 0ffe9000 00000000 ef064000 ef064000
[    4.502883] 5f80:                   ffffffed 00000001 0ffe9000 00000000 ef064000 ef064000
5fa0: c0896448 c057e994 ef064000 410fc074 c0840b90 00000000 ffff8c76 ef065fd0
[    4.517903] 5fa0: c0896448 c057e994 ef064000 410fc074 c0840b90 00000000 ffff8c76 ef065fd0
5fc0: c000f80c c000f810 60000013 ffffffff
[    4.529808] 5fc0: c000f80c c000f810 60000013 ffffffff
[<c000e880>] (__irq_svc+0x40/0x70) from [<c000f810>] (default_idle+0x28/0x30)
[    4.541717] [<c000e880>] (__irq_svc+0x40/0x70) from [<c000f810>] (default_idle+0x28/0x30)
[<c000f810>] (default_idle+0x28/0x30) from [<c000fb44>] (cpu_idle+0xd0/0x114)
[    4.556750] [<c000f810>] (default_idle+0x28/0x30) from [<c000fb44>] (cpu_idle+0xd0/0x114)
[<c000fb44>] (cpu_idle+0xd0/0x114) from [<4056f5f4>] (0x4056f5f4)
[    4.570744] [<c000fb44>] (cpu_idle+0xd0/0x114) from [<4056f5f4>] (0x4056f5f4)
<6>[hotplug]: cpu(0) try to kill cpu(1)
[    4.581436] [hotplug]: cpu(0) try to kill cpu(1)
<3>[hotplug]: try to kill cpu:1 failed!
[    5.589473] [hotplug]: try to kill cpu:1 failed!
///////////////////////////////////////////////////////////////////////////
I can see 2 penguins of Olimex on my LCD screen.
Please help...where possibly the problem is???

Quote from: Mad Demus on October 22, 2013, 12:47:16 PM
Today I successfully installed the official Debian Image into A20-OLinuXino's flash.

First, download and uncompress this file which contains the bootloader and an image of the flash partition scheme:

http://dtmh.de/files/olinuxino-a20-flashinstall.zip (http://dtmh.de/files/olinuxino-a20-flashinstall.zip)

After that, change into the folder which contains the uncompressed files.

Now, here is the quick recipe:

#############################################################################
# HOWTO install a running SD-card image to A20-OLinuXino NAND flash
#
# The following steps must be executed as root and on a running SD-card image!
#
# Sunxi kernel 3.4.43 or later is required.
# Tested with official Olimex Debian Wheezy image with kernel 3.4.61+
#
# The flash partition scheme will looks like follow:
# /dev/nanda is BOOT device
# /dev/nandc is ROOT device
# /dev/nandb is MAGIC device
#
#############################################################################

# First of all, make sure that all nand devices /dev/nand* are unmounted
# (check output of mount if you are not sure)

# Copy A20 flash partition image to NAND flash
tar -xzOf nand_part.gz | dd of=/dev/nand
sync


# reboot to make new partitions available
reboot

# after reboot: create filesystems
mkfs.vfat /dev/nanda
mkfs.ext4 /dev/nandc
echo -e 'ANDROID!\0\0\0\0\0\0\0\0\c' > /dev/nandb


# mount new filesystems
mkdir /mnt/nanda
mkdir /mnt/nandc
mount /dev/nanda /mnt/nanda
mount /dev/nandc /mnt/nandc


# install bootloader to /dev/nanda
rm -rf /mnt/nanda/*
rsync -avc bootloader/* /mnt/nanda


# copy script.bin and uImage into new root device under /boot
mount /dev/mmcblk0p1 /boot
rsync -avc /boot/script.bin /boot/uImage /mnt/nandc/boot/


# if you need additional kernel arguments, you can create a uEnv.txt file under
# /mnt/nandc/boot/ wich contains the following line:
Quoteextraargs=<your extra kernel args here>

# copy rootfs
rsync -avc --exclude-from=exclude.txt / /mnt/nandc
sync


# shutdown and remove SD card
shutdown -h now

# now power on the device and it should boot from NAND!

Enjoy!
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: bremenpl on March 02, 2015, 02:04:48 PM
Hello,
I was trying to use this tutorial to install debian on the NAND flash with A20-SOM board. Everything went well, but after reboot without the sd card I could not boot the NAND flash. Are there any additional steps that should be taken that are not described? I Would aprichiate all help.
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: JohnS on March 02, 2015, 03:12:56 PM
How far does it get?  Show console output...

John
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: bremenpl on March 03, 2015, 09:10:27 AM
This is the output of uart debug console:
https://pastebin.com/mgdSP6Zm
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: davidahoward on March 13, 2015, 10:51:19 PM
It looks like it gets to:

VFS: Cannot open root device "nand3" or unknown-block(0,0): error -6
[    3.885981] VFS: Cannot open root device "nand3" or unknown-block(0,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
[    3.900442] Please append a correct "root=" boot option; here are the available partitions:
<0>Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    3.916014] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: JohnS on May 01, 2015, 12:23:05 AM
@bremenpl so did you change root= ?

John
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: banata on May 18, 2015, 01:15:38 PM
@JohnS Please be more detailed about root parameter. Where is the file containing this row and what to write after
root = ....?

There are lines in the tutorial:
# if you need additional kernel arguments, you can create a uEnv.txt file under
# /mnt/nandc/boot/ wich contains the following line: (without the leading #)
# extraargs=<your extra kernel args here>

So try to write some parameters there! 

I have another questions:

When I run boot from nand the booting stop here:

HELLO! BOOT0 is starting!
boot0 version : 2.0.0
read dram para.
dram driver version: 1.15
dram size =512MB
0xffffffff
super_standby_flag = 0
Succeed in opening nand flash.
block from 2 to 6
deal block 2
Succeed in reading Boot1 file head.
The size of Boot1 is 0x00068000.
The file stored in 0x00000000 of block 2 is perfect.
Check is correct.
Ready to disable icache.
Succeed in loading Boot1.
Jump to Boot1.

HERE IS BLA BLA BLA

[       1.427] NB1 : init ok
[       1.429] flash init finish
[       1.434] fs init ok
[       1.436] fattype FAT12
[       1.437] fs mount ok
[       1.441] nand good_block_ratio=870
[       1.443] storage_type=0
[       1.455] 0
[       1.470] can't find c:\drv_hdmi.drv
[       1.470] ERR: wBoot_driver_install display driver failed
[       1.474] key value = 0
[       1.476] recovery key high 40, low 4
[       1.481] show pic finish
[       1.483] load kernel start
[       1.495] load kernel successed
[       1.495] start address = 0x4a000000
[       1.497] [LOGICCTL_ERR] LML_Write, invalid bufaddr: 0x0x697bf103
[       1.503] ERR: display driver not open yet
[       1.508] jump to

I don't have c:\drv_hdmi.drv  :)
If somebody have idea ...

Have fun,
Boyan
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: JohnS on May 18, 2015, 07:13:58 PM
I suppose it will be documented as part of Linux kernel doc.  Or try google.  Or read the sources :)

Which debian & kernel are you using?

John
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: banata on May 20, 2015, 03:07:49 PM
I,m with a20_Lime_debian_3.4.90_release_3.img and olinuxino-a20-flashinstall from the first post.
This message is in boot.axf file and inside are some binary data and error massages.

I will search around for another file to test with or how do biuld my own.
Boyan
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: JohnS on May 20, 2015, 03:14:05 PM
You're using Lime kernel but not Lime board? Likely won't work.

John
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: banata on May 25, 2015, 11:56:03 AM
Unfortunately it is A20

https://drive.google.com/file/d/0B98p8sw5CUeidlJrUGtVSE0xbjA/preview (https://drive.google.com/file/d/0B98p8sw5CUeidlJrUGtVSE0xbjA/preview)

Boyan
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: JohnS on May 25, 2015, 12:05:12 PM
What do you mean?  Your post is in thread A20-Micro and you said Lime.  It's critical what you use.

John
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: lauhub on October 09, 2015, 06:20:56 PM
Quote from: Mad Demus on October 22, 2013, 12:47:16 PM
Today I successfully installed the official Debian Image into A20-OLinuXino's flash.

First, download and uncompress this file which contains the bootloader and an image of the flash partition

...


Hello,

I would like to compile (and configure) my own bootable images for a NAND. Please can you tell us how did you create the zip file that you provide ?

Do you use u-boot ? How do you compile it (branch, commands) ?

Or which tutorial, documentation, did you follow ?


Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: JohnS on October 10, 2015, 02:29:07 AM
Very old thread so don't expect any reply.

Olimex and others have posted things on here, the net, etc, so go reading...

John
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: lauhub on October 10, 2015, 03:41:09 PM
Yes, I also noticed that last answer was in May 2015, so I have hope :)

I already read a lot, and as Mad Demus seems to have some information, I just ask.
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: luimarma on November 06, 2015, 06:53:24 PM
As some people have problems following the installation and it was also not workking for me with the last stable olimex image (wheez release 10), I add here what I have found usefull in my case.
The latest oficial image has nand support compiled as a module and not static in the kernel, thus  the root file system cannot be mounted.
I wanted to avoid the fact of recompiling the kernel, instead I created a uImage with the kernel untouched and a initramfs with all molules in.
You can download it at https://drive.google.com/file/d/0B_9NYwOX30jYcE90WFJ2akJJcXc/view?usp=sharing
Copy this file to /mnt/nandc/boot as an aditional step of Mad Demus post (thanks for the post) just after
# mount /dev/nandc /mnt/nandc
Also I founf that also after this still the root could not be found, but in this case it was a naming convention problem.
Create a file called uEnv.txt under /mnt/nandc/boot and add the following line:
extraargs=root=/dev/nandc

If you follow Mad Demus post and add this two things to the recipe it will work like a charm.
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: LubOlimex on November 23, 2015, 08:23:03 AM
Hey guys,

The latest releases of the images for all A20 boards include a script for easy installation to the NAND memory. Links to torrents with the latest images are available at the wiki article for your board.

You need to prepare a microSD card with the latest Debian Jessie image for your board and then boot. Then execute "nandinstall" and wait. That is all you need to do.

Best regards,
Lub/OLIMEX
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: oldpenguin on November 23, 2015, 09:33:58 PM
Hello all

Be sure to follow the advice that is written when flash programming is done

Pass 5: Checking group summary information
/dev/nandb: 39624/243360 files (0.2% non-contiguous), 220636/972528 blocks

*** Success! remember to REMOVE your SD card from board ***
*** Read http://tinyurl.com/qyee5k2, if the board won't boot from NAND ***

That was my case. I had to download and compile bootfix (need libusb-1.0).
The procedure to start FEL mode is a bit tricky. You'd be better be an octopus to be able to do all these things at once  ;)
Connect power, press both reset and recovery buttons, connect mini usb cable, release reset button, and finally release the recovery button. The board is now in FEL mode.
Confirm running dmesg in the host system.
Now run ./bootfix
When it finishes, the board boots immediately from flash  :)

Its too bad there's no way to program the "hidden" part from the code itself.

Regards
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: pete_l on December 08, 2015, 05:23:04 PM
Quote from: LubOlimex on November 23, 2015, 08:23:03 AM
Hey guys,

The latest releases of the images for all A20 boards include a script for easy installation to the NAND memory. Links to torrents with the latest images are available at the wiki article for your board.

You need to prepare a microSD card with the latest Debian Jessie image for your board and then boot. Then execute "nandinstall" and wait. That is all you need to do.

Best regards,
Lub/OLIMEX
OK just to make sure I'm crystal clear and there is no doubt. The "latest release" on the website at this time is Debian Jessie release 4: A20-OLinuXino-MICRO Debian Jessie with kernel 3.4.103+ release 11
Will this install onto NAND ?  ... stay tuned and I'll answer my own question  :D


.... and the answer is: yes it does. Write the 2GB image to an SD card, boot that, su to root, run nandinstall and sit back. No tricks, complications or intervention.
When you are asked to reboot, wait until all the LEDs stop flashing and the screen goes blue before pulling the power cord out.

Good job!
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: bpir1 on May 15, 2017, 03:56:23 PM
I have A20-Olinuxino-Micro with 4gb NAND flash olimex Board. I am trying to load the Debian jessie NAND image to NAND flash using method given in the following link.

https://www.olimex.com/wiki/How_to_install_Debian_to_NAND

I have downloaded the A20-OLinuXino-MICRO Debian Jessie with kernel 3.4.103+ release 14.img and installed into 8GB micro SD Card using Win 32 Disk Imager. Then I am using the nandinstall command but it is giving following error

root@A20-OLinuXino:~# nandinstall


#    #   ##   #####  #    # # #    #  ####
#    #  #  #  #    # ##   # # ##   # #    #
#    # #    # #    # # #  # # # #  # #
# ## # ###### #####  #  # # # #  # # #  ###
##  ## #    # #   #  #   ## # #   ## #    #
#    # #    # #    # #    # # #    #  ####


Your data on /dev/nand will lost, Are you sure to continue?[y/n] y
Re-partitioning NAND device
usage: /usr/lib/nandinstall/nand-part [-f a10|a20] nand-device
       /usr/lib/nandinstall/nand-part nand-device 'name2 len2 [usertype2]' ['name3 len3 [usertype3]'] ...
       /usr/lib/nandinstall/nand-part [-f a10|a20] nand-device start1 'name1 len1 [usertype1]' ['name2 len2 [usertype2]'] ...

Also I tried the nand-part command but the result is same only.
root@A20-OLinuXino:~# nand-part -f a20 /dev/nand
usage: nand-part [-f a10|a20] nand-device
       nand-part nand-device 'name2 len2 [usertype2]' ['name3 len3 [usertype3]'] ...
       nand-part [-f a10|a20] nand-device start1 'name1 len1 [usertype1]' ['name2 len2 [usertype2]'] ...
root@A20-OLinuXino:~#

Also there is no output through the HDMI display(Means no display output). I logged in with ssh and executed the commands. Also there is no /dev/nand file present.

Please help with this problem.

Thanks
Bpir1
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: JohnS on May 15, 2017, 04:36:51 PM
Maybe you're affected by the first thing in the FAQ in the link you posted?

John
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: bpir1 on May 16, 2017, 10:54:12 AM
I tried the FAQ procedure also. But the problem is as soon as I connect the Olinuxino a20 Board to the computer with Phoenixsuit running, the computer will receive an exception and it will start rebooting.

I had followed the following procedure to load android to olinuxino a20 board.

https://www.olimex.com/wiki/A20-OLinuXino-MICRO#Android_images

But the result is same.
Please help me with this

Thanks
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: LubOlimex on May 16, 2017, 04:14:46 PM
Try as root - "sudo su nandinstall". If the problem persists please try to execute the script via serial connection (USB<->serial cable).

In all scenarios the script should complete successfully. If the boot regions are not properly configured, nothing would boot without a card. But the install script should complete successfully anyway. What you posted doesn't seem like an error.

Also try a few more times to execute the script (it bugs sometimes and stops in the beginning, I don't know why).

Best regards,
Lub/OLIMEX
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: bpir1 on May 17, 2017, 07:36:17 AM
Hi Thanks for the reply.

I have logged in to the Olinuxino A20 board using SSH connection with root as username and password as olimex. Then I am trying the nandinstall command.

root@A20-OLinuXino:~# nandinstall


#    #   ##   #####  #    # # #    #  ####
#    #  #  #  #    # ##   # # ##   # #    #
#    # #    # #    # # #  # # # #  # #
# ## # ###### #####  #  # # # #  # # #  ###
##  ## #    # #   #  #   ## # #   ## #    #
#    # #    # #    # #    # # #    #  ####


Your data on /dev/nand will lost, Are you sure to continue?[y/n] y
Re-partitioning NAND device
usage: /usr/lib/nandinstall/nand-part [-f a10|a20] nand-device
       /usr/lib/nandinstall/nand-part nand-device 'name2 len2 [usertype2]' ['name3 len3 [usertype3]'] ...
       /usr/lib/nandinstall/nand-part [-f a10|a20] nand-device start1 'name1 len1 [usertype1]' ['name2 len2 [usertype2]'] ...


Now I am trying to first load the official android image for Olinuxino A20 board using Phoenixsuit. But the thing is after loading for 5%, image loading is getting stuck.

Following is the screenshot of the phoenixsuit which gets stuck at the 5%.



(http://file:///home/shrikant/Desktop/olimax_error_pic.png)

Please help me with this.
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: bpir1 on May 17, 2017, 10:45:46 AM
Hi,

I have a20-olinuxino-Micro with 4GB nand flash. I am using the A20-OLinuXino-MICRO_Debian_Jessie_with_kernel_3.4.103+_release_14.img. But the image is not having any of the NAND drivers. There are no files called /dev/nand, /dev/nanda, /dev/nandc.

Is their any debian images with nand drivers, Please Tell me what should I do?

Thanks
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: LubOlimex on May 18, 2017, 10:26:12 AM
Hello again,

I managed to get the same error if I try to run nandinstall script on a board with eMMC flash.

I believe that your board has eMMC flash instead of NAND flash.

If your board has eMMC memory instead of NAND memory, use the image suitable for eMMC and run ./emmc.sh script instead. Note that images for boards with NAND and eMMC are different. It is also explained here:

https://www.olimex.com/wiki/How_to_install_Debian_to_eMMC

The image suitable for A20-OLinuXino-eMMC is this one: https://www.olimex.com/wiki/images/c/cd/A20_OLinuxino_Micro_debian_Jessie_34_103_2G_EMMC_release_14.torrent

Best regards,
Lub/OLIMEX
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: bpir1 on December 06, 2017, 06:22:09 AM

Hi all,

I have A20-Olinuxino-Micro-n8gb NAND flash board. I am trying to install Linux NAND image. I have downloaded the linux image for NAND flash and gave nandinstall command but I am getting following error.


#    #   ##   #####  #    # # #    #  ####
#    #  #  #  #    # ##   # # ##   # #    #
#    # #    # #    # # #  # # # #  # #
# ## # ###### #####  #  # # # #  # # #  ###
##  ## #    # #   #  #   ## # #   ## #    #
#    # #    # #    # #    # # #    #  ####


Re-partitioning NAND device
check partition table copy 0: mbr: version 0xa7dfce57, magic �6}7߳
magic �6}7߳ is not softw411
check partition table copy 1: mbr: version 0xa7dfce57, magic �6}7߳
magic �6}7߳ is not softw411
check partition table copy 2: mbr: version 0xa7dfce57, magic �6}7߳
magic �6}7߳ is not softw411
check partition table copy 3: mbr: version 0xa7dfce57, magic �6}7߳
magic �6}7߳ is not softw411
all partition tables are bad!
check partition table copy 0: mbr: version 0xa7dfce57, magic �6}7߳
check partition table copy 1: mbr: version 0xa7dfce57, magic �6}7߳
check partition table copy 2: mbr: version 0xa7dfce57, magic �6}7߳
check partition table copy 3: mbr: version 0xa7dfce57, magic �6}7߳

ready to write new partition tables:
mbr: version 0x00000200, magic softw411
2 partitions
partition  1: class =         DISK, name =   bootloader, partition start =      128, partition size =    16384 user_type=0
partition  2: class =         DISK, name =        linux, partition start =    16512, partition size =        0 user_type=0

write new partition tables? (Y/N)

verifying new partition tables:
check partition table copy 0: mbr: version 0xa7dfce57, magic �6}7߳
magic �6}7߳ is not softw411
check partition table copy 1: mbr: version 0xa7dfce57, magic �6}7߳
magic �6}7߳ is not softw411
check partition table copy 2: mbr: version 0xa7dfce57, magic �6}7߳
magic �6}7߳ is not softw411
check partition table copy 3: mbr: version 0xa7dfce57, magic �6}7߳
magic �6}7߳ is not softw411
all partition tables are bad!
rereading partition table... returned 0
Check partition table

*** Re-partition NAND device /dev/nand failed, Partition table has damaged ***

To fix the partition table, You can try to run nandinstall again. If the error still there, then you need to use livesuit restore a factory image first, then run nandinstall.

After this error, I rerun nandinstall command, still same error. Please tell me the solution to it.

Thanks
Bpipi
Title: Re: How to install Debian on NAND in A20-MICRO?
Post by: JohnS on December 06, 2017, 01:38:01 PM
See your other post of this problem
https://www.olimex.com/forum/index.php?topic=5987.0

John