This mode assumes that you have a board attached to your host PC through a communication port.
1. Plug your DM36x Leopard Board to a serial port, in this example we will assume that the serial port is /dev/ttyUSB0.
2. Turn On your board and stop it at the U-Boot prompt. In this example termnet is used to communicate with the board, and the autoboot was stopped to get to the Uboot’s prompt.
$ termnet 127.0.0.1 3001
Baudrate set to: 115200
Port Settings are: 8NC0S0
Port Device set to: /dev/ttyUSB0
Baudrate set to: 115200
Port Settings are: 8NC0S0
...
U-Boot 2010.12-rc2 (Nov 19 2013 - 09:25:06)
Cores: ARM 432 MHz
DDR: 340 MHz
I2C: ready
DRAM: 128 MiB
NAND: 256 MiB
MMC: davinci: 0, davinci: 1
Net: Ethernet PHY: GENERIC @ 0x00
DaVinci-EMAC
Hit any key to stop autoboot: 0
DM368 LEOPARD #
3. Close your terminal session (in this case termnet), so that OpenFD can communicate with U-Boot through the available serial port.
DM368 LEOPARD #
termnet>>quit
At this point you are ready to execute the openfd command.
At any time, you can query the supported/required arguments using -h or --help. The installer has positional arguments, so you can use the help at different levels.
openfd --help
openfd nand --help
openfd nand kernel --help
openfd env --help
openfd sd --help
...
General arguments are:
openfd --help
The installation to NAND supports installing these components:
Before anything, we have to setup the NAND memory map.
Take into account the NAND block size in the DM36x Leopard Board. You can obtain this information by issuing the nand info command in U-Boot.
This is important as you will setup your memory map specifying how much NAND blocks you want for each partition.
For each NAND partition you should specify:
For example, take that you want to reproduce this memory map:
+--------+-----------+-------------+
| Name | Start blk | Size (blks) |
+--------+-----------+-------------+
| ubl | 1 | 1 |
| uboot | 25 | 3 |
| kernel | 32 | 36 |
| rootfs | 68 | 1600 |
+--------+-----------+----------+---
A memory map file that implements the layout above, using the ConfigParser syntax:
[ipl]
name = ubl
start_blk = 1
size_blks = 1
image = ~/images/nandbin
[bootloader]
name = uboot
start_blk = 25
size_blks = 3
image = ~/images/bootloader.nandbin
[kernel] name = kernel start_blk = 32 size_blks = 36 image = ~/images/kernel.uImage
[fs] name = rootfs start_blk = 68 size_blks = 1600 image = ~/images/fsimage.uImage
Note that there is an intentional correspondence between the section names: [ipl], [bootloader], [kernel], [fs] and the actual component that you want to install. These section names can’t be changed, but still you can name a partition by it’s friendly name (i.e. ‘uboot’).
In the case of the [ipl] section, for a DM368x we will install UBL (“User Boot Loader”), in the [bootloader] section we will install U-Boot, and typically you would install Linux in [kernel] and some filesystem image in [fs] (like a ubifs or jffs2 filesystem).
Save your memory map to a file “nand-mmap.config”, and we will supply the filename to OpenFD as a CLI argument.
Note
The process of generating images for any component is outside the scope of this document.
Warning
There is a protected NAND partition for the “U-Boot environment”. In the DM36x it typically starts at block 30 (see U-Boot’s config variable CONFIG_ENV_OFFSET) and has a size of 2 blocks. Don’t write on top of it.
For NAND installation, several general arguments are required.
openfd nand --help
Serial port settings:
Network settings:
If your network does not support DHCP, you also have to manually specify your board’s IP:
Example of general arguments for NAND installation:
$ openfd \
nand \
--mmap-file ~/images/nand-mmap.config \
--serial-port /dev/ttyUSB0
--ram-load-addr 0x82000000 \
--host-ip-addr 10.251.101.24 \
--tftp-dir /srv/tftp \
--nand-blk-size 131072 \
--nand-page-size 2048
Warning
OpenFD uses TFTP to transfer the images to the board. It has been experienced that such transfer is very slow when your host PC is connected to the network via WiFi, we recommend that you plug both your host PC and your board to the network via ethernet.
Most of the components does not required any additional arguments, all the required information regarding components is provided by the --mmap-file (see Creating the NAND Memory Map).
All components, except the bootloader, implement the --force switch that can be used to force the component installation. This is because after installing the image to NAND OpenFD will save in uboot’s environment some variables that record the partition’s offset, size, and md5sum to avoid re-installing the component’s image if it’s not necessary.
As example, this command installs the kernel partition to NAND:
$ openfd \
--verbose \
nand \
--mmap-file ~/images/nand-mmap.config \
--serial-port /dev/ttyUSB0
--ram-load-addr 0x82000000 \
--host-ip-addr 10.251.101.24 \
--tftp-dir /srv/tftp \
--nand-blk-size 131072 \
--nand-page-size 2048 \
kernel \
--force
OpenFD also provides means to install a variable in Uboot’s environment.
openfd env --help
Serial port settings:
As example, this command installs the mtdparts U-Boot environment variable, corresponding to the memory map described in the Creating the NAND Memory Map section:
$ openfd \
env \
--serial-port /dev/ttyUSB0
--variable mtdparts \
--value mtdparts=davinci_nand.0:128k@128k(UBL),384k@3200k(UBOOT),4736k@4096k(KERNEL),204800k@8832k(ROOTFS) \
--force