world leader in high performance signal processing
Trace: » ldr-utils

ldr-utils

An LDR image is an image format that the Blackfin Boot ROM supports. On the host, is it normally represented by in an Intel hex-32 format files, or a binary file. The files support 8-bit-wide PROMs and are used with an industry-standard PROM programmer to program memory devices. One file contains data for the whole series of memory chips to be programmed. More information can be found on the VDSP++ 5.0 Loader and Utilities Manual or in the ADI App Note Blackfin Booting Process.

Normally U-Boot is the only thing that needs to create an LDR file, and it uses the ldr-utils which are included as part of the GNU Blackfin toolchain.

Source

The ldr-utils package is included as part of the Blackfin toolchain. It is not distributed separately. The source code is currently maintained in the Blackfin toolchain svn repository. It is a normal application, which is prefixed by the toolchain target prefixes: bfin-elf-ldr or bfin-uclibc-ldr or bfin-linux-uclibc-ldr are all the same, and can be used interchangeably.

Using ldr-utils

Getting help

This output is for example only; options change over time so you should run the utility with your installed toolchain to see what options are supported exactly.

$ bfin-uclinux-ldr
Usage: ldr [options] <-s|-d|-l|-c> [subcommand options] <arguments>

Options: -[fvqhVsdlcT:f]
  -s, --show       <ldrs>          * Show details of a LDR
  -d, --dump       <ldrs>          * Break DXEs out of LDR
  -l, --load       <ldr> <tty>     * Load LDR over UART
  -c, --create     <ldr> <elfs>    * Create LDR from binaries

  -T, --target     <target>        * Select LDR target
  -f, --force                      * Ignore problems
  -v, --verbose                    * Make a lot of noise
  -q, --quiet                      * Only show errors
      --debug                      * Enable debugging
  -h, --help                       * Print this help and exit
  -V, --version                    * Print version and exit

Most subcommands take their own arguments, so type:
        ldr <subcommand> --help
for help on a specific command.

Most subcommands take their own arguments, for help on a specific command:

$ bfin-elf-ldr --create --help

For example:

$ bfin-elf-ldr --create --help
Usage: ldr create [options] <arguments>

Options: -[fvqhVp:g:d:B:w:H:s:b:i:P:M]
  -p, --port            <F|G|H>         * (BF53x) PORT for HWAIT signal
  -g, --gpio            <#>             * (BF53x) GPIO for HWAIT signal
  -d, --dma             <#>             * (BF54x) DMA flag
  -B, --bits            <bits>          * (BF56x) Flash bits (8bit)
  -w, --waitstate       <num>           * (BF56x) Wait states (15)
  -H, --holdtimes       <num>           * (BF56x) Flash Hold time cycles (3)
  -s, --spibaud         <baud>          * (BF56x) SPI boot baud rate (500k)
  -b, --blocksize       <size>          * Block size of DXE (0x8000)
  -i, --initcode        <file>          * Init code
  -P, --punchit         <off:size[:filler]> * Punch an ignore hole
  -M, --use-vmas                        * Use ELF VMAs for target addresses
  -f, --force                           * Ignore problems
  -v, --verbose                         * Make a lot of noise
  -q, --quiet                           * Only show errors
  -h, --help                            * Print this help and exit
  -V, --version                         * Print version and exit

Creating a LDR

To create a ldr file from an elf file:

$ bfin-elf-ldr -T bf537 -c --bits 16 --dma 8 blink.ldr blink --bmode para
This should take the elf file blink and convert it to the blink.ldr file, which will boot from external flash on a BF537 processor.

Loading over the UART

The ldr-utils can be used to load applications over the UART (for those parts which support it over the BootROM).

On a Linux host

$ bfin-uclinux-ldr -l /tftpboot/u-boot.ldr /dev/ttyUSB0 && kermit -l /dev/ttyUSB0 -b 57600 -C connect
Loading LDR /tftpboot/u-boot.ldr ... OK!
Opening /dev/ttyUSB0 ... OK!
Configuring terminal I/O ... OK!
Trying to send autobaud ... OK!
Trying to read autobaud ... OK!
Checking autobaud ... OK!
Autobaud result: 115200bps 49.766mhz (header:0xBF DLL:0x1B DLH:0x00 fin:0x00)
Sending blocks of DXE 1 ... [1/2] [2/2] OK!
Sending blocks of DXE 2 ... [1/6] [2/6] [3/6] [4/6] [5/6] [6/6] OK!
You may want to run minicom or kermit now
Quick tip: run 'ldrviewer <ldr> <tty> && minicom'
Connecting to /dev/ttyUSB0, speed 57600
 Escape character: Ctrl-\ (ASCII 28, FS): enabled
Type the escape character followed by C to get back,
or followed by ? to see other options.
----------------------------------------------------
 0
bfin> version
U-Boot-1.1.3-ADI (Sep 28 2006 - 16:16:44)
bfin>

On a Windows host

 > bfin-uclinux-ldr -l /tftpboot/u-boot.ldr /COM1
Loading LDR /tftpboot/u-boot.ldr ... OK!
Opening /COM1 ... OK!
Configuring terminal I/O ... OK!
Trying to send autobaud ... OK!
Trying to read autobaud ... OK!
Checking autobaud ... OK!
Autobaud result: 115200bps 49.766mhz (header:0xBF DLL:0x1B DLH:0x00 fin:0x00)
Sending blocks of DXE 1 ... [1/2] [2/2] OK!
Sending blocks of DXE 2 ... [1/6] [2/6] [3/6] [4/6] [5/6] [6/6] OK!
You may want to run minicom or kermit now

Now, run your favorite Windows terminal program.