Installing Debian on NAND (Somebody PLEASE help me!)

Started by khashmeshab, July 29, 2014, 07:49:56 PM

Previous topic - Next topic

khashmeshab

Hello everybody.

I am new to this forum. But I am an experienced FreeBSD and Linux sysadmin. Also I am a programmer and software developer for almost 20 years. This problem drove me crazy. Here it is:

I have this 7-inch tablet based on A13 for 2 years. About a year ago, the touch-screen broke and instead of repairing it, I thought I use its ARM board as my home server. It was a good choice since it draws a little power, has battery, has 4GB NAND, WiFi, 512MB RAM, etc.

So I downloaded the ready-to-use Debian image from here: https://www.olimex.com/wiki/A13-OLinuXino and wrote it to a 8GB SD card. The Linux booted without any problem and recognized all of the hardware including NAND. Except that it was so slow since it was running from SD.

Then I followed the online manual about re-partitioning the NAND using nand-part and created a 16M boot partition starting from 16M and the rest for my root partition. I kept the existing android u-boot and other contents of nanda. Then I copied all of the contents of the SD card partition #2 to the nandb (using cp -a). Plus I copied uImage and script.bin from the SD card partition #1 to everywhere including nanda/, nanda/linux/, nandb/ and nanb/boot/.

BUT IT DOESN'T BOOT FROM NAND! I tried everything. Even using other u-boot.bin's I downloaded from other sites. Please somebody give me a clue. What is wrong? I would be very thankful if somebody guide me and I will be more than happy to give any more information needed.

Thank you all very much in advance.

khashmeshab

OK. Since nobody helped me so far (thank you very much!) I managed to boot from NAND by myself with one exception.

First I found a pin from the camera which was directly connected to the processor's UART1_TX. I disconnected the camera and then carefully soldered a wire to that and connected it to a USB<->serial converter's RX pin. I booted up the board from SD and got a lot of log messages from u-boot.bin and then the Linux kernel on my terminal. I found out that the kernel command arguments had "root=/dev/mmcblk0p2". So I created a uEnv.txt in SD partition #1 with this line:

extraargs=console=ttyS0,115200 root=/dev/nandb nand_root=/dev/nandb rootwait panic=10

And rebooted the system. With MicroSD card in the slot, the system booted up with /dev/nandb as the rootfs partition. Then I copied the first blocks of the MicroSD card's data to another MicroSD card (this one has just 128MB). It includes MBR, boot record and full SD partition #1, but without the partition #2 which was the rootfs. It booted up successfully indicating that it truly uses "/dev/nandb" as rootfs and only needed the SD boot section which included the u-boot.bin integrated into the SD boot record and uImage and script.bin from SD partition #1.

So far the speed difference is GREAT! OK. I think that the problem is with my u-boot.bin in /dev/nanda. I tried other u-boot.bin's with no luck. I also used these commands to extract the u-boot.bin from the SD card:

dd if=/dev/mmcblk0 of=~/u-boot.bin.1 bs=1024 skip=8 count=512

dd if=/dev/mmcblk0 of=~/u-boot.bin.2 bs=1024 skip=32 count=512

And copied the resulting file to /dev/nanda/linux/u-boot.bin. Neither of those worked. They didn't at least give me some logs on the serial port as they did on the SD card. I just get the logo picture on the screen, nothing on the serial port and the system just hangs there.

Any idea?

For those of you who might think what does this, a tablet's board, has to do with Olimex boards forum, I should tell you that the boards are similar in many ways. I easily booted up the Olimex's default Debian distribution on my board and it recognized all of my hardware. So, the hardware and software configuration is exactly the same. I'm just missing something that I'm pretty sure one of you experienced users are able to help me. Anything that crosses your mind might be helpful. Sharing any (even remotely) related similar experience is appreciated.

Thank you.

JohnS

At a guess no-one posted because the NAND etc subjects are so often posted and people thought you could use those.

John

khashmeshab

Thank you John.

But I've followed all of the existing guides step by step carefully and reached nothing. I wonder if there is something unsaid in the guides. Maybe I need to replace the first 1MB of my board's NAND (boot section) because the manufacturer put some kind of boot lock there. I posted here to get help from those who had similar experiences with this special situation (a tablet's board).

Would you please give me a sample procedure to install Debian on NAND? Thanks a lot.

JohnS

linux-sunxi wiki sounds more likely place for a tablet.

I've not wanted to mess with the NAND so mostly ignore posts about it.

John

oldpenguin

You can copy the mbr (1M) from an a13 image for NAND flash.
You have to take care that when you write the mbr because it includes the partition table, so it will probably destroy information you had previously written in flash.
Also the a13 mbr is only compatible with some model/size devices so be prepared to experiment a bit.