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 upper 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. In addition, we inserted two USB flash drives for USB testing.
Note: You can click on any image to view a larger image.
Create a New Configuration
Run the VTOS Tools Installer 3 to install all VTOS products. The installer can be downloaded from Software Downloads. you must register and sign in to download.
Launch VTOS Developer, and activate your license if you haven’t already done so. Click on Licenses | Activate Node-locked Licenses to activate your free trial license. You can either create a new project from scratch using these instructions, or import our example P1025-TWR example project.
To import our example, use VTOS Developer and click on File | Import Project. Then browser to %KOZIO_HOME_3%\projects. Open the file QorIQ_P1_P1025-P1025TWR.pa to import the VTOS Program NOR Ethernet example and many others.
To create a new project, Click on File -> New Project or click on the New button just under the menu options. Enter a name for your project. In the Processor Family pull-down, select QorIQ P1. In the Processor Model pull-down select P1025. Click OK to create the new project.
Now we will add a new task. Click on the Add button. The Project pull-down displays all products released for the processor chosen. Select VTOS Program NOR Ethernet. This task allows you to program NOR flash memory while using an Ethernet connection to transfer the file.
Configure a Connection to the P1025-TWR Target
There is some general setup required to configure your Project and Connection. Click on the Project node in the Project panel. Change Issue target Version to False since the VTOS firmware version is already displayed after the firmware is loaded over JTAG using the CodeWarrior TAP.
Click on the Fixture node. Change Connection Type to CodeWarrior. Enter your TAP identifier, found on the bottom of the CodeWarrior TAP, into the TAP Identifier field. For example, the example project used 00:04:9f:03:b0:bc. Click File | Save Project to save your new settings.
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 target memory, and start the VTOS firmware executing. This process will take around 10 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. Kozio stores all project files in a folder named after your project name in a %KOZIO_HOME_3%\projects sub-folder. For this example, the project folder is %KOZIO_HOME_3%\projects\p1025-twr-example or %KOZIO_HOME_3%\projects\QorIQ_P1_P1025-P1025TWR if you used the sample provided with the installer.
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 Task 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 eTSEC1. (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 eTSEC1 and the correct PHY. Enter 2 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 the Tools menu and then select Start TFTP Server. This will launch Kozio’s TFTP Server in the background. A green TFTP icon will be displayed in the upper right-hand corner of the main VTOS Developer window.
Note: The TFTP server process will continue running under you select Tools | Stop TFTP Server. 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 Settings 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 %KOZIO_HOME_3%\test-files 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 %KOZIO_HOME_3%\test-files\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 if the image was programmed without errors.
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 the Task::VTOS Program NOR Ethernet node in the project configuration tree and Project panel. Use the right-mouse menu option to Export To | Kozio Script File to create a single script file containing all these steps. That script file can be loaded and run uses a custom test executive and the vAccess API.
- Click on the Task::VTOS Program NOR Ethernet node in the project configuration tree and Project panel. Use the right-mouse menu option to Export To | NI TestStand Sequence File 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 the Task::VTOS Program NOR Ethernet node in the project configuration tree and Project panel. Use the right-mouse menu option to Export To | 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.
- You can also launch VTOS Runner and open up your project file, and then use VTOS Runner to run all programming steps with a single button. (You must first Disconnect in VTOS Developer.)