It is assumed that the reader has working knowledge of how to program the product being used, and the product's features.
1. FlashtoolGUI Help
The FlashtoolGUI application provides the user with the ability to create, modify, and write flash content ON Semiconductor Imaging devices that support SPI flash and EEPROM memory.
When you start FlashTool, if a device is attached it will detect it and then load the appropriate SDAT file(s).
If no device is attached, you'll be able to manually load the appropriate SDAT file(s).
Here's a link to a "Tech Note" on NVM Record sizes.
1.1 Sensor Info Tab
The Sensor Info tab is presented first. This dialog lets you load the appropriate SDAT file(s) for the device you'll be working on.
It also presents some operational notes about the 2 other tabs - "Configuration" and "Generate Image and Program".
For example, if you want to program an existing binary file, simply select the "Generate Image and Program" tab.
Sensor Data File (.xsdat or .sdat)
The sensor data file is used by the application to convert the symbolic names of sensor registers and variables to numeric addresses.
ISP products (e.g. AP0102AT) have 2 SDAT files - one for the baseboard and another for the attached sensor.
SOC products (e.g. ASX350AT) have only 1 SDAT files.
1.2 Configuration Tab
The Configuration tab is where you load the configuration file (.fcfg), or FCFG file. It is also enables navigation to the various Table types via the "Select Table" Radio buttons.
1.2.1 Configuration File
FlashTool uses a text based file which describes the structure and content of the flash image. When the content of the flash has been specified, it can be saved into a configuration file through the Save and Program Page. A previously saved configuration file can be loaded into the tool in order to update its contents.
Although FlashTool has the ability to add Comments when creating and editing records, the user may manually add comments to any area of the configuration file; simply start each line with "#@" to indicate a user comment.
There are per-product sample files located in the folder "flashtool" under the installation folder.
For a detailed description of the syntax and structure of the configuration file refer to the document SPI Flash Programming Tool User Guide.
One thing to note is that not all sections are valid for all products, and they must be placed in a specific order;
Most Products | AP0101 / AP0201/2 Only |
---|---|
INIT_TABLE | INIT_TABLE |
CALIBRATION_INIT_TABLE | CALIBRATION_INIT_TABLE |
PATCH_INIT_TABLE | PATCH_INIT_TABLE |
DEWARP_INIT_TABLE or STE_INIT_TABLE | PATCH_TOC |
OVERLAY_INIT_TABLE | COMMAND_SEQ_TOC |
PATCH_TOC | |
OVERLAY_BITMAP_TOC | |
OVERLAY_STRING_TOC | |
COMMAND_SEQ_TOC | |
DEWARP_CONFIG_TOC or STE_CONFIG_TOC | |
OVERLAY_COLORLUT_TOC | |
OVERLAY_USERCHAR_TOC |
1.2.2 Tables
The "Select Table" section is used to select the Table that you want to modify.
Note: Distortion and Graphics Overlay do not apply to AP0101 and AP0201/2 products.
- Global; contains register and variable settings that don't apply to the other specific areas (such as Patch or Calibration).
- Patch; contains patches (some recommended, some optional on per-feature basis) to be applied.
- Calibration; contains settings that are specific to calibration.
- Distortion Correct; settings for devices that support distortion correction (also know as "DeWarp").
- Graphics Overlay; settings to define overlays available to the product.
- Command Sequence; settings where specific Host Commands can be defined.Vendor Specific; allows definition of custom records types.
1.2.3 General Table Controls
Each table contains a set of general controls to manipulate records.
Note: "Insert From Fcfg" doesn't apply to "Command Sequence" nor "Vendor Specific".
1.2.3.1 Convert INI
This dialog lets you load INI file Preset data from an INI file, or copy/paste the info. When using "Load Text", you must include the preset name as the first line.
Once loaded, select "Convert" to convert to records, and then "Add and Close" to add the records.
1.2.3.2 Add New Record
This dialog lets you create new records of various types. Select the Type, and the "Usage" will appear in the upper dialog.
You can optionally add comments in the "Record Comments" section, but you add the record data in the "Record parameters" section.
Note: selecting "Command" record type opens an additional pull-down dialog for you to select the actual command.
1.2.3.3 Insert from Fcfg
This dialog will add the records as defined in a .fcfg file. Note that the entire .fcfg file contents will be added as there is no way for FlashTool to determine which record types would apple to the given Table.
1.2.3.4 Edit Record and Delete Record
Self-explanatory really; edit or delete existing records. Note: no warning is given when selecting "Delete Record", and there is no "Undo" function.
1.2.4 Global Table
This dialog is used to define register and variable settings that don't apply to the other specific areas (such as Patch or Calibration).
1.2.5 Patch Table
In this table specify the list of firmware patches that need to be included in the flash image. Please note that when you locate a .bin file which includes the patch, the tool will also look for a file with a similar name ending with the extension .info. The .info file has to be the correct information file for the intended patch file.
Select the Command "Load_Patch" to create the record and use the associated index from the "Patch Table", and then add the associated patch to match that record.
Use "Rel. Path" to use a path relative to the FCFG file; not selecting this will use the full path.
1.2.6 Calibration Table
This table contains the calibration-specific settings for the device.
1.2.7 Distortion Correction Table
This table contains records for defining multiple Lens Distortion Correction settings. This will contain with DeWarp or STE Command records, and associated Lens Distortion Correction Table entries (either from .bin or .xml files) as created by either the Distortion Correction or STE plugins.
Each of the assets that have been included in their corresponding tables will be referenced using their index number. The indexes start with 0. A host command which makes use of one of these assets will use as part of its parameter list a reference to the asset index in the appropriate table.
Use "Rel. Path" to use a path relative to the FCFG file; not selecting this will use the full path.
It is assumed that the reader of this document has understanding of the Lens Distortion features and controls of the product they are working on.
1.2.8 Graphics Overlay
This table lets you define the records for load of the various types of overlays; Bitmaps, Strings, and Userchar.
- Bitmap; use this table to specify the list of graphics overlay bitmap file paths that need to be included in the flash image. The bitmap files have to be in Aptina RLE format, and they can be created using DevWare or makeover.exe.
- String; use this table to specify the list of graphics overlay string file paths that need to be included in the flash image. The string files have to be in binary format. They can be created using DevWare.
- Userchar; use this table to specify binary file containing the "Userchar" settings.
Use "Rel. Path" to use a path relative to the FCFG file; not selecting this will use the full path.
It is assumed that the reader of this document has understanding of the Overlay features and controls of the product they are working on.
1.2.9 Command Sequence
This table lets you define individual sequences of commands. Start by add a new Sequence in the "Sequences" dialog.
Select it, and then added the individual commands to be contained in that sequence via the "Add New Record" button.
Navigate between sequences via the "Sequences" table.
1.2.10 Vendor Specific
Use this dialog to define records specific to a vendor's definition. Then use "Edit Record" to customize the record.
Vendor-Specific Records in Initialization Tables
The flash contents specification defines the VENDOR_SPECIFIC_00 to VENDOR_SPECIFIC_15 record types, which may contain any arbitrary data of your choosing. When creating a vendor-specific record, select the sub-type of the record from 00 to 15, and enter the data in the Parameters window as a list of byte values.
Unfortunately, as of this writing, the firmware on the Aptina SOC chips does not recognize the vendor-specific record type, and triggers an error condition if it encounters one. It is possible to include vendor-specific records in an initialization table if the vendor-specific records are preceded by a Command record
- Config_Command_Seq_Processor 0
and followed by the command record
- Config_Command_Seq_Processor 1
That will turn off error checking and allow the firmware to skip over the vendor-specific records without generating an error condition. The Flash Tool does not automatically generate these Command records, you have to enter them.
Vendor-Specific Records Outside of Tables
It is also possible to put vendor-specific records at user-defined addresses in the flash memory, outside of any tables. To do this, select the Vendor-Specific button at the lower left of the window, and add the records to the list.
Note that the first parameter of an out-of-table vendor-specific record is the address where it is to be placed in flash. This is different from an in-table record where the only parameters are the data. The address must be greater than 0x00000030 so it does not interfere with the main Table of Contents. The Flash Tool will make sure the init tables and other flash data do not overlap the out-of-table records. If you create more than one vendor-specific record, you must ensure that they do not overlap.
1.2.11 How to create an initialization sequence
How to create an initialization sequence
- Select the table: select one of the tables Global, Patch, Calibration, Distortion Correction or Graphics Overlay.
- Create records: records can be created either directly by pressing the button New, or by importing DevWare presets using the Import button.
- Import
The import dialog allows the user to create flash records out of DevWare presets. Importing can be done either from an INI file or by directly typing or pasting text into the dialog window using the Load Text option.
If section presets are detected, the content of the preset can be viewed in the Preset Contents window. Some notes on using a text file with a Preset:
- The preset must have a standard name in brackets; for example, "[Timing settings]".
- Only lines that can be converted into flash records will be displayed; other lines are ignored.
- Lines will only be processed until the next preset name is found, or end-of-file is reached.
Pressing the Convert button will cause the tool to display the converted records. Until you press the Add and Close button, these records will not be added to the flash content.
The tool attempts to group the individual preset lines into a single flash record, in order to reduce the overhead associated with the record structure. The order of preset lines is maintained during the conversion process.
During the conversion process the above warning message may be displayed. This warning indicates that that records that perform operations on bitfields were detected. The warning does not indicate a problem, but only the fact that the syntax for specifying the value to be written is different between the DevWare presets and the flash tool. This is only important if you are trying to verify the conversion process and notice a change in the values used in the bitfield records.
- New Record
Select the type of record. You may add comments in the comments section, and the parameter list in the Record Parameters section, if applicable. The top most section will show some helpful hints about the selected record type, and any additional information.
For records which require numeric parameters, you may enter a sequence of parameters as necessary with a space or a comma delimiter between them.
The Test button allows you to verify the record in terms of consistency of the parameter list with the requirements for the record. If an incorrec number of parameters is provided for the record you will get an error.
When finished press the Finish button in order to insert the new record into the selected table.
Once the records of a table have been created it is possible to change their relative location by uding the Up and Down arrow buttons. It is also possible to edit or delete records as necessary.
In order to view the content of a record, select it. Its contents will be displayed inside the window Details of Selected Record. The record content will be displayed in the format of the configuration file which the flash tool uses to store and restore its contents.
Comments that may have been entered for the record will appear at the top of the record details where each comment line starts with the symbols #@.
1.3 Generate Image and Program Tab
This page allows the user to define the Memory Device parameters, produce a binary image for the current configuration, and program the flash with a previously created flash image.
1.3.1 Configure Memory Device
The the Memory Type (SPI Flash or EEPROM), the memory and maximum image sizes, and sector/block and page sizes. Memory type options associated with the selected device are displayed.
1.3.2 Generate Image
1.3.2.1 Image Type
Choose Base Image to create a complete image, which includes all tables and assets. This option is necessary in order to produce a valid initial flash image.
Choose Image Extension in order to produce a binary image of the assets only. This includes the patches, graphics overlay bitmaps and strings, and distortion correction configurations. An extension file is needed in order to add assets into an existing base image.
Choose Global Offset to produce a binary image that begins at a starting address greater than zero. Allows for the binary image to be customized offline.
1.3.2.2 Enable Spaces Mode
Adds extra Blank Records in the Table of Contents, Init Table, and all COMMAND_SEQ_V1. This allows extensibility after initial programming, but is a change from the original format. Please refer to Encoding Specification Section 6.4 for details.
The mode status is displayed on the main dialog screen (top-center). If this mode is enabled, a warning dialog will appear when the "Generate Binary Image" button is pressed, with the option to cancel the operation.
Note: this mode is not applied to the configuration file.
1.3.2.3 Memory Map
Enabling this will create a text file that contains a map of where in binary each item is located. The file will stored in the same location as the binary image.
1.3.2.4 Set Memory Map
This dialog allows you to specify specific locations for each of the Tables and TOC (Table of Contents).
The "Help" button displays the binary image format.
1.3.2.5 Generate Binary Image
Select to generate a binary image (.bin) of the flash memory configuration. This image can be written into flash using this or other tools. Note; if Spaces Mode is enabled (see "Global Settings/Enable Spaces Mode"), a warning dialog will appear when the "Generate Flash Image" button is pressed, with the option to cancel the operation
1.3.3 Program Memory Device
This dialog is used to write a binary file to the attached device using the parameters in the "Configure Memory Device" section.
Note: the fields will be greyed-out if no device is attached.
Start Address - Specify the flash address to begin writing the image to.
Erase Before Writing - The flash device content will be erased prior to programming the new content into it. Uncheck to suppress erasing the flash device content, this may be desirable if the area in the address space of the device has been erased before.
Program Image into Flash - Select the button to write an existing image to flash.
1.3.3.1 Post Program
Use the "Verify" button to compare the binary file data to what has just been write to the device.
Use the "Reset Sensor" button to perform a Reset procedure on the attached device.
1.3.4 Internal Only Options
In the internal version of FlashTool (only available to ON Semiconductor employees) has a couple of useful features.
These are internal-only due to their detailed nature of their usage and/or resulting files, the operation of which is best left to ON Semiconductor personnel.
1.3.4.1 Read Image from Flash
Select the button to read the flash memory image and save it to a binary (.bin) file.
1.3.4.2 Generate Configuration from Image
There are 2 options here;
- Convert .bin to .fcfg File; this operation will decode the information in the given binary file and create an associated FCFG file.
Note that resulting file will not be an exact match to the original FCFG file; comments, original patch file names, and other items are not stored in the binary file. - Convert current .fcfg to DevWare .ini File; this operation converts the FCFG commands in to the associated INI file commands.
The resulting INI file can then be used within DevWare with the product.
Note: This option is for debugging purpose only. The programming structure between FCFG and INI file is different. Not all Host command is supported by flashtool. User should use the converted INI file together with DevWare Host Command Interface plugin to get the correct results.
1.4 Miscellaneous Controls and Displays
The top row of FlashTool displays some useful information, as well as has a few more buttons.
On the right-hand side, the selected product and its revision are displayed.
Also, the Total number of records is displayed, along with the "Space mode" status.
1.4.1 Add Configurations
This button adds a new "Configuration" tab so a entirely new FCFG can be used. This enables the user to read in FCFG files for different things, letting them aggregate multiple FCFG files in to one image.
Currently, the use case would be for AGP patches, which in reality are a series of commands. For example, 4 .FCFG files containing AGP patches and insert them in the command stream where they are wanted. The basic idea is how to provide fragments of FCFG files to customers without having to re-write or hand assemble the final FCFG.
On parts like the AP0200, patches for the AGP are ISP commands. So take a number of patch FCFG files (remember, these are just normal commands, and not patch records), and open up their configuration (resolution, STE, etc), and import the patches one at a time, and have them inserted into flashtool where they are wanted This resolves the problem of having to hand edit the FCFG file and then open FlashTool.
Add Comment