Getting Started with VTOS Program NOR Ethernet
Fast Flash Programming Using JTAG & Ethernet
A step by step guide on how you can use Kozio’s flash programming solution, along with an Ethernet connection, to greatly improve NOR flash programming times. Programming speeds will vary based on processor architecture, network connection, and flash part, but we have see VTOS Program speeds over 400 Kilabytes per second (400+ KBps).
Set up the P1025-TWR Circuit Board
For this getting started guide we used a NXP QorIQ P1025 processor, found in a P1025-TWR reference board. We used a CodeWarrior TAP to connect our PC to the target, providing JTAG communications and automatic VTOS firmware loading. The picture below displays the JTAG ribbon cable connection to the P1025-TWR, plus a blue Ethernet cable connection to the target in the lower RJ45 connector, and a 5V power connection. The red coloring on the JTAG ribbon cable must be connected to pin 1 of the JTAG header on the P1025-TWR.
Note: You can click on any image to view a larger image.
Create a New Configuration
Run the VTOS Tools Installer to install all VTOS products. The installer can be downloaded from Software Downloads. you must register and sign in to download.
Launch VTOS Program, and active your license if you haven’t already done so. Click on File -> New. In the Processor pull-down, select QorIQ P1025. Once selected, the options to the right of this pull-down are updated. Click on NOR Ethernet to select the option that programs NOR flash using Ethernet for file transfers. Click on OK.
Configure a Connection to the P1025-TWR Target
Click on the Connections button in the main menu bar. Select the button to the left of the first row. This may already be selected in your case. Under Product, choose VTOS Program NOR Ethernet. Under Processor choose QorIQ P1xxx. Under Connection, choose CodeWarrior. Click under the Settings column on the button and a new pop-up will appear for extra configuration data. Next, select the CodeWarrior TAP Connection (cwtap) option for the TAP Type. Now enter the TAP Identifier. This is found on the bottom of the CodeWarrior TAP box. We used 00:04:9f:03:ae:c0. Click on Save. Click on Save again to close the Connections dialog.
Connect to the Target
Click on the Connect button in the menu bar. This step will use your connection settings and attempt to communicate with the target over the JTAG connection. This process will automatically configure the memory of the target, load the VTOS Program firmware into memory, and start the VOTS firmware executing. This process will take around 5 seconds to complete. Once connected, the black console window is updated with the text “DUT ready” and VTOS firmware version information.
Install a NOR Flash Device
We now need to configure and install a NOR Flash device. This step will use VTOS firmware to discover and initialize a flash driver. Kozio firmware will discover and program any CFI compliant flash device. No special drivers are required.
Select the Chip Select 0 node in the configuration tree, under the NOR Flash Group. For this circuit board, the flash device was wired to work on chip select 0. Use the right-mouse menu option to Add NOR Flash Device. A new device is added and labeled NOR Flash 1:1. For this circuit board, the bus width to the flash device is 16 bits, so change the Bus Width to 16 bits.
Now is a good time to save your configuration. Click on File -> Save As. Kozio stores all example project files in a folder called “boards” under the VTOS_Progam folder. Under “boards” we added many folders for processor families. In this case, we saved the file to boards\qoriq_p1\p1025twr_qoriq_p1_program_nor_ethernet.xml.
** Note: To save time, you can open up the project file Kozio distributes with the VTOS Tools Installer. Open up boards\qoriq_p1\p1025twr_qoriq_p1_program_nor_ethernet.xml and all the data mentioned below will be filled in for you. You still will need to configure your own TFTP Server, which varies with every PC and LAN.
Now select the NOR Flash::NOR Flash 1:1 node in the configuration tree. Use the right-mouse Run option to install the flash part. (You can also double-click on the node to run it.) This step will discover and install a flash driver, and then display flash part information on the console.
Configure the TFTP Server
Kozio delivers a TFTP Server with VTOS. This server has been optimized to perform the fastest with VTOS firmware.
Click on the TFTP Server node in the configuration tree. Under the Config Mode panel, we will need to set a few parameters.
- TFTP File Transfers – Leave Use TFTP File Transfers set to True.
- Target Ethernet Controller – We need to specify which Ethernet connection on the reference board will be used for Ethernet traffic. For the P1025 processor, there are three choices shown in the pull-down. The P1025-TWR has two connections populated, an upper connector which is eTSEC1, and a lower connector which is eTSEC3. Select eTSEC3. (This data can be found in the schematics for the circuit board.)
- Target MII Type – This pull-down will change any time you select a different Target Ethernet Controller. Kozio updates this list based on the processor and controller chosen. For this circuit board, chose RGMII.
- Target PHY Address – This value is based on the choices made by the hardware designer. We used VTOS Scan Ethernet to perform a PHY scan, which allowed us to discover the mapping between eTSEC3 and the correct PHY. Enter 1 for the PHY address.
- Target MAC Address – This value will be used by VTOS Firmware to initialize the Ethernet controller and PHY on the target circuit board. The default value is typically fine. The only time you would have to change this value is when you have two or more circuit boards on the same LAN. Each target must have a unique MAC Address and IP Address. The default value is a valid Kozio MAC id.
- Target IP Address – Enter an IP address that will be valid on the subnet you are using. In our case, our PC is has an IP address of 192.168.1.12, so we used 192.168.1.101 for our testing. (You can use the Windows cmd.exe shell to ping this address and verify no other network device is using this IP address.)
- Subnet Mask – Change the subnet mask according the to IP address and subnet you are using. No changes are needed in our test case.
- TFTP Server IP Address – For our testing, we are running the TFTP Server on the same PC we are running the VTOS Program GUI. Click on the default value and you should see a down arrow, which allows you to see a pull-down of all IP addresses discovered by VTOS Program. in order to know which address to use, you can use the cmd.exe shell and run “ipconfig /all”. If your desired IP address is no tin the list, you can type in the correct value.
- Gateway – We didn’t need to make any changes here.
Now that we have configured our TFTP Server, click on TFTP Server menu and then select Start. This will launch Kozio’s TFTP Server in the background. Note: This process will continue running under you select TFTP Server -> Stop. It will even run after you close the GUI. This allows a manufacturing process to perform multiple flash programming runs without starting and stopping the TFTP server every time.
Double-click on the TFTP Server node in the configuration tree. This will configure and run VTOS firmware commands for setting up the firmware side of Ethernet transfers. The firmware will attempt to initialize the Ethernet PHY and Ethernet controller. This step will use the PHY, MAC, and IP address data you provided. If a link is established, this step will pass.
Create Flash Program Operations
Next, we will create tests to erase flash, verify that it is blank, program flash with a test file, and verify that the file was programmed successfully.
(1) Image Erase Test
Click on <Add Operation> under the Program Operations node in the configuration tree. Use the right-mouse menu to Add Image Erase Test. In the Config Mode panel, click on box to the right of Device Name. Use the pull-down to select NOR Flash 1:1. The device we just installed. We used an Offset of 0x0. This is an offset into the flash memory. Offset 0x0 is the very start of the flash part. You do not need to worry about memory map values, VTOS firmware handles all that. We are going to transfer a 1 MiB file, so enter a Byte Count of 0x00100000.
Double-click on our new Image Erase Test node to test it out. This step will erase the flash, which is required for successful programming.
(2) Image Blank Test
Click on <Add Operation> under the Program Operations node in the configuration tree. Use the right-mouse menu to Add Image Blank Test. In the Config Mode panel, click on box to the right of Device Name. Use the pull-down to select NOR Flash 1:1. Enter an Offset of 0x0. Enter a Byte Count of 0x00100000.
Double-click on our new Image Blank Test node to test it out. This step will verify that the first 1 MiB of flash has been erased.
(3) Program From File Using TFTP
Click on <Add Operation> under the Program Operations node in the configuration tree. Use the right-mouse menu to Add Program From File Using TFTP. In the Config Mode panel, click on box to the right of Device Name. Use the pull-down to select NOR Flash 1:1. Enter a Destination Offset of 0x0. For Source, click on the box to the right of Source and use the ellipses button to browse for a test file. We provided the example 1mb.test file in the TestFiles sub-folder.
Double-click on our new Program From File Using TFTP node to test it out. This step will attempt to transfer the 1mb.test file over the Ethernet connection and program the target’s flash memory with its contents. This step will take about 4-5 seconds.
(4) Image Checksum Test
Click on <Add Operation> under the Program Operations node in the configuration tree. Use the right-mouse menu to Add Image Checksum Test. In the Config Mode panel, click on box to the right of Device Name. Use the pull-down to select NOR Flash 1:1. Enter an Offset of 0x0. Enter a Byte Count of 0x00100000. Enter aa26ff5b895356bcffd9292ba9f89e66 for the MD5 Sum.
Note: Kozio provides a program called md5.exe which will determine the MD5 sum of any file. Use a cmd.exe shell as follows to determine an MD4 sum.
Double-click on our new Image Checksum Test node to test it out. If the file was transferred and programmed successfully, the checksum test will pass.
Automating Flash Programming
Now that your configuration is all set up, there are a few ways to automate these steps.
- Click on the Run button on the main menu bar. This operation will run all steps configured from top to bottom. With the push a single button you can erase, program, and verify your flash memory operations.
- Click on File -> Export -> Kozio Script File to create a single script file containing all these steps. That script file can be loaded and run in Kozio’s VTOS Runner GUI.
- Click on File -> Export -> NI TestStand Sequence to create a single TestStand sequence file (*.seq) containing all these steps. That binary file can be loaded and run in NI’s TestStand GUI without modification.
- Click on File -> Export -> Desktop Shortcut to create a desktop button. That single button is linked to a batch file that will load and run the Kozio script file exported. Double-click on the button to connect to your target, load firmware, and program flash memory all in a single operation. This can be very handy for programming multiple boards.