ANALOG DEVICES EE-280 Service Manual

Engineer-to-Engineer Note EE-280
r
a
Technical notes on using Analog Devices DSPs, processors and development tools
Visit our Web resources http://www.analog.com/ee-notes and http://www.analog.com/processors o e-mail processor.support@analog.com or processor.tools.support@analog.com for technical support.
In-Circuit Flash Programming on ADSP-2106x SHARC® Processors
Contributed by Jeyanthi Jegadeesan Rev 2 – March 19, 2007

Introduction

Modern embedded processor systems are equipped with non-volatile memory devices such as EPROM or flash memories. This provides an easy way to later reprogram memory with new content to correct problems in the current firmware or to enhance system capabilities.
With the advent of flash memories, it is now possible to save data permanently and update it when necessary without removing the component from the system. Flash memories are also an asset in systems that need to save data during a power outage or brownout. The processor can store its code/data contents from volatile internal memory to an external, non-volatile memory, and on revival of the system, rewrite the old information back to the processor. ADSP-2106x SHARC® processors can be booted from a single 8-bit-wide memory device like EPROM, EEPROM, or flash.
This EE-Note provides the details of interfacing the flash to the external port on ADSP-2106x processors. It also demonstrates programming the in-circuit flash with two approaches.
The first approach uses the flash programmer driver, which works with the VisualDSP++® Flash Programmer utility. The flash programmer driver code is provided to demonstrate how the flash on the EZ-KIT Lite® board can be programmed for PROM booting. The flash programmer driver code in the associated .ZIP file is provided for the ADSP-21065L EZ-KIT Lite board. The flash programmer driver code
Copyright 2005-2007, Analog Devices, Inc. All rights reserved. Analog Devices assumes no responsibility for customer product design or the use or application of customers’ products or for any infringements of patents or rights of others which may result from Analog Devices assistance. All trademarks and logos are property of their respective holders. Information furnished by Analog Devices applications and development tools engineers is believed to be accurate and reliable, however no responsibility is assumed by Analog Devices regarding technical accuracy and topicality of the content provided in Analog Devices Engineer-to-Engineer Notes.
can be used to program the M29W040B 512-KB flash available from STMicroelectronics. The same code can be modified for all the other ADSP-2106x processors.
The second example code is a flash programmer application that programs the boot image into the flash directly. The example code in the associated .ZIP file is available for the ADSP­21061 processor, and the same code can be modified for the other processors.
In-Circuit Flash Programming on
L
SHARC Processors (EE-223)
[5]
discusses programming the flash on ADSP-2116x, ADSP-2126x, ADSP­2136x, and ADSP-2137x SHARC processors.

Hardware Interface

The flash memory must be interfaced to the BMS space of the processor for booting from the flash. The address bus, data bus, BMS# and RD# signals must be connected as shown in Figure 1. Data lines D23:16 of the ADSP-21060, ADSP-21061, and ADSP-21062 processors must be connected to data lines 21065L processors, data lines connected to data lines number of address lines depends on the size of the flash. To program the flash, the the processor must to be connected to the signal of the flash as shown in Figure 2.
D7:0 of the flash. For ADSP-
D7:0 must be
D7:0 of the flash. The
WR# signal of
WE#
a
Flash Interface on the ADSP­21065L EZ-KIT Lite Board
The EPROM on the ADSP-21065L EZ-KIT Lite board is mapped to the BMS space of the ADSP­21065L processor. Refer to Figure 1.
ADSP-21065L
A17-0
D7-0
/BMS
/RD
Figure 1. EEPROM interface on the ADSP-21065L EZ-KIT Lite board
The EPROM socket provided on the ADSP­21065L EZ-KIT Lite board cannot be used for the flash as is. Figure 2 shows the connections between the flash and the ADSP-21065L EZ­KIT Lite board.
ADSP-21065L
A17-0
D7-0
/BMS
/RD
/WR
Figure 2. ADSP-21065L flash interface
The /WR signal of the ADSP-21065L EZ-KIT Lite must be connected to the flash on the EZ-KIT Lite board.
EPROM (M27V201)
A17-0
Q7-0
/E /G
FLASH (M29W040B)
A17-0
D7-0
/E (Pin 22) /G (Pin 24)
/W (Pin 31)
/W signal of the

Flash Programmer Driver

The flash programmer driver files included in the associated .ZIP file programs the input.ldr file into the flash. The flash programmer driver is used with the VisualDSP++ Flash Programmer utility. To program the flash, the flash programmer driver is loaded into memory initially. After loading it into memory, the flash programmer driver:
Allocates memory to hold the input.ldr file
contents
Initializes the sector's start and end addresses
for the GUI
Resets the flash and verifies the device ID
The input.ldr file is also loaded into the memory using the Flash Programmer utility. After loading it, the flash programmer driver:
Erases the flash Writes the contents of input.ldr into flash Verifies the data
The flash programmer driver uses the following functions to write to and read from the flash:
WriteFlash ReadFlash
/BMS signal is used as the chip select signal
The for the flash. This signal is asserted low by setting the
SYSCON register before accessing the flash. When
BSO (boot select override) bit of the
the BSO bit is set, external port DMA accesses can enable the /BMS signal only. The flash programmer driver uses DMA channel 9 to write to and read from the flash. The WriteFlash and
ReadFlash functions set the BSO bit of the SYSCON register and initiate an external port
DMA using channel 9. After initiating the DMA transfer, the processor waits in idle mode for the transfer to end. Once the transfer ends, the processor comes out of idle mode and reset the
BSO bit of the SYSCON register for normal
accesses.
In-Circuit Flash Programming on ADSP-2106x SHARC® Processors (EE-280) Page 2 of 8
a

Programming the Flash

The flowchart of Figure 3 shows the steps to program code into flash using the Flash Programmer utility.
Start
Generate the User_Application.ldr file using
the VisualDSP++ loader utility
Load the Flash Programmer driver into
the internal memory
Load the User_Application.ldr file into the
internal memory
Erase the Flash
Programmer. The flash programmer driver uses the data loaded into internal memory from the
user_application.ldr file. It erases the flash
and then programs the flash with the new data. Once the user application is validated, it can then be programmed into the flash. The example code contains the Blink.dxe and Blink.ldr files, which can be used to program the flash. The
Blink.exe file can be loaded and tested on the
EZ-KIT Lite board. Then the Blink.ldr file can be programmed into the flash. The following two steps describe the generation of the loader file using the VisualDSP++ tools and how to program the flash for the user application using the flash programmer driver.
The flash can also be programmed using the Flash Programmer application provided with this EE-Note. For the Flash Programmer application, the user_application.ldr file is used as part of the internal memory. The application erases the flash initially, and then reads the
user_application.ldr contents from internal
memory and programs the flash.
Program the Flash with the
User_Application.ldr file
End
Figure 3. Using the flash programmer driver
The 21065LEZFlash.c file available with the flash programmer driver contains a generic flash programming algorithm. The blink project files, which toggle the ADSP-21065L processor's flags and blinks the LEDs on the EZ-KIT Lite board, are used as an example. Build and test
user_application.dpj to program the user
application into the flash. Then generate
user_application.ldr with the VisualDSP++
loader. The flash programmer driver and the data from the into internal memory using the Flash
user_application.ldr file are loaded

Step 1. Create the PROM Boot Image

Use the VisualDSP++ loader utility to generate the boot-image for the user application code.
To generate the loader file, select Loader file as the output file type in the Project Options dialog box for
user_application.dpj
(Figure 4). The Flash Programmer utility accepts the data in
hexadecimal format. For the flash programmer project the loader file must be generated with ASCII format.
The
user_application.ldr file is generated by
selecting
Hex as the boot format as shown in
Figure 5. When the project is built using the
Rebuild Project command (via Build menu or
toolbar button), the user_application.ldr file is generated.
In-Circuit Flash Programming on ADSP-2106x SHARC® Processors (EE-280) Page 3 of 8
Loading...
+ 5 hidden pages