AM335x Flash Image Builder User's Guide

= Overview =

AM335x Flash Image Builder is intended for use by the software engineering team to produce a flash archive file (*.tar.gz) that can be consumed by the AM335x Flash Programmer program (for Ubuntu Linux). The flash archive file contains all necessary U-Boot/SPL restore-flash images, "payload" images (to be programmed into flash memory) and flash configuration data (flash-programmer.conf file). This program is intended to be run from within the AM335x EZSDK Linux Software Development Kit and it has been validated to run on Ubuntu 10.04 LTS and Ubuntu 12.04 LTS. The installer is available separately from the EZSDK on www.ti.com. During installation, the destination folder needs to be changed to the "&lt;SDK_INSTALL_PATH&gt;/host-tools/" directory of the AM335x EZSDK. For customers who do not use the gcc compiler within the EZSDK as part of their infrastructure it is also possible to build your own images separately and create your own flash archive file for use by the AM335x Flash Programmer program.

See AM335x Flash Programmer for Ubuntu Linux User's Guide for more information about the AM335x Flash Programmer program.

= Prerequisites =

1. Linux host PC running Ubuntu 10.04 LTS or Ubuntu 12.04 LTS. 2. Linux EZ Software Development Kit (EZSDK) for the AM335x Sitara™ ARM® Microprocessor (v06.00.00.00 or later) must have been installed on the Linux host PC. 3. U-Boot sources need to be ported to your target hardware before they can be used with this flash tool.

= Procedure =

Step 1: Download and Install AM335x Flash Image Builder
The AM335x Flash Image Builder is part of the FLASHTOOL-AM335x software tool that is available at http://www.ti.com/tool/flashtool. Click the "Get Software" button next to FLASHTOOL-AM335x and it will take you to a download page containing two installation programs. The flash image builder program is intended for the software developer to create a flash archive file containing all required restore-flash U-Boot/SPL images, and images to program into flash memory. The flash archive file can then be sent to the production facility where it becomes the input file for the flash programmer program. The flash programmer program is used to program binary images into flash memory on AM335x system boards using a Ubuntu Linux host computer.  

Copy the am335x-flash-image-builder installer program onto a Ubuntu Linux host computer. Use the chmod command to make the installer program executable then run the installer.

Substitute the actual version numbers for xx.yy.zz.

Ubuntu# chmod +x am335x-flash-image-builder-01.xx.yy.zz-Linux-x86-Install

Ubuntu# ./am335x-flash-image-builder-01.xx.yy.zz-Linux-x86-Install

The installer program will run as described here.



Choose the installation language and click OK.



Click Yes.



Click Next.



Click Browse to change the destination folder.



Browse to the host-tools folder within the installed AM335x EZSDK and click OK.



Click Next.



Click Next.



Click Finish to complete the installation program.

Step 2: Apply U-Boot Patches Required for Flash Programming
The folowing patches must be applied to the u-boot sources that are provided with the AM335x EZSDK v06.00.00.00 for flash programming.

The following script has been provided which can be used to apply those patches by entering these commands: cd ~/ti-am335x-evm-06.00.00.00/host-tools/am335x-flash-image-builder/linux/scripts

./prework#1-patch-u-boot-sources.sh If not already instaled, this script will install the "zenity" program. Zenity just provides a graphical file browser for your convenience.

A file browser will appear. Select the path to the u-boot sources for your AM335x system and click OK.



Patches that were installed with the AM335x-Flash-Image-Builder installer will be copied to the top of the u-boot source tree and the patches will be applied. These patches will apply cleanly to the u-boot source code that is provided with the AM335x EZSDK v06.00.00.00. If the patches apply cleanly to your u-boot source code the response will be: patching file drivers/usb/gadget/ether.c patching file net/bootp.c patching file boards.cfg patching file include/configs/am335x_evm.h host $ If any of these patches do not apply cleanly to the u-boot source code for your AM335x system, you may need to make equivalent changes to the u-boot source code.

The patches are stored in the &lt;SDK_INSTALL_PATH&gt;/host-tools/am335x-flash-image-builder/linux/patches/u-boot/ folder.

Step 3: Create a UBIFS File System (for NAND Flash)
Creation of the UBIFS file system image is beyond the scope of this document. Information about how to build a UBIFS file system is included in the AM335x Flash Image Builder installation at ./linux/doc/How-to-make-a-UBIFS.txt. That includes example calculations for creating a file system that is expandable to 200 MiB using a 256 MiB NAND device. See also this wiki page Compiling UBIF Tools and Creating a UBIFS File System.

Step 4: Build the Payload Images to be Programmed into Flash Memory
This step will produce a large amount of compiler output text. In Ubuntu, go to Edit -&gt; Profile Preferences and select the "Scrolling" tab. For "Scrollback" check "Unlimited".



Before continuing, clear the terminal window contents by clicking Terminal -&gt; "Reset and Clear" in the Ubuntu terminal application menu.

The following script has been provided which can be used to build the payload images to be programmed into flash memory. For demonstration purposes, this script will build all required SPL and u-boot images as required for the AM335x GP EVM (NAND and SPI flash)

and the Beagle Bone community board (NAND and Muxed NOR capes). You may modify this script as required, for example, if you are only interested in building images for AM335x GP EVM

for NAND flash. The Linux Kernel image is copied from the EZSDK prebuilt-images folder.

Enter the following commands to run the script. cd ~/ti-am335x-evm-06.00.00.00/host-tools/am335x-flash-image-builder/linux/scripts

./prework#2-build-payload-images.sh A file browser will appear. Select the path to the u-boot sources for your AM335x system and click OK.



The terminal will then display compiler output until all the builds have been completed. This will take about 10 minutes. At the end of the script you will see the following: Copying prebuilt Linux kernel...

Do you have a UBIFS file system image file for programming into NAND flash? (y/n) [ y ] If you have built a UBIFS file system image you can select the UBIFS file system image file

here and it will be copied to the appropriate ./images-to-flash/nand folder. The file will be renamed to ubi.img.



To verify that all builds completed without errors:

1) Cut and paste the text (compiler output) from the terminal window to a new text file.

2) Search the file for "...", which occurs each time the script prints a message.

3) Verify that each build command ended without error messages.

The images stored under the images-to-flash folder have fixed filenames according to the table below. Which ever of the listed files are found in the corresponding folders under images-to-flash will be included in the flash-archive-file for programming into flash memory. For example, if a file system is not present under ./images-to-flash/nand a file system will not be included in the output flash-archive file.

NOTE: Beagle Bone Memory Expansion Cape + 8-bit NAND will work. U-Boot code currently needs to add the

capability to automatically detect 8-bit or 16-bit NAND to support a 16-bit NAND device.

Step 5: Run the AM335x Flash Image Builder Script
To run the AM335x Flash Image Builder script enter these commands. cd ~/ti-sdk-am335x-evm-06.00.00.00/host-tools/am335x-flash-image-builder/linux/scripts/

./am335x-flash-image-builder.sh

System Board Type
The first prompt you will see is: Select AM335x System Board Type:

0: Custom AM335x System Board 1: TI AM335x GP EVM 2: Beagle Bone (Community Board)

[ 0 ] Select the type of AM335x system you are working with (Custom, TI AM335x GP EVM, or Beagle Bone (White)).

Memory Expansion Cape Revision
The next prompt will only occur if you have selected Beagle Bone: Select your Beagle Bone Memory Expansion Cape: 0: Rev A (SW2 has 12 DIP switches.) 1: Rev A1 (SW2 has 10 DIP switches.)

[ 0 ] With Beagle Bone, a Memory Expansion Cape (expansion board) is plugged onto the base board and then a NAND or NOR flash module is plugged onto the Memory Expansion Cape. There are two revisions of the Memory Expansion Cape (A and A1). You can tell the difference by looking at the bank of DIP switches SW2. On Rev A this has 12 switches. On Rev A1    there are 10 switches. This prompt is used to determine which helper diagram will appear when programming flash to show how to set the SYSBOOT switches.

Boot and Flash Interface(s)
The next prompt determines the peripheral interfaces that will be used when programming flash memory: Select boot mode and interface for flash programming: 0: USB boot and flash (AM335xA or later ONLY) 1: Ethernet boot and flash 2: UART boot and USB flash (for AM335x)

[ 0 ] This determines which peripheral interface will be used to boot your AM335x system board and which peripheral interface will be used to perform the subsequent file transfers from the host PC. Normally this is a choice between USB RNDIS (Ethernet over USB) or Ethernet. However, for the original AM335x silicon revision (AM335x w/ No Rev Letter) USB booting is not supported. For that case there is a third option which boots over the UART0 port using an XMODEM file transfer then uses the USB0 OTG port for all subsequent file transfers. NOTE: "USB boot and flash" will not appear for Beagle Bone (White) since this is assumed to have the original AM335x Silicon Revision which does not support USB boot.

NOTE: For the Beagle Bone (White) board, Ethernet boot requires a hardware modification (to the Rev A6 board). Add a 2.2K ohm pull-up resistor to 3.3V to U15 pin 15. U15 is the LAN8710A Ethernet PHY device. Pin 15 is the COL/CRS_DV/MODE2 pin. The pull-up resistor added for this pin sets the power-up strapping of the Ethernet PHY device to enable auto-negotiation after power-on reset.

Flash Memory Type
The next prompt is to select the type of flash memory device to be programmed: Select FLASH TYPE to program: 0: NAND Flash 1: SPI Flash 2: NOR Flash

[ 0 ] For the TI AM335x GP EVM the valid flash types are NAND (which has an 8-bit interface) or SPI flash. No option for NOR flash will appear. The NOR flash on the TI AM335x GP EVM uses the GPMC in a non-multiplexed mode. Current software does not support the NOR flash on the TI AM335x GP EVM.

For Beagle Bone, the options are NAND, SPI or NOR flash. NAND and NOR flash have been tested using the Memory Expansion Cape with a 8-bit NAND module or 16-bit Muxed NOR module. A SPI flash module for Beagle Bone has not been tested with this tool. To support a 16-bit NAND module, currently the u-boot and Linux kernel software needs to add the capability to automatically detect the NAND bus width (8 or 16 bits).

AM335x Silicon Revision
The next prompt is to detrmine the AM335x silicon revision: Select AM335x SILICON REVISION: 1: AM335x Silicon Revision 1.0 (AM335x) 2: AM335x Silicon Revision 2.0 or later (AM335xA or later)

[ 2 ] NOTE: This prompt will omly appear for a Custom AM335x board or for the TI AM335x GP EVM. This just a sanity check. It will generate an error if you have selected "USB Boot" AND AM35x Silicon Revision 1.0.

Generation of the Required Restore-Flash U-Boot/SPL Images
The script will now check if the restore-flash U-Boot/SPL images for your selected configuration have been built and stored in the Flash Tool File Tree.

If not found, a message like the following will be displayed. This example is for programming the AM335x GP EVM NAND flash memory via USB RNDIS.

The $RESTORE_FLASH_PATH is where the "u-boot-spl-restore.bin" and "u-boot-restore.img" U-Boot/SPL images will be stored.

The $IMAGES_TO_FLASH_PATH is where the images to program into flash memory should be stored (they should have been copied there before running this script.)

The $UBOOT_MAKE_TARGET is the make target that will be used to build the restore-flash U-Boot/SPL images based on the selected configuration.

In this case, the script has checked the $RESTORE_FLASH_PATH and did not find the images there so a u-boot build will be forced. $RESTORE_FLASH_PATH set to /home/sitara/ti-sdk-am335x-evm-06.00.00.00/host-tools/am335x-flash-image-builder/boards/am335x-evm/restore-flash/usb_ether

$IMAGES_TO_FLASH_PATH set to /home/sitara/ti-sdk-am335x-evm-06.00.00.00/host-tools/am335x-flash-image-builder/boards/am335x-evm/images-to-flash/nand

$UBOOT_MAKE_TARGET set to am335x_evm_restore_flash_usbspl

The required "restore flash" U-Boot/SPL images are NOT present in the flash tool file tree. Forcing a U-Boot/SPL build... All the required "restore flash" U-Boot/SPL images will now be built from sources.

Browse to the directory at the top of the U-Boot/SPL source tree for your AM335x system... In this case, the script has checked the $RESTORE_FLASH_PATH and the required restore-flash U-Boot/SPL images were found. The user is then asked whether or not to rebuild those images. It is most likely best to enter 'y' here unless you are certain that there are no u-boot source code changes since this tool was last run for this configuration. $RESTORE_FLASH_PATH set to /home/sitara/ti-sdk-am335x-evm-06.00.00.00/host-tools/am335x-flash-image-builder/boards/am335x-evm/restore-flash/usb_ether $IMAGES_TO_FLASH_PATH set to /home/sitara/ti-sdk-am335x-evm-06.00.00.00/host-tools/am335x-flash-image-builder/boards/am335x-evm/images-to-flash/nand

$UBOOT_MAKE_TARGET set to am335x_evm_restore_flash_usbspl

All the required "restore flash" U-Boot/SPL images have been found in the flash tool file tree. However, if you made changes to your U-Boot/SPL source tree since running this flash tool you must rebuild the "restore flash" U-Boot/SPL images. Rebuild from sources now? (y/n)

[ n ] If a restore-flash U-Boot build is to be executed you will be prompted to select the path to the U-Boot source tree for your AM335x system. After browsing to the path click OK.



Example gcc compiler output for the U-Boot build is shown here: Building "restore flash" U-Boot/SPL images... Configuring for am335x_evm_restore_flash_usbspl - Board: am335x_evm, Options: SERIAL1,CONS_INDEX=1,RESTORE_FLASH,SPL_USBETH_SUPPORT make make[1]: Entering directory `/home/sitara/ti-sdk-am335x-evm-06.00.00.00/board-support/u-boot-2013.01.01-psp06.00.00.00' Generating /home/sitara/ti-sdk-am335x-evm-06.00.00.00/board-support/u-boot-2013.01.01-psp06.00.00.00/am335x_evm_restore_flash_usbspl/include/autoconf.mk Generating /home/sitara/ti-sdk-am335x-evm-06.00.00.00/board-support/u-boot-2013.01.01-psp06.00.00.00/am335x_evm_restore_flash_usbspl/include/autoconf.mk.dep

[U-Boot build compiler output continues...]

make[2]: Leaving directory `/home/sitara/ti-sdk-am335x-evm-06.00.00.00/board-support/u-boot-2013.01.01-psp06.00.00.00/examples/standalone' make -C examples/api all make[2]: Entering directory `/home/sitara/ti-sdk-am335x-evm-06.00.00.00/board-support/u-boot-2013.01.01-psp06.00.00.00/examples/api' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/home/sitara/ti-sdk-am335x-evm-06.00.00.00/board-support/u-boot-2013.01.01-psp06.00.00.00/examples/api' make[1]: Leaving directory `/home/sitara/ti-sdk-am335x-evm-06.00.00.00/board-support/u-boot-2013.01.01-psp06.00.00.00'

Copying "restore flash" U-Boot/SPL images to flash tool file tree.

Upon successful build the generated image files are renamed and stored in the $RESTORE_FLASH_PATH folder for the current configuration as follows.

The convention used is to name the U-Boot output folder the same as the make target name. So for this example (USB RNDIS flash programming), given the following definitions

the restore flash u-boot images would be renamed and copied as follows.

$RESTORE_FLASH_PATH="/home/sitara/ti-sdk-am335x-evm-06.00.00.00/host-tools/am335x-flash-image-builder/boards/am335x-evm/restore-flash/usb_ether" $UBOOT_SOURCE_PATH="/home/sitara/ti-sdk-am335x-evm-06.00.00.00/board-support/u-boot-2013.01.01-psp06.00.00.00"

$UBOOT_MAKE_TARGET="am335x_evm_restore_flash_usbspl"

If the restore-flash U-Boot build does not compile successfully you will see messages like these which indicate that the binary images were not created and could not be copied. Copying "restore flash" U-Boot/SPL images to flash tool file tree. cp: cannot stat `/home/sitara/ti-sdk-am335x-evm-06.00.00.00/board-support/u-boot-2013.01.01-psp06.00.00.00/am335x_evm_restore_flash_usbspl/spl/u-boot-spl.bin'
 * No such file or directory

cp: cannot stat `/home/sitara/ti-sdk-am335x-evm-06.00.00.00/board-support/u-boot-2013.01.01-psp06.00.00.00/am335x_evm_restore_flash_usbspl/u-boot.img'
 * No such file or directory

Generation of the "Debrick" Boot Script
Next the script will generate a boot script based on the selected flash type. The file will be created in the "images-to-flash/&lt;flash-type&gt;" folder and will be named "debrick-nand.txt", "debrick-spi.txt" or "debrick-nor.txt".

The script will add commands to this debrick boot script based on the image files that were copied to the $IMAGES_TO_FLASH folder before this script was run. Finally, the mkimage program will be called to convert the "debrick-&lt;flash-type&gt;.txt" file to the binary format required for a U-Boot boot script and it will name the resulting binary file "debrick.scr". An output message similar to this will appear during this portion of the script. Generating debrick script at: /home/sitara/ti-sdk-am335x-evm-06.00.00.00/host-tools/am335x-flash-image-builder/boards/am335x-evm/images-to-flash/nand/debrick-nand.txt.

Adding commands to program "MLO" into NAND flash.

Adding commands to program "u-boot.img" into NAND flash.

Adding commands to program "uImage" into NAND flash.

Adding commands to program "ubi.img" into NAND flash.

Converting debrick-nand.txt to binary debrick.scr. Image Name: Created: Tue Jun 18 14:13:30 2013 Image Type: ARM U-Boot Script (uncompressed) Data Size: 444 Bytes = 0.43 kB = 0.00 MB Load Address: 00000000 Entry Point: 00000000 Contents: Image 0: 436 Bytes = 0.43 kB = 0.00 MB The "debrick.scr" boot script binary file will execute at the time of flash programming when the restore-flash U-Boot executes. The restore flash U-Boot has a special "bootcmd" that requests a tftp transfer of the "debrick.scr" file instead of loading a Linux kernel image. For flash programming to occur, the restore-flash U-Boot must use the deault U-Boot parameters which are set for the restore-flash U-Boot builds. Below are example debrick scripts in text format for the NAND, SPI and NOR cases.

Example debrick-nand.txt boot script
The "cdc_connect_timeout" is set to allow enough time for the host PC to respond on USB RNDIS. The entire NAND device is erased. The MLO file is copied from the host PC and redundant copies are made of the MLO file. Then the MLO files are written to NAND flash. The "u-boot.img", "uImage" (Linux kernel image), and the UBIFS file system are each in turn tftp transferred from the host PC to SDRAM and then written into NAND flash. setenv cdc_connect_timeout 15 nand erase.chip mw.b 0x81000000 0x780000 0xff tftp 0x81000000 MLO cp.b 0x81000000 0x81020000 0x20000 cp.b 0x81000000 0x81040000 0x20000 cp.b 0x81000000 0x81060000 0x20000 nand write 0x81000000 0x0 0x80000 tftp 0x81000000 u-boot.img nand write 0x81000000 0x80000 ${filesize} tftp 0x81000000 uImage nand write 0x81000000 0x280000 ${filesize} tftp 0x81000000 ubi.img nand write 0x81000000 0x780000 ${filesize}

Example debrick-spi.txt boot script
The SPI0 interface is probed to initialize communication. The MLO.byteswap file is tftp tyransferred from the host PC and redundant copies are made in SDRAM. The SPI flash area to be written is first erased and then is written to. The same process is performed for the "u-boot.img" and the Linux kernel image ("uImage"). Since the SPI flash on the AM335x GP EVM is only 8MiB in size, there is not enough room for a file system image. However, in a custom design with a larger SPI flash, a file system may be included. If so, a JFFS2 file system would be used. A file system image named "fs.jffs2" would need to have been copied to the $IMAGES_TO_FLASH folder ("./images-to-flash/spi") before this script was run. U-Boot environment variables from the default u-boot parameters such as "spisrcaddr" and "spiimgsize" are assumed to be defined. The variable ${filesize} is set to the number of bytes that are transfrerred by the tftp command. sf probe 0 tftp 0x80200000 MLO.byteswap cp.b 0x80200000 0x80220000 0x20000 cp.b 0x80200000 0x80240000 0x20000 cp.b 0x80200000 0x80260000 0x20000 sf erase 0 +80000 sf write 0x80200000 0x0 0x80000 tftp ${loadaddr} u-boot.img sf erase 0x80000 0x60000 sf write ${loadaddr} 0x80000 ${filesize} tftp ${loadaddr} uImage sf erase ${spisrcaddr} ${spiimgsize} sf write ${loadaddr} ${spisrcaddr} ${filesize}

Example debrick-nor.txt boot script
The debrick script for NOR flash contains cpommands to disable and re-enable write protection. Only one image file is programmed ("u-boot.bin"). This image is built using the "am335x_evm_norboot" make target. A secondary program loader executable is not required. The "u-boot.bin" image is built to execute-in-place (XIP) in SDRAM. No Linux kernel image is included since XIP execution of the Linux kernel is not supported in the current software. protect off all erase all tftp ${loadaddr} u-boot.bin cp.b ${loadaddr} 0x08000000 ${filesize} protect on all

Modifying the Default Boot Scripts
If your AM335x system has special requirements such that the default debrick boot scripts would not be compatible with your system, the portion of the script that auto-generates the debrick script text files could be modified per your requirements. This code is contained in the "am335x-flash-image-builder.sh" shell script file in the function named "autogenerate_debrick_boot_script".

Generation of the Flash Archive File
The end result of running the AM335x Flash Image Builder script is the creation of a "Flash-Archive-File". The flash archive file contains all the files that are neccessary to program flash memory for the selected configuration including:

1) The restore-flash U-Boot/SPL images

2) The payload images to be programmed into flash memory

3) Configuration file "flash-programmer.conf" which contains all the interactive selections that were entered when the AM335x Flash Image Builder script was run.

The flash archive file is intended to be the input file for the AM335x Flash Programmer program for the Linux host PC. The generated name of the flash archive file includes the AM335x silicon revision, board type, peripheral interface for flash programming ("usb", "ethernet" or "uart+usb") the flash memory type and a date and time stamp to indicate the time when the flash archive file was created. The flash archive file is a "tar.gz" tarball file that contains all files under "./am335x-flash-image-builder/boards/&lt;board-type&gt;" plus theflash-programmer.conf file. The flash archive file is copied to the "./am335x-flash-image-builder/flash-archive-files/" folder. If the "${HOME}/am335x-flash-programmer/flash-archive-files/" folder is found on the host PC the flash archive file is also copied there for use with the AM335x Flash Programmer program on the same host PC. Example script output for this portion of the script is shown here. $RESTORE_FLASH_PATH set to /home/sitara/ti-sdk-am335x-evm-06.00.00.00/host-tools/am335x-flash-image-builder/boards/am335x-evm/restore-flash/usb_ether

$IMAGES_TO_FLASH_PATH set to /home/sitara/ti-sdk-am335x-evm-06.00.00.00/host-tools/am335x-flash-image-builder/boards/am335x-evm/images-to-flash/nand am335x-evm/ am335x-evm/restore-flash/ am335x-evm/restore-flash/nor_uart_usb_ether/ am335x-evm/restore-flash/usb_ether/ am335x-evm/restore-flash/usb_ether/u-boot-restore.img am335x-evm/restore-flash/usb_ether/u-boot-spl-restore.bin am335x-evm/restore-flash/cpsw/ am335x-evm/restore-flash/nor_usb_ether/ am335x-evm/restore-flash/nor_cpsw/ am335x-evm/restore-flash/uart_usb_ether/ am335x-evm/images-to-flash/ am335x-evm/images-to-flash/spi/ am335x-evm/images-to-flash/nand/ am335x-evm/images-to-flash/nand/ubi.img am335x-evm/images-to-flash/nand/u-boot.img am335x-evm/images-to-flash/nand/uImage am335x-evm/images-to-flash/nand/debrick.scr am335x-evm/images-to-flash/nand/MLO am335x-evm/images-to-flash/nand/debrick-nand.txt am335x-evm/images-to-flash/nor/ flash-programmer.conf

+===============================================================================================+ Created Flash Archive File: am335x_2.0_am335x-evm_usb_nand.06182013_14_13.tar.gz

This "flash archive file" is designed to be the input file to the "am335x-flash-programmer" application. You can send this flash archive file to your production site. Found "am335x-flash-programmer" on this computer. Copied new flash archive file to /home/sitara/am335x-flash-programmer/flash-archive-files/ +===============================================================================================+ The generated "flash-programmer.conf" file for this example is shown here. This file was created by AM335x Flash Image Builder v01.00.00.00. DEVICE_TYPE=am335x BOARD_TYPE=am335x-evm CAPE_MEM_EXP_REV=A BOOT_FLASH_MODE=usb FLASH_TYPE=nand SILICON_REVISION=2.0 This table describes the range of values that can be assigned to each of these parameters. Silicon revision 1.0 refers to the AM3335x device (no rev letter). Silicon revision 2.0 refers to AM335xA or later.

Below is a listing of the flash-archive-files folder after the AM335x Flash Image Builder has been run for numerous flash programming configurations.



= Appendix A: AM335x Flash Image Builder File Tree Details =

Below is the file tree that is created by the AM335x Flash Image Builder installer.




 * boards - Contains a subtree for each of the supported boards types. The board type is selected when running the am335x-flash-image-builder.sh script.

This organization allows you to maintain separate u-boot source trees for the TI boards and your AM335x custom board. When creating the

output flash archive file for each board type you will be prompted for the path to the corresponding u-boot source tree.


 * am335x-custom - Files are stored here when Custom AM335x System Board is selected.
 * am335x-evm - File are stored here when TI AM335x GP EVM (General Purpose Evaluation Module) is selected.
 * beagle-bone - Files are stored here when the Beagle Bone community board is selected.
 * images-to-flash - These folders will contain (as described in Step 3 below) the "payload" images files to be programmed into flash memory for the supported flash memory types

(NAND, NOR and SPI). Prior to running the am335x-flash-image-builder script, the images to flash must be built and copied here.


 * restore-flash - The sub folders here will contain special U-Boot/SPL images that will be used to program flash memory. The image files will be named "u-boot-spl-restore.bin" and "u-boot-restore.img".  The flash-image-builder script will build one set of these images as selected by user inputs.  The u-boot images are built using a specific u-boot make target depending on the selected configuration.


 * flash-archive-files - This folder will contain the output archive file(s) that result from running the am335x-flash-image-builder script. The flash-archive-files

are essentially a tar ball of all the files for a specific board type (for example all files under the ./boards/am335x-evm/ folder). In addition, the flash-archive-file

contains a flash-programmer.conf file that specifies all the interactive selections that were chosen when the flash-image-builder script created it. The flash-archive-file

is meant to be the input file to the AM335x Flash Programmer program.


 * linux/patches/u-boot - Contains patches that need to be applied to the u-boot source tree before building the payload images or running the flash-image-builder script.
 * linux/scripts - The scripts that will be executed by the user are described below. The remaining scripts files contain functions that are called by the other scripts.

Below shows what is added when the "prework#2-build-payload-images.sh" script has been run after installation, for the ./boards/am335x-evm/ portion of the Flash Tool File Tree. The images to be programmed into flash memory are added for NAND and SPI flash memories.



Below shows what is added when the "am335x-flash-image-builder.sh" script has been run for the USB RNDIS NAND flashing case for the ./boards/am335x-evm/ portion of the Flash Tool File Tree. The restore-flash U-Boot/SPL images and the debrick boot script files are added.



= Appendix B: Creating Your Own Flash Archive File Manually =

For customers who have developed their own infrastructure for software development and do not use the AM335x EZSDK or its included gcc cross compiler or the AM335x Flash Image Builder scripts, it is possible to create a flash-archive-file manually. This flash-archive-file could then be used to program the AM335x system using the AM335x Flash Programmer program. The following elements would be required:

1) The restore-flash U-Boot/SPL images

2) The payload images to be programmed into flash memory

3) Configuration file "flash-programmer.conf" which contains all the interactive selections that were entered when the AM335x Flash Image Builder script was run.

Below is a file tree representation for a minimum flash-archive-file. This represents the tree of an expanded "*.tar.gz" archive file.



All folders under restore-flash and images-to-flash are not required - only the ones that are being used.

Theflash-programmer.conf file would need to be created following the table (shown previously) with the valid parameter names and possible values.

The table below shows the correspondance between U-Boot make target names and folder names used under each restore-flash folder.

* The USB RNDIS boot mode requires AM335x silicon revision 2.0 or later (AM335xA or later).