Burning Flash
Burning Flash
Introduction
In this chapter the steps required to migrate code from being loaded and run via CCS to running
autonomously in flash will be considered. Given the HexAIS and Flashburn tools, this is a simple
process that is desired toward the end of the design cycle.
Objectives
At the conclusion of this module, you should be able to:
•
Describe the startup events under CCS and when booting via Flash
•
Compare the CCS GEL startup file with the HexAIS INI file
•
Install the HexAIS and Flashburn utilities
•
Build a GEL script to launch HexAIS and the Flashburn utility
•
Convert an OUT file to HEX format using HexAIS
•
Burn a HEX format program into flash using the Flashburn utility
Module Topics
Burning Flash ...........................................................................................................................................12-1
System Startup Actions...........................................................................................................................12-2
CCS GEL and HexAIS .ini Files ............................................................................................................12-3
Cache Setup via Config Tool or BCACHE API .....................................................................................12-4
Build Process Steps................................................................................................................................12-5
HexAIS ...................................................................................................................................................12-6
GEL Scripts to Launch HexAIS and Flashburn .....................................................................................12-7
Flashburn...............................................................................................................................................12-8
Lab : Flash Programming....................................................................................................................12-10
BIOS System Integration Workshop - Burning Flash
12 - 1
System Startup Actions
System Startup Actions
System Startup – CCS Load vs Flash Boot
1.
RESET goes high
1.
RESET goes high
2.
Sample boot pins
2.
Sample boot pins
3.
Peripheral, CPU registers reset
3.
Peripheral, CPU registers reset
4.
Load demo from FLASH
- IRAM / Cache setup
5.
CCS halts CPU
6.
Initialization GEL file sets up:
- Interrupts
- EMIF
4.
AIS .INI code sets up:
- Interrupts
- EMIF
7.
CCS loads code & data to test
5.
Load code from FLASH to RAM
8.
CCS releases target on ‘run’ cmd
- Reset routine (_c_int00)
- BIOS_init()
- main()
- init
6.
Program begins from 0x 0000 0000
- Reset routine (_c_int00)
- BIOS_init()
- main()
- init
- IRAM/Cache setup
- BIOS_start()
- BIOS scheduler begins
- BIOS_start()
- BIOS scheduler begins
3
12 - 2
BIOS System Integration Workshop - Burning Flash
CCS GEL and HexAIS .ini Files
CCS GEL and HexAIS .ini Files
CCS GEL File
‹
Provided
by TI
‹
Puts DSP
in mode
good for
most users
‹
Can be
modified
as desired
‹
Runs on
CCS
connect to
target
5
hexAIS Conversion .ini File
‹
Provided by TI
‹
Puts DSP in mode
good for most users
‹
Can be modified as
desired
‹
Runs on boot from
flash
‹
Specifies behavior of
‹
Boot Mode
‹
PLL
‹
DDR
‹
EMIF
‹
PinMux
‹
Pwr Domains
6
BIOS System Integration Workshop - Burning Flash
12 - 3
Cache Setup via Config Tool or BCACHE API
Cache Setup via Config Tool or BCACHE API
Cache Setup via BCACHE API
#include
<bcache.h>
// headers for BIOS Cache functions
DDR2BASE = (char *) 0x80000000;
DDR2SZ = 0x07D00000;
cachesize;
// Pointer to DDR2 base addr struct
// size of DDR2 area on DM6437 EVM
// L1 and L2 cache size struct
setCache() {
char *
int
BCACHE_Size
BCACHE_setMode(BCACHE_L1D, BCACHE_NORMAL); // set L1D cache mode to normal
BCACHE_setMode(BCACHE_L1P, BCACHE_NORMAL); // set L1P cache mode to normal
BCACHE_setMode(BCACHE_L2, BCACHE_NORMAL); // set L2 cache mode to normal
cachesize.l1dsize = BCACHE_L1_32K;
cachesize.l1psize = BCACHE_L1_32K;
cachesize.l2size = BCACHE_L2_0K;
BCACHE_setSize(&cachesize);
// L1D cache size 32k bytes
// L1P cache size 32k bytes
// L2 cache size ZERO bytes
// set the cache sizes
BCACHE_inv(DDR2BASE, DDR2SZ, TRUE);
// invalidate DDR2 cache region
BCACHE_setMar(DDR2BASE,DDR2SZ,BCACHE_MAR_ENABLE); // all DDR2 is now cacheable
}
7
Cache Setup via Config Tool
8
12 - 4
BIOS System Integration Workshop - Burning Flash
Build Process Steps
Build Process Steps
Build Steps : CCS/Debug vs Flash
evmdm6437.gel
CCS: Project / Build
CCS: Project / Build
file.out
file.out
CCS: File / Ld Pgm
DM643x.ini
Hex AIS
file.hex
FbConfig1.cdd
Flashburn
Flash
Flash
DDR2
DDR2
Cx: L1, L2
Cx: L1, L2
6437 DVEVM
6437 DVEVM
10
BIOS System Integration Workshop - Burning Flash
12 - 5
HexAIS
HexAIS
Hex Conversion Utility (hex6x.exe)
hex.ini
app.hex
¾ ASCII-hex
app.out
hex6x
¾ Tektronix
¾ Intel MCS-86
¾ Motorola-S
¾ TI-tagged
‹
Converts an “.out” file into one of several hex formats
suitable for loading into an EPROM programmer
‹
Boot-loader copies code/data from FLASH to IRAM/SDRAM
‹
When using the hardware boot, you do not have to relink your program
with run/load addresses - HEX6x takes care of this for you
‹
If desired, code/data can still be accessed from flash at run-time
12
Map file representation of COPY_TABLE
Example-hex.map
CONTENTS:
64000000..6400011f
64000120..640003ff
64000400..6400af13
.hwi_vec
.sysinit
.trcdata
.gblinit
.cinit
.pinit
.const
.text
.bios
.stack
.trace
.rtdx_text
.args
.log
.LOG_system$buf
.logTrace$buf
.sts
6400af14..6407ffff
.boot_load
FILL = 00000000
BOOT TABLE
: btad=64000400 dest=00003000 size=00000200
: btad=6400060c dest=00003520 size=00000360
: btad=64000974 dest=00002d68 size=0000000c
: btad=64000988 dest=00002d74 size=00000034
: btad=640009c4 dest=00003880 size=00001454
: btad=64001e20 dest=00002da8 size=0000000c
: btad=64001e34 dest=00002db4 size=000000cf
:‹
btad=64001f0c
size=00003960
HEX
all
‹ By
By default,
default,dest=00004ce0
HEX AIS
AIS adds
adds
all
: btad=64005874
dest=00008640
size=00003ee0
“initialized”
sections
to
the
: btad=6400975c
dest=0000c520
size=00000400
“initialized” sections to the
: btad=64009b64
size=00000200
bootloader
table
bootloaderdest=0000c920
table
: btad=64009d6c dest=0000cf60 size=00000ee0
: btad=6400ac54 dest=00002fc0 size=00000004
: btad=6400ac60 dest=00002fc4 size=00000030
: btad=6400ac98 dest=0000e300 size=00000100
: btad=6400ada0 dest=0000e400 size=00000100
: btad=6400aea8 dest=0000e2a0 size=00000060
FILL = 00000000
13
12 - 6
BIOS System Integration Workshop - Burning Flash
GEL Scripts to Launch HexAIS and Flashburn
GEL Scripts to Launch HexAIS and Flashburn
CCS GEL Menu
14
CCS Project View
15
BIOS System Integration Workshop - Burning Flash
12 - 7
Flashburn
Flashburn
Launching FlashBurn
17
FlashBurn Configuration
NOTE
18
12 - 8
BIOS System Integration Workshop - Burning Flash
Flashburn
Getting the FlashBurn Tool
19
BIOS System Integration Workshop - Burning Flash
12 - 9
Lab : Flash Programming
Lab : Flash Programming
In this lab an out file will be loaded to the on-board flash memory so that the program may be run
when the board is powered up, with no connection to CCS.
1. Open CCS and load your most recent prior solution project myWork.pjt
2. For HexAIS to include processor setup configuration, a processor specific .ini file must be
present in the same folder as the .out file to be converted. Thus,begin by copying
DM643x.ini from C:\dvsdk_1_01_00_15\flashburn_files\hexAIS to the …\debug
and/or \release folders
3. Via the CCS GEL menu, select: hexAIS Conversion, then choose which version to
convert (debug or release). A DOS window should open reporting “Hex Conversion is
complete”. Close this window to continue
4. From the GEL menu select FlashBurn -> Start. The “Flashburn Startup” panel opens after
a few moments. The first time this utility is used, select “Open an existing FlashBurn
Configuration”. From C:\ProgramFiles\SoftwareDesignSolutions\
FlashBurnDSK\examples\EVMDM6437\ select FBConfig1.cdd. (The next time the
tool is invoked, this file can be selected from the Open a recent FlashBurn Configuration list).
Wait while FlashBurn connects to the EVM (“step 1”) and downloads the FBTC (the target
side flashburn program). Each step will be confirmed by a green check mark. If the step two
checkmark does not appear, click on “Re-download FBTC” and the confirmation should
appear. Once completed, the base addresses and size values should appear. If not, click on
‘Run’ in CCS and the program should complete
5. Specify the file to burn to the flash: Browse to \BIOS\Labs\Work\Release (or Debug) and
select mywork.hex
6. Prepare the flash to be programmed by pressing Erase the Flash. This takes a few minutes,
and can be observed via the progress bar that is shown
7. Now the new code can be written to the flash memory. Click the Program Flash button to
burn the new program into the flash. Again, wait for the process to complete as shown by the
progress bar
8. Close FlashBurn and CCS. Disconnect the USB and power cords to the EVM. Re-apply
power, and verify that the program is running on the EVM independent of CCS
9. When done testing the downloaded program, restore the original EVM code: Reconnect the
USB cable and start CCS. Via the GEL menu restart FlashBurn using the FBConfig1.cdd
configuration. As before, erase the flash. From C:\dvsdk_1_01_00_15\flashburn_files\ select
dm6437_demo.hex and click Program Flash. Once the programming is comlete, the board
will once again boot with the original demo program.
12 - 10
BIOS System Integration Workshop - Burning Flash
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising