Flashing NAND using TI Flashing Utilities using RidgeRun SDK

From RidgeRun Developer Connection
Jump to: navigation, search

This wiki page is mostly useful for when you have a blank NAND memory and wish to install the whole ecosystem UBL/U-Boot/Kernel to NAND, and probably you have a limited environment, i.e. you have only serial communication available, with no Ethernet nor SD card possibilities. The wiki is based on a Leopard Board DM36x, but the general idea can be used for other platforms.

To obtain an evaluation version of RR SDK's, please refer to our Download Center.


1) RidgeRun SDK Configuration

For this particular problem, we assume the following setup in RR's SDK configuration.

Installer Configuration ->
  Firmware deployment mode ->
    "Attached board on communication port"
  Serial port for target communication: /dev/ttyUSB0 # Here your serial port
  Protocol for transfering images to the target: Serial # In case you do have access to Ethernet, please select TFTP as it is quicker

2) Set the board in BOOTME mode (UART boot)

For help on setting the Leo DM36x UART boot please refer to the BootRom section from the Getting Started Guide.

3) Load the RR SDK u-boot image to RAM using TI Flashing Utilities:

First, be sure you have the DEVDIR environment variable defined:

`make env`

Then use the slh_DM36x.exe program to load the u-boot image to RAM.

$DEVDIR/bootloader/u-boot-2010.12-rc2-psp03.01.01.39/ti-flash-utils/src/DM36x/GNU/slh_DM36x.exe -p /dev/ttyUSB0 -v -startAddr 0x82000000 -loadAddr 0x82000000 -load2DDR $DEVDIR/images/bootloader

Note 1: There's a chance that you have to run this command a couple of times if the first time it ends repeating "BOOTME" indefinitely. Run it until you get success. Here is how my output looked on a success run:

Waiting for SENDIMG sequence...
	Target:	SENDIMG
SENDIMG received. Returning ACK and header for image data...
ACK command sent. Waiting for BEGIN command... 
	Target:	  BEGIN
BEGIN commmand received.
 100% [                                                              ]
                           Image data sent..
Waiting for DONE...
	Target:	   DONE
DONE received.  All bytes of image data received...
	Target:	   DONE
	Target:	U-Boot 2010.12-rc2 (Jan 08 2014 - 17:11:44)
	Target:	Cores: ARM 297 MHz
	Target:	DDR:   243 MHz
	Target:	I2C:   ready
	Target:	DRAM:  128 MiB
	Target:	NAND:  256 MiB
	Target:	MMC:   davinci: 0, davinci: 1
	Target:	Net:   Ethernet PHY: GENERIC @ 0x00
	Target:	DaVinci-EMAC
	Target:	Hit any key to stop autoboot:  0 
	Target:	Card did not respond to voltage select!
Aborting program...
Interfacing to the DM36x via UART failed.
Please reset or power-cycle the board and try again...

You will note when it is right as it booted U-Boot, and then you can stop this program. In my case sometimes Ctrl+c was not enough and the way to stop it was to open my serial communication program, like minicom and termnet, and that will provoke slh to abort. From your serial communication program you should be able to see uboot's prompt.

Note 2: TI also provides an utility called sfh_*.exe to flash NAND, but it can give you some trouble on the Leo board, so I recommend just using slh_*.exe which we can use just to load an image to RAM (without flashing anything yet).

4) Install UBL/U-Boot

At the top level of your DEVDIR, the 'installbootloader' target will install UBL and U-Boot to NAND.

make installbootloader

Note 1: At the end, you will see a "failure" reported by RR SDK's installer:

  Restarting u-boot
Sending [reset]
  Error: failed to detect u-boot restarting.

Just ignore it, because it is failing to detect the restart because we are currently on UART boot.

5) Change to NAND boot (instead of UART boot)

Now that we have UBL/Uboot written to NAND, we can change the dip switches back to NAND boot and restart the board, and stop at uboot's prompt.

6) Install normally

After this, stay again in uboot's prompt, and install the rest of components (kernel, filesystem, bootargs, cmdline, etc.) as usual:

make install

See also

Recovering from NAND boot failed on a Leo DM36x using RidgeRun Linux SDK


Getting Started Guide for Leopard Board DM365 and DM368

Serial Boot and Flash Loading Utilities

SD Card boot and flashing tool for DM36x