NAND test for Acqua board

This procedure can be used to test the NAND FLASH onboard the Acqua board

Prepare a microSD

Use gparted as described here:

to prepare a blank microSD.

Fill the microSD with data

Follow this article in the Kernel Linux 4.4.13 part:

in order to fill the microSD with the two partitions needed:
boot.tar.bz2 in the first partition
rootfs.tar.bz2 in the second partition

Change the bootloader with another NAND enabled

Download the following file:

and put it in the first partition of the microSD.
Rename it as boot.bin

Update the Linux distribution

root@acqua:~# apt-get update

Install the mtd-utils package

root@acqua:~# apt-get install mtd-utils

Install unzip package

root@acqua:~# apt-get install unzip

Download the NAND test program

then copy the testnand.sh script on the /root directory of the microSD filesystem and make it executable with:

root@acqua:~# chmod +x testnand.sh 
root@acqua:~# 

Download the example directory tree to write on the NAND filesystem

copy it on the /root directory of the microSD filesystem and unzip it with:

root@acqua:~# unzip sam-ba_3.2.1.zip 

In order to be able to write on the microSD in ssh you need to enable the ssh login for root superuser in /etc/ssh/sshd_config.

Make a mount point for the NAND filesystem

root@acqua:~# mkdir /mnt/ubifs

Launch the NAND test script

root@acqua:~# ./testnand.sh

Example Log files

  • Boot Log Messages First boot
  • You can see there was no bad block table:

    nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
    nand: Micron MT29F2G08ABAEAWP
    nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
    atmel_nand 60000000.nand: minimum ECC: 4 bits in 512 bytes
    atmel_nand 60000000.nand: Initialize PMECC params, cap: 4, sector: 512
    atmel_nand 60000000.nand: Using NFC Sram read 
    Bad block table not found for chip 0
    Bad block table not found for chip 0
    Scanning device for bad blocks
    random: nonblocking pool is initialized
    Bad block table written to 0x00000ffe0000, version 0x01
    Bad block table written to 0x00000ffc0000, version 0x01
    6 ofpart partitions found on MTD device atmel_nand
    Creating 6 MTD partitions on "atmel_nand":
    0x000000000000-0x000000040000 : "at91bootstrap"
    0x000000040000-0x0000000c0000 : "bootloader"
    0x0000000c0000-0x000000180000 : "bootloader env"
    0x000000180000-0x000000200000 : "device tree"
    0x000000200000-0x000000800000 : "kernel"
    0x000000800000-0x000010000000 : "rootfs"
    

    The second boot will present some differences:

    atmel_nand_nfc 70000000.nfc: NFC is probed.
    atmel_nand 60000000.nand: Use On Flash BBT
    atmel_nand 60000000.nand: Using dma0chan0 for DMA transfers.
    nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
    nand: Micron MT29F2G08ABAEAWP
    nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
    atmel_nand 60000000.nand: minimum ECC: 4 bits in 512 bytes
    atmel_nand 60000000.nand: Initialize PMECC params, cap: 4, sector: 512
    atmel_nand 60000000.nand: Using NFC Sram read 
    Bad block table found at page 131008, version 0x01
    Bad block table found at page 130944, version 0x01
    6 ofpart partitions found on MTD device atmel_nand
    Creating 6 MTD partitions on "atmel_nand":
    0x000000000000-0x000000040000 : "at91bootstrap"
    0x000000040000-0x0000000c0000 : "bootloader"
    0x0000000c0000-0x000000180000 : "bootloader env"
    0x000000180000-0x000000200000 : "device tree"
    0x000000200000-0x000000800000 : "kernel"
    0x000000800000-0x000010000000 : "rootfs"
    

    Here is instead the printout of the NAND test script for reference:

    Ing. Roberto Asquini
    Hardware designer, manufactoring engineer, firmware developer and founder of Acme Systems srl

    asquini@acmesystems.it
    Github repository: https://github.com/asquini