1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Recovery Procedure

Discussion in 'iMX6 (MCE)' started by ChrisM, Jul 15, 2014.

Thread Status:
Not open for further replies.
  1. ChrisM

    ChrisM Administrator Staff Member

    If your iMX6 with a MCE (Linux) based firmware won't boot up, the following procedure can often help.
    If these steps are beyond your comfort level (or you don't have a PC with a Linux install you can use), I would try using the Android recovery procedure, flashing the firmware there, then finally flashing the MCE firmware (please send a message to support@droidbox.co.uk with your original eBay/Amazon order ID and your account name, if you need the link).

    ***

    How to create Amlogic recovery SD card from Linux
    Amlogic recovery SD card is used when device is bricked, when bootloader does not exist on boot device (SPI chip or NAND) or it is corrupted.

    Linux (any distribution) is most convenient OS for creating that kind of card. Basically, card is created that way that first 3 cylinders on card are reserved for bootloader. FAT32 partition follows (starts on sector 3 to the end of sdcard).

    Let’s say we want to create recovery card for MX board. MX uses u-boot.img as bootloader name. We will asume that our device is bricked and needs complete firmware reinstall.
    So, we need: u-boot.img for that device and rest of firmware (update.zip and recovery.img which is recovery kernel + tools, usually Android recovery system).

    We will asume this:
    Our sdcard is: /dev/sdb
    First partition: /dev/sdb1
    Mountpoint for sdcard: /home/stane/recoverysd

    First we will unmount our sdcard if it is mounted

    Code:
    sudo umount /home/stane/recoverysd
    Next we will raw copy u-boot.img from our current folder to sdcard (not partition!)

    Code:
    sudo dd if=u-boot.bin of=/dev/sdb bs=640
    Now we have to delete all existing partitions on sdcard and create only one that will start from 3rd cylinder. Most newer Linux distros uses also newer version of fdisk utility which consider cylinders for display/entry unit as deprecated, so before any action you have to enable it by issuing “u” in fdisk and pressing enter key.

    So, lets start with fdisk. We will start it with following command:

    Code:
    sudo fdisk/dev/sdb
    in fdisk, as I said earlier we will first issue u command and hit enter which will result with message: Changing display/entry units to cylinders (DEPRECATED!)
    Just ignore it and contine.

    Next step is to delete all existing partitions from our sdcard. Hit d command and after that hit p command to see current partition status on your sdcard.
    Repeat this step until all partitions are deleted.

    After issuing p output should look like this:

    Code:
    Command(mforhelp): p
    
    Disk/dev/sdb:16.0GB,16009658368bytes
    64heads,32sectors/track,15268cylinders
    Units=cylinders of2048*512=1048576bytes
    Sector size(logical/physical):512bytes/512bytes
    I/Osize(minimum/optimal):512bytes/512bytes
    Disk identifier:0x94d4b0e9
    
      Device Boot Start  EndBlocks  Id System
    with no partitions listed.
    When we cleared our partition layout, its time to create new one.

    To do that, issue n command and create primary partition (by selecting p option on next menu).
    When fdisk asks for partition number, leave empty (1st is by default) and continue.
    Now comes our cylinder part. Fdisk will ask you for First cylinder. Put there 3 and continue.
    Next, it will ask for last cylinder. Leave default value (just press enter).

    Ok, partition is created, but its raw for now. We have to assign filesystem to it (which will be FAT32). So, issue t command and after that b command (b is code for FAT32 partition type).

    When done, with these steps, issue w command which will write changes to sdcard and will exit fdisk.

    Ok, now we have to format our newly created partition which we will do with issuing command:

    Code:
    sudo mkfs.msdos/dev/sdb1
    When partition is formatted, you have two options. Either you will re-insert your card to cardreader, or you will mount it manually to folder from which we unmounted it.

    If you choose second option, issue command as follows:

    Code:
    sudo mount/dev/sdb1/home/stane/recoverysd
    When mounted, copy all your firmware files to sdcard and properly unmount it and eject from your cardreader. You can unmount it within your Linux distro file manager or with command:

    Code:
    sudo umount/home/stane/recoverysd
    Now your recovery sdcard is ready to use.

    When you finished with recovery of your box, you’ll probably want to back your card to normal (because using it in another box, might brick it).

    We are going to do that by raw copying few kilobytes of zeros to start of sdcard (after we unmounted it) with following command:

    Code:
    sudo dd if=/dev/zero of=/dev/sdb count=1000
    After procedure is finished, start fdisk as before (which will warn you that your drive/card is corrupted) and just issue w command. Fdisk will write changes to sdcard and exit.

    After that, start fdisk again and create your new partition (none exists anymore) as you did before, just use default values. After that, format the file system on your sdcard and thats it.

    Hope it helped someone [​IMG]

    Stane1983

    ********

    Copied (with kind permission) from http://www.stane1983.com/amlogic/how-to-create-amlogic-recovery-sd-card-from-linux/

    Thank you Stane1983
     
    Last edited: Aug 17, 2016
  2. ChrisM

    ChrisM Administrator Staff Member

Loading...
Thread Status:
Not open for further replies.

Share This Page