i.MX6x SABRE Lite SPI Flash Recovery

Setup Recovery Media

These images where extracted from:

wget https://rcn-ee.net/deb/tools/mx6qsabrelite/factory/u-boot-2014-04/u-boot.mx6qsabrelite

Format microSD/SD card:

For these instruction, we are assuming: DISK=/dev/mmcblk0, “sudo fdisk -l” is useful for determining the device id…

export DISK=/dev/mmcblk0

Erase microSD/SD card:

sudo dd if=/dev/zero of=${DISK} bs=1M count=30

Create Partition Layout:

sudo sfdisk --in-order --Linux --unit M ${DISK} <<-__EOF__
1,20,0x83,-
__EOF__

Format Partitions:

for: DISK=/dev/mmcblk0
sudo mkfs.ext2 ${DISK}p1 -L boot
 
for: DISK=/dev/sdX
sudo mkfs.ext2 ${DISK}1 -L boot

Mount Partitions:

On some systems, these partitions may be auto-mounted…

sudo mkdir -p /media/boot/
 
for: DISK=/dev/mmcblk0
sudo mount ${DISK}p1 /media/boot/
 
for: DISK=/dev/sdX
sudo mount ${DISK}1 /media/boot/

Copy Factory Images to microSD/SD card:

sudo cp -v u-boot.mx6qsabrelite /media/boot/v2014.04.imx

Remove microSD/SD card:

sync
sudo umount /media/boot

Upgrade factory v2009.08 → factory v2014.04

Set mmcdev based on what microSD/SD device you are using
using: SD media

setenv mmcdev 0

using: microSD media

setenv mmcdev 1

Load v2013.04.imx and flash to SPI

mmc dev ${mmcdev}
ext2load mmc ${mmcdev}:1 0x10800000 v2014.04.imx
sf probe 1 27000000
sf erase 0 0xc0000
sf write 0x10800000 0x400 ${filesize}

Remove power, microSD/SD, and re-apply power.

Upgrade factory v2013.04 → factory v2014.04

Set mmcdev based on what microSD/SD device you are using

using: SD media

setenv mmcdev 0

using: microSD media

setenv mmcdev 1

Load v2014.04.imx and flash to SPI

mmc dev ${mmcdev}
ext2load mmc ${mmcdev}:1 0x10800000 v2014.04.imx
sf probe
sf erase 0 0xc0000
sf write 0x10800000 0x400 ${filesize}

Remove power, microSD/SD, and re-apply power.

Restore Bootloader via USB

Move SW1 from 00 → 01 (usb otg) to boot from usb-otg…
Note: it helps not have any microSD/SD card inserted into the board during powerup on…
lsusb:

Bus 008 Device 007: ID 15a2:0054 Freescale Semiconductor, Inc. i.MX6Q SystemOnChip in RecoveryMode

Build imx_usb_loader

sudo apt-get -y install build-essential libusb-1.0-0 libusb-1.0-0-dev
git clone git://github.com/eewiki/imx_usb_loader.git
cd imx_usb_loader/
make

Restoring: v2014.04

With imx_usb, select u-boot.nitrogen6q

cd imx_usb_loader/
sudo ./imx_usb ../u-boot.nitrogen6q

Insert mmc device into board:

Set mmcdev based on what microSD/SD device you are using

using: SD media

setenv mmcdev 0

using: microSD media

setenv mmcdev 1

Load v2014.04.imx and flash to SPI

mmc dev ${mmcdev}
load mmc ${mmcdev}:1 0x10800000 v2014.04.imx
sf probe
sf erase 0 0xc0000
sf write 0x10800000 0x400 ${filesize}

Flashing Log:

U-Boot > setenv mmcdev 1
U-Boot > mmc dev ${mmcdev}
mmc1 is current device
U-Boot > load mmc ${mmcdev}:1 0x10800000 v2013.04.imx
338164 bytes read in 103 ms (3.1 MiB/s)
U-Boot > sf probe
SF: Detected SST25VF016B with page size 4 KiB, total 2 MiB
U-Boot > sf erase 0 0xc0000
U-Boot > sf write 0x10800000 0x400 ${filesize}
U-Boot >

Remove power, usb cable, microSD/SD, move jumper back to 00, and re-apply power.

U-Boot 2013.04-00308-ge1290a7 (Jun 18 2013 - 13:38:20)
CPU:   Freescale i.MX6Q rev1.0 at 792 MHz
Reset cause: POR
Board: SABRE Lite
DRAM:  1 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
SF: Detected SST25VF016B with page size 4 KiB, total 2 MiB
*** Warning - bad CRC, using default environment
No panel detected: default to HDMI
enable_hdmi: setup HDMI monitor
Display: HDMI (1024x768)
In:    serial
Out:   serial
Err:   serial
Net:   using phy at 6
FEC [PRIME]
Warning: failed to set MAC address
Hit any key to stop autoboot:  0
AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part
No port device detected!
** Bad device size - sata 0 **
** Bad device size - sata 0 **
SATA device 1: unknown device
** Bad device sata 1 **
** Bad device sata 1 **
MMC: no card present
mmc0(part 0) is current device
MMC: no card present
** Bad device mmc 0 **
MMC: no card present
** Bad device mmc 0 **
MMC: no card present
mmc1(part 0) is current device
MMC: no card present
** Bad device mmc 1 **
MMC: no card present
** Bad device mmc 1 **
6x_bootscript not found
serial console at 115200, 8N1
details at http://boundarydevices.com/6q_bootscript
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
       scanning usb for ethernet devices... 0 Ethernet Device(s) found
U-Boot >

Comments

Any questions or comments please go to our TechForum: TechForum