EVM6418 FlashBurn Overview
FlashBurn is a utility included with Code Composer Studio that can be used to program code and data into the on-board Flash on the EVM. One of the most common uses for FlashBurn is to take user code that has been debugged with Code Composer and program it into the Flash so that the board will boot it and run in standalone mode when it is powered up independently of the debug environment.
FlashBurn does not ship with standard configurations of Code Composer. However, it is available free of charge through Code Composer’s on-line Update Advisor. Use Update Advisor to download and install the FlashBurn install program.
This section describes how to burn a post into Flash using some pre-built example files, more detailed instructions on using FlashBurn can be found in the "FlashBurn Utility" section of the Code Composer Studio Online Help. The post and related files are in located in
c:\CCStudio\boards\evm6418\examples\post
EVM6418 FlashBurn Example
FlashBurn is a utility included with Code Composer Studio that can be used to program code and data into the on-board Flash on the EVM6418. One of the most common uses for FlashBurn is to take user code that has been debugged with Code Composer and program it into the Flash so that the board will boot it and run in standalone mode when it is powered up independently of the debug environment.
This section describes how to burn the POST into Flash using some pre-built example files. More detailed instructions on using FlashBurn can be found in the "FlashBurn Utility" section of the Code Composer Studio Online Help. The POST example and related files are located in
c:\CCStudio\boards\evm6418\examples\post
The following sequence outlines the POST programming sequence:
Create a bootloader image of the executable file in ASCII hex file format (post.hex).
Launch Code Composer Studio to allow access to the integrated tools.
Load the configuration document (demo.cdd) that tells FlashBurn what to burn into Flash.
Erase the Flash with FlashBurn.
Program the Flash with FlashBurn.
Programming a Hex File with FlashBurn
To start the FlashBurn process, launch Code Composer Studio. Now launch FlashBurn by clicking Tools -> FlashBurn.
FlashBurn will now launch. If it does not appear in the Tools menu, you can run it manually by running FlashBurn.exe in
c:\CCStudio\bin\utilities\FlashBurn
Use File -> Open to open the sample FlashBurn configuration document
c:\CCStudio\boards\evm6418\examples\post\post.cdd
You should see a window that looks like this:
The important fields are the "File To Burn" field at the top and the "FBTC Program File" at the bottom. The "File To Burn" field specifies the .hex file to program into Flash, in this case hex file created in the previous section:
c:\CCStudio\boards\evm6418\examples\post\post.hex
The "FBTC Program File" is a piece of code that FlashBurn executes on the EVM6418 to manipulate the Flash. It is supplied with the FlashBurn port in:
c:\CCStudio\boards\evm6418\flashburn\FBTC6418.out
Select the Program -> Erase Flash option under the Program menu to erase the Flash. It should take about 10 seconds. Now select Program -> Program Flash option to start programming the Flash. After about 20 seconds the procedure should be complete. Exit out of FlashBurn and Code composer and power cycle the EVM. The POST should start running automatically.
6418 Boot Process
When the EVM6418 comes out of reset, it copies 1Kbyte of data from the beginning of Flash memory (CE1, address 0x90000000) to the beginning of the EVM6418’s internal memory at address 0. It then jumps to address 0 and starts execution.
Since applications are significantly larger than 1Kbyte, a Flash bootable program includes a boot code stub in the first 1Kbyte region that loads the application from Flash. To make the process easier, the C6000 hex utility is capable of packing application code in an easy to parse bootloader table.
Making a Program Bootable
The BlinkDSK6418 example is a good example of a bootable BIOS program, open the BlinkDSK6418 project in
c:\CCStudio\boards\evm6418\flashburn\BlinkDSK6418
to view an example of the completed steps below:
Create a memory section called BOOT using the BIOS configuration tool under System -> Mem by right clicking on "MEM – Memory Section Manager" and selecting Insert MEM. The section should start at address 0 with a length of 0x400. If a memory section such as ISRAM already exists at address 0, you’ll need to move its start address to 0x400 and decrease its length by 0x400.
Add the boot code that parses the boot table to your program using Project -> Add Files to Project. You can use the boot.asm that comes with the POST as a base for your own projects. The boot code is stored in a section called .boot_load using the .sect directive at the top of boot.asm.
The .boot_load section defined in step 2 is a logical section. The BOOT section defined in step 1 is a real physical section. The linker command file specifies which logical memory sections should be linked in each physical memory section. Since the BIOS configuration tool only auto-generates a linker command file linking standard BIOS and C runtime sections, the auto-generated file postcfg.cmd will not include any references to the BOOT section you just created. Create a separate linker command file such as userlinker.cmd in the POST project that places the .boot_load section in BOOT and then include the autogenerated linker command file postcfg.cmd to add the standard references.
Generating a Bootable Hex File
This section describes the steps necessary to convert the post.out file into the post.hex file needed by FlashBurn as an example you can apply to your own programs. You do not have to perform these actions simply to put the BlinkDSK6418 in Flash if you have an existing hex file already.
A hex file contains binary data at the addresses you specify in a file format readable by the Flashburn utility and other Flash programmers. The utility requires several flags to select the proper output format. In this example, the flags are stored in the file post_hex.cmd which is a text file that can be edited to suit other purposes. The key flags are:
| Flag |
Description |
| -a |
Select ASCII hex file format for output |
| -memwidth 8 |
Generate output for an 8-bit wide Flash device |
| -bootorg 0x90000400 |
Address to place the boot table (base of Flash + 0x400) |
| -bootsection .boot_load 0x90000000 |
Place the .boot_load memory section at the beginning of Flash (address 0x90000000) |
To convert the file Debug\post.out into the hex file post.hex using the flags stored in post_hex.cmd, open a DOS Command Prompt window and type the following:
cd c:\CCStudio\boards\evm6418\examples\post
hex6x post_ahex.cmd
The file post_ahex.hex is now ready for programming with FlashBurn. For more details on the hex utility, please see the Code Composer help under Code Generation Tools -> Hex Conversion Utility.
|