This document explains how to create a loader(.ldr) file and download the LDR image into flash on ADSP-SC5XX target.
A loader file is generated by the loader utility. The file typically has the .ldr extension and is often called an LDR file.
Steps to be followed:
(i) First, use ‘elfloader.exe’ or CCES IDE options to create a LDR loader (.ldr) file for your project.
(ii) Next, use the ‘command line device programmer (CLDP)’ to program the LDR image to flash.
1. Creating a Loader (.ldr) file:
Loader file can be created using two methods:
i. Using ‘elfloader.exe’
ii. Using CCES IDE options
(i). Using ‘elfloader.exe’ :
- Build the project for three cores.
- Collect all the below files together in the CCES installation “<installation path>:\Analog Devices\CrossCore Embedded Studio x.x.x” directory or modify the commands below with appropriate path references to them.
- Copy the initialization file from “<installation path>:\Analog Devices\CrossCore Embedded Studio x.x.x\SHARC\ldr”
- Copy project executables of Core0,Core1 and Core2.
Use the below example command to create a LDR file:
elfloader.exe -proc ADSP-SC589 \
-init ezkitSC589_initcode_core0_v01 \
-core0=Power_On_Self_Test_SC589_Cortex \
-core1= Power_On_Self_Test_SC589_SHARC_Core1.dxe \
-core2= Power_On_Self_Test_SC589_SHARC_Core2.dxe \
-NoFinalTag=Power_On_Self_Test_SC589_Cortex \
-NoFinalTag= Power_On_Self_Test_SC589_SHARC_Core1.dxe \
-b SPI -f HEX -Width 8 -bcode 0x1 -verbose \
-o Power_On_Self_Test_SC589.ldr
The example above makes use of the following switches:
-proc : Specify target processor name
-init : Direct loader to include the initialization code from File Name executable.
-core[012] : Used for multi core input for the ADSP-SC5xx / ADSP-215xx.
- NoFinalTag : Directs the loader to not set the FINAL flag on the final block for code built from the executable.
-b : Specify a boot mode for an ADSP-SC5xx/ADSP-215xx target
-f : Specify the format of output file, HEX(default), ASCII, BINARY or INCLUDE.
-Width : When building for ADSP-SC5xx/ADSP-215xx targets, use -Width 8. Defaults to 8.
-bcode : Specify the numeric value for the BCODE field in the ADSP-SC5xx target block headers
-verbose : Directs the compiler to display command-line information for all the compilation tools as they process each file.
Refer chapter "Loader Command-Line Switches for ADSP-SC5xx/ADSP-215xx Processors" in CCES-LoaderUtilities-manual for more details on all loader command line switches.
(ii) Using CCES IDE options:
- Assuming your executable project is already loaded into CCES, select any one core of the Project > Properties > C/C++ Build > Settings > Build Artifact tab.
- There you will see "Artifact Type". From the drop down menu select "Loader File".
- Click on the "Tool Settings" tab and select "CrossCore Blackfin Loader" then "General".
- For "Boot mode (-b)" choose "SPI master"( Select the boot mode as needed).
- For "Boot format (-f)" choose "Intel hex"( Select the boot format as needed).
- For "Boot Code (-bcode)" specify the SPIMCODE value for SPI master.
- Click on the “Initialization”. If you are using external memory you must select an appropriate "Initialization file" from the following location:
§ <installation path>:\Analog Devices\CrossCore Embedded Studio 2.6.0\SHARC\ldr - Select the “Executable Files”. Then
- Click on the "Browse..." button to browse and select the core0 executable(.dxe) file. Repeat the same for selecting the Core1 and Core2 executables.
- “Append core input without introducing a FINAL block (-NoFinalTag)” should be enabled for Core 0 and Core1.
(Note: When building an .ldr file with multiple .dxe files, -NoFinalTag prevents the boot from halting after the first .dxe completes)
Figure1: Executable file selection
- Select the “Executable Files”. Then
- Click "OK".
- Rebuild the project to generate the LDR file. This file will be available in the ‘Debug’ folder of the project.
2. Downloading the (.ldr) file to EZ-KIT using CLDP:
CCES contains a Command Line Device Programmer (cldp) utility which is invoked from a Command Prompt window as cldp.exe, which is available in the root directory of CCES.
Please note, there is no graphical user interface for the cldp within CCES, you can only make use of this utility via a Command Prompt window.
WARNING: The CLDP tool cannot be used from the command line if CCES is connected to the target board
- Create a folder which has the following files.
- Copy the device programmer interface application (DPIA) sc589_w25q128fv_dpia_Core1.dxe for SHARC core1 from your ADSP-SC58x 1.1.0 Board Support Package installation ADSP-SC58x_EZ - KIT\Examples\Device_Programmer\sc589\sharc\sc589_w25q128fv_dpia_Core1 directory.
- The loader(.ldr) file which need to be programmed.
- Below is the example command sequence for flashing a ADSP-SC589 target board which is being connected to via an ICE-1000.
cldp.exe -proc ADSP-SC589 \
-core 1 \
-emu ICE-1000 \
-driver sc589_w25q128fv_dpia_Core1.dxe \
-cmd prog \
-erase affected \
-format hex \
-file Power_On_Self_Test_SC589.ldr
The example above makes use of the following switches:
-proc : This sets the target processor if a valid name is passed, otherwise provides the list of supported processors.
-core : Sets the target emulator if a valid name is passed, otherwise provides the list of supported emulators.
-driver : Loads a device driver application prior to executing Device Programmer commands.
-cmd prog –file : Programs device memory with data from a file whose name is required, with or without verification. Options for this switch used in the example above are:
- -format [hex|bin|ascii] : Provides the file format. The default is hex.
- -erase [affected|all|none] : Provides the erase mode. The default is affected.
Detailed information regarding all available switches for the CLDP can be found in CCES Help using the following path:
CrossCore® Embedded Studio x.x.x > Integrated Development Environment > Working with Bootable and Non-bootable Files > Device Programmer > Device Programmer Command Line > Device Driver Command-Line Switches
NOTES Regarding Elfloader and CLDP:
- The continuation character, "\", is used to break the commands onto multiple lines above for readability and are not required.
- Depending on your environment the elfloader.exe may need to be run with your working directory set to the location of the elfloader.exe in your installation.
- The elfloader -f switch and the cldp -format switch must specify the same file format.
3. Booting the EZ-KIT from Flash Memory:
The last step involves configuring your board to boot from flash.
- Now configure the ‘Boot Mode’ Switch on your EZ-KIT to boot from flash memory.
- Refer to the "Boot Mode Select Switch" of the appropriate Evaluation System Manual for details on correctly setting the 'Boot Mode'.
- Once the appropriate Boot Mode is set simply reset your board to boot it from flash.
Evaluation System Manuals are available from CCES Help or online at the following location: