- Computers & electronics
- Software
- Business software
- Future Designs, Inc.
- uEZ GUI
- User manual
- 19 Pages
Future Designs, Inc. uEZ GUI User Manual
Below you will find brief information for uEZ GUI. This manual will help you program uEZ GUIs using SEGGER J-Link and PC tools. It covers steps for production line programming using script files, production programming using J-Flash software, and recovering from bad programs.
advertisement
Assistant Bot
Need help? Our chatbot has already read the manual and is ready to assist you. Feel free to ask any questions about the device, but providing details will make the conversation more productive.
JTAG Programing uEZ GUIs
Copyright ©2015, Future Designs, Inc., All Rights Reserved
Table of Contents
1.0
Introduction ...................................................................................................................................... 3
1.1
Segger J-Link ............................................................................................................................... 3
2.0
Production Line Programming (Programing with Script Files) ....................................................... 3
2.1
Associating the Script File with the SEGGER Tools ................................................................... 3
2.1.1
Windows 7 “Open with” issues ............................................................................................ 6
2.1.2
Once these steps are complete, return to Section 2.1 step 1 and try again. .......................... 6
2.2
Converting HEX Files to Binary Files ......................................................................................... 7
2.3
Setting up the Script File .............................................................................................................. 9
2.3.1
LPC1788 ............................................................................................................................... 9
2.3.2
LPC4088 ............................................................................................................................. 10
2.3.3
RX62N ................................................................................................................................ 10
2.3.4
RX63N ................................................................................................................................ 11
2.4
Setting up the hardware .............................................................................................................. 11
2.5
Running the Script File .............................................................................................................. 12
3.0
Production Programming ............................................................................................................... 13
3.1
Required License ........................................................................................................................ 13
3.2
Setting up the J-Flash Project ..................................................................................................... 13
3.3
Creating *.jflash File with GUI .................................................................................................. 14
3.4
Creating a Batch File to run J-Flash ........................................................................................... 15
4.0
Recovering from a Bad Program ................................................................................................... 16
4.1
FDI Examples ............................................................................................................................. 16
4.2
Recovering the Unit ................................................................................................................... 16
5.0
Appendix A .................................................................................................................................... 19
Information in this document is provided solely to enable the use of Future Designs products. FDI assumes no liability whatsoever, including infringement of any patent or copyright. FDI reserves the right to make changes to these specifications at any time, without notice. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Future Designs,
Inc. 996 A Cleaner Way, Huntsville, AL 35805
NOTE: The inclusion of vendor software products in this kit does not imply an endorsement of the product by Future Designs, Inc.
2015 Future Designs, Inc. All rights reserved.
For more information on FDI or our products please visit www.teamfdi.com.
μEZ®
is a registered trademark of Future Designs, Inc.
Microsoft, MS-DOS, Windows, Windows XP, Microsoft Word are registered trademarks of Microsoft Corporation.
Other brand names are trademarks or registered trademarks of their respective owners.
FDI PN: MA00053
Revision: Rev 1.07, 8/13/2015
Printed in the United States of America
Page 2 of 19
1.0 Introduction
This document outlines the steps to program uEZ GUI units using the SEGGER J-Link and the PC tools provided by SEGGER. Refer to the J-Link User’s manual for more details. https://www.segger.com/admin/uploads/productDocs/UM08001_JLink.pdf
1.1 Segger J-Link
SEGGER J-Links are a widely used line of debug probes. They've been proven for more than 10 years with over 250,000 units sold, including OEM versions and on-board solutions. They have an extensive feature set, large number of supported CPUs, and compatibility with all popular development environments.
With up to 3 MBytes/s download speed to RAM, flashloaders, and the ability to set an unlimited number of breakpoints in flash memory of MCUs, the J-Link debug probes are a great choice to optimize your debugging and flash programming experience.
More information and a nice matrix showing the different models can be found on their website: https://www.segger.com/jlink-debug-probes.html
2.0 Production Line Programming (Programing with Script Files)
Script files can be used to program uEZ GUIs without having a complete IDE toolset installed on your
PC. This is useful for non-engineering users who might not have a licensed compiler and tool suite available for every PC, or want to bother with all of the complex set up required for software development; they just want to program units in a production or test environment. Once the SEGGER
Tools are installed on the PC a few onetime setups are required to associate the files with the proper program.
2.1 Associating the Script File with the SEGGER Tools
This step assumes you have already downloaded and installed the SEGGER tools from their website and installed them on the PC. www.segger.com
1. Double click on the *.jlink file, if the file type has not be associated you will see a Windows
Dialog similar that in Figure: 1. (You can do this with any *.jlink file. We provide a number in our SorceForge uEZDemos directory, located in the “Precompiled FDI Demos” folder. When writing this document, I used uEZGUI-1788-43WQR_Debug.jlink.)
Page 3 of 19
Figure: 1 Windows can't open this file Dialog.
2. Click on the radio button “Select a program from a list of installed programs”.
3. Click on the <OK> button.
4. The “Open with” dialog box will open. Click the <Browse…> button as shown in Figure 2. b
Figure 2: Windows Open with Dialog.
Page 4 of 19
5. Browse to the default Segger install directory. For a 64-bit Windows 7 installation, it will be
“C:\Program Files (x86)\SEGGER\JLinkARM_VXXXx”. Where VXXXx represents the version of the tools. We used 496f when we wrote this document. Refer to Figure 3.
Figure 3: SEGGER Tools install directory.
6. Select the “JLink.exe” file.
7. Click the <Open> button.
8. Verify that “JLink.exe” is shown in the list of icons/programs at the top of the Open With Dialog box as shown in figure 4 below. If it is, continue on with step 9. If not, please refer to section
2.1.1 on Windows 7 “Open with” issues.
Figure 4: JLink.exe shown with “Open with”
9. Verify the “Always use the selected program to open this kind of file” check box is checked.
10. Click the <OK> button.
Page 5 of 19
2.1.1 Windows 7 “Open with” issues
In some cases the J-Link exe cannot be added using the “Open with” dialog box due to a known bug in Windows. To fix this, we use a 3 rd
party program called “Open With”. This can be downloaded using the link below. For more info and downloads, see the following links:
Download at: http://www.teamfdi.com/OpenWithAdd/OpenWithAdd.zip
More Info: http://www.sevenforums.com/tutorials/178066-open-add-program.html
Once downloaded, run “Open With Add.exe”, click on “…”, go to your Segger install directory, and click on JLink.exe. Select Register and it should be able to use in “Open With.”
Figure 5: Open With Add v1.2
2.1.2 Once these steps are complete, return to Section 2.1 step 1 and try again.
After completing the steps in section 2.1 and possibly 2.1.1, follow these steps to confirm your installation.
1. Make sure that your JLink is NOT connected to the PC
2. Using Windows Explorer, browse to the location of the uEZ JLink file you are using.
3. Double click on the file
4. Confirm that the dialog box in Figure 6 appears. If it does, you have verified that your JLink is functional.
Page 6 of 19
Figure 6: JLink.exe Window
2.2 Converting HEX Files to Binary Files
Most compilers can be setup to generate a binary file by default. But in many cases you will be working with a HEX file and need to convert it to binary before being able to program it into the microcontroller.
To convert the HEX file to the appropriate type follow the instructions below.
NOTE: The following procedure only works when the entire HEX file is stored inside the internal flash. If the binary file is larger than the internal flash of the MCU it will not program correctly.
(As of 2015, most uEZ GUIs have 512KB of internal flash.)
1. In the Windows Start Menu, Segger subdirectory, J-Link VX.XX subdirectory, click on <J-
Flash> to open J-Flash, refer to Figure 7. (We were using version 4.96 when we wrote this document.)
Figure 7: J-Flash in the windows Start Menu
Page 7 of 19
2. When J-Flash starts (and until you select “Do not show this message again”) the Welcome to J-
Flash Dialog Box will appear. Close this dialog box by clicking on the in the top right of the window, Figure 8.
Figure 8: Welcome to J-Flash Dialog Box
3. Within J-Flash a. Let’s open the file you want to convert: i. From the top menu, select “File->Open Data File”. ii. Navigate to the HEX file that needs to be converted. iii. Select the HEX file that needs to be converted. iv. Click on <Open> and the data file will be displayed inside J-Flash. b. Now, let’s save the file in the binary format needed by J-Link. i. From the top menu, select “File->Save Data File As”. ii. In the “Save as type:” pull down box, select “Binary file (*.bin)”. iii. Click <Save> (see Figure 9).
Figure 9: Save data file as Dialog
c. In the “Enter address range” dialog box: i. Verify that the Start address is set to 0.
Page 8 of 19
ii. Do not adjust the End address as this is calculated automatically from the HEX file. Refer to Error! Reference source not found.10. iii. Click <OK> to save the file.
Figure 10: Enter address range dialog
d. The file is now in the correct format for use by the script file. Notice in Figure 11 that the bin file is considerably smaller than the hex file.
Figure 11: Converted binary file.
2.3 Setting up the Script File
The script files are unique to each MCU and type of release. Below are various script files that FDI uses during testing and release. You can find other examples in the uEZGUI build subdirectories of our uEZ sourceforge files: uEZ_v2.06b_SourceForge\uEZDemos\Build\FDI\uEZGUI\.... For more information on the scripting within the script files see the J-Link User’s Manual.
2.3.1 LPC1788
The example text below was taken from the file “uEZGUI-1788-70WVT_KEIL.jlink” in the precompiled demos of the uEZ 2.06b release (Located at C:\uEZ_v2.06b_SourceForge\Precompiled FDI
Demos\uEZGUI-1788-70WVT\ uEZGUI-1788-70WVT_KEIL.jlink on my machine when I wrote this.) exec device = LPC1788 speed 4000 rx 200 h w4 0x400FC1A0 0x20 w4 0x400FC104 0x01 w4 0x400FC080 0x00 w4 0x400FC08C 0xAA w4 0x400FC08C 0x55 w4 0x400FC10C 0x01 w4 0x400FC000 0x3A
Page 9 of 19
w4 0x400FC040 0x01 loadbin "uEZGUI-1788-70WVT_KEIL_APP.bin", 0 rx 200 g q
2.3.2 LPC4088
The example text below was taken from the file “uEZGUI-4088-43WQN_KEIL.jlink” in the precompiled demos of the uEZ 2.06b release. exec device = LPC4088 speed 4000 rx 200 h w4 0x400FC1A0 0x20 w4 0x400FC104 0x01 w4 0x400FC080 0x00 w4 0x400FC08C 0xAA w4 0x400FC08C 0x55 w4 0x400FC10C 0x01 w4 0x400FC000 0x3A w4 0x400FC040 0x01 loadbin "uEZGUI-4088-43WQN_KEIL_APP.bin", 0 rx 200 g q
2.3.3 RX62N
The example text below was taken from the file “uEZGUI-RX62N-35QT_HEW.jlink” in the precompiled demos of the uEZ 2.06b release. exec device = RX62N speed 4000 loadbin "uEZGUI-RX62N-35QT_HEW.bin", 0xFFF80000 rx 200 g
Page 10 of 19
2.3.4 RX63N
The example text below was taken from the file “DK-TS-RX63N_HEW.jlink” in the precompiled demos of the uEZ 2.06b release. exec device = rx63n rx 500 speed 2000 loadbin "DK-TS-RX63N_HEW.bin", 0xfff80000 r g q
2.4 Setting up the hardware
After completing the steps in section 2.1, Associating the Script File with the SEGGER Tools, section
2.3, Setting up the Script File, and possibly section 2.1.1, Windows 7 “Open with” issues, the software setup is complete!
Now it is time to connect the hardware to the PC in preparation of programming:
1. Plug the J-Link’s USB cable into a free USB port on the PC. Note: The driver for the J-Link Lite will install automatically. If this is the first time using the device let the driver installation complete before proceeding.
2. Refer to Figure 12. On the right are the two different J-Link Lite boards that FDI includes in our kits. Determine which you are using then do one of the two steps below: a. If using the JLink-Lite-ARM: i. Connect the FDI JLINK-ARM-AD adapter to the J-Link Lite ARM using the 20pin cable. The FDI JLink-ARM-AD adapter comes with uEZ GUI kits that contain the J-Link Lite ARM and are also available at DigiKey . Refer to
Figure 13. b. If using the JLink-Lite-Cortex-M:
Some uEZ GUIs use an alternate connector that is the standard Cortex-M pinout and do not require an adapter. i. Connect the J-Link Lite Cortex-M board to the cable and plug in into your target board.
Page 11 of 19
Figure 12:
FDI JLINK-ARM-AD Adapter with J-Link Lite ARM and J-Link Lite Cortex-M
Figure 13: FDI JLINK-ARM_AD connected to UEZGUI-4088-43WQN-BA
NOTE:
Some MCUs advise that power be applied before JTAG is connected to the unit. Refer to the manufactures documentation for more details on the specific board being programmed.
Current LPC1788, LPC4088, RX62N, and RX63N FDI products can have JTAG and
power connected any either order.
3. Connect power to the uEZ GUI.
2.5 Running the Script File
1. Double click the *.jlink file. A window similar to Figure 14 will appear to indicate that the unit was programed successfully. (Slight variations to this window appear as Segger makes changes to their software.)
Page 12 of 19
Figure 14: Successful Programing of uEZGUI-4088-43WQN-BA with SEGGER Tools v4.54a
3.0 Production Programming
Production programing is done using the J-Flash software. J-Flash returns a code that indicates the success (or failure) of the programming operation. This allows the production control program (maybe a batch file) to know if a device is programed successfully (or not). This is the recommend method for volume programming.
3.1 Required License
Use of the J-Flash utility requires a full featured J-Link (PLUS, ULTRA+, PRO, J-Trace) or an additional license for the J-Link base model.
3.2 Setting up the J-Flash Project
J-Flash projects can either be setup using the Segger GUI interface or by manually creating a text file with the appropriate parameters. This document outlines the procedure for manually creating the file, not for creation within the GUI. The J-FlashARM program can either be linked to the production directory or copied into the production directory. Coping the J-FlashARM program files to a production folder and putting the files that you will need in production into this folder is the recommended method. This insures the intended version is used in production and later when you attempt to re-create a build. The following JLink files are needed for ARM based device programming.
Default.ini
Default.jflash
Page 13 of 19
JFlashARM.exe
JFlashARM.ini
JLinkARM.dll
3.3 Creating *.jflash File with GUI
1. Open J-Flash via the Windows Start menu
Figure 15: J-Flash Windows Start Menu
2. On the “Welcome to J-Flash” Dialog Select the option [Create project from template:]
Figure 16: J-Flash Welcome Dialog
3. Click the […] button to the right of the black text box
4. Navigate to the sample jflash file, for this example we will use the NXP LPC1788
Page 14 of 19
Figure 17: Windows File Browser Dialog
5. Click the [Open] Button
6. Click the [Start J-Flash] Button on the welcome dialog
7. Create a unique name for the entered target, for example “uEZGUI-1788-43WQR”
Figure 18: Save project as Dialog
3.4 Creating a Batch File to run J-Flash
A batch file is usefully to simplify the process for the production line and can also be called from an automated PC based tester. The following text initiates the JFlashARM.exe program with the appropriate parameters, erases the chip, auto programs, and exits the application with a return code. The second part of the batch file only serves to provide some useful debugging information.
ECHO off
Page 15 of 19
"C:\fdi\Products\uEZGUI\uEZGUI-1788-43WQR-FCT\JTAG\JFlashARM.exe" openprjC:\fdi\Products\uEZGUI\uEZGUI-1788-43WQR-FCT\JTAG\uEZGUI-1788-43WQR-
FCT.jflash -openC:\fdi\Products\uEZGUI\uEZGUI-1788-43WQR-FCT\JTAG\uEZGUI-1788-
43WQR.hex -erasechip -auto -startapp –exit echo %ERRORLEVEL%
IF ERRORLEVEL 1 goto ERROR goto END
:ERROR
ECHO Error programing unit!
ECHO
ECHO Check that power is properly applied to the unit
ECHO Check that the Segger J-Link is connected to the PC
ECHO and the ready light is solid Green
ECHO Check that the Segger J-Link is connected to the unit
ECHO If in a fixture check that the connection to the fixture
ECHO is properly interest
ECHO If problems persist, insect the area of the board around U1 and Y2
ECHO more JFlashARM.log pause
:END
4.0 Recovering from a Bad Program
Should a board become un-responsive it may be possible to recover the unit using known good code.
Follow the instructions in Production Line Programming (Programing with Script Files) to setup the PC, if you have not already done so.
4.1 FDI Examples
Example script files and working demos can be found in the uEZ Release Package, available on sourceforge.net.
The latest uEZ release can be found at: http://sourceforge.net/projects/uez/files/latest/download?source=directory
After extracting the files the standard demo files can be found in the folder “Precompiled FDI Demos”.
4.2 Recovering the Unit
Units that have been corrupted can be recovered by shorting the ISP Entry pin to ground. This may be required if the PLL is not getting setup properly causing the J-Link to be unable to communicate; or if a unit was programmed with a start address containing something other than the correct start address of the internal flash. The later can happen when the project is setup for the FDI Bootloader, which requires a 64KB offset, but the Base Bootloader is not correctly installed by the user prior to programming.
Typical symptoms of this issue would be a solid status LED on the unit (not flashing) and a failure
Page 16 of 19
message from the IDE or script file. Below are screen shots from the CrossWorks and IAR IDEs and running a script file showing the typical error message related to this issue.
Figure 19: CrossWorks IDE JTAG failure
Figure 20: IAR JTAG Failure Message
Figure 21: IAR JTAG Failure Message
Page 17 of 19
Figure 22: J-Link Script file error message
1. Unplug the JTAG connector and power off the unit.
2. Place the unit LCD down.
3. Using tweezers short pins 3 and 4 of the ISP header, keep the pins shorted until step 6 has completed.
Figure 23: uEZGUI-4088-43WQN-BA ISP Header
Page 18 of 19
Figure 24: Page 1 of the uEZGUI-4088-43WQN-BA Schematic
4. Power ON the unit.
5. Plug in the JTAG connector.
6. Run the script file.
5.0 Appendix A
Some versions of the SEGGER Tools require additional commands to properly program the LPC1788 and/or the LPC4088. Newer versions may not require these steps. The command “w4” is used to write 4 bytes or 1 32-bit word to a memory location.
• w4 0x400FC1A0 0x20 – Set the OSCEN bit in the System Controls and Status register to enable the main oscillator
• w4 0x400FC104 0x01 – Set the CCLKDIV bits in the CPU Clock Selection Register to set the input clock to divide by 1 to produce the CPU clock
• w4 0x400FC080 0x00 – Clear the bits of the PLL Configuration register for PPL0
• w4 0x400FC08C 0xAA – Write the first sequence value to the PLL0 Feed register
• w4 0x400FC08C 0x55 – Write the second sequence value to the PLL0 Feed register
• w4 0x400FC10C 0x01 – Set the CLKSRC to the main oscillator as the sysclk and PLL0 clock source in the Clock Source Selection register
• w4 0x400FC000 0x3A – Write the reset value in to the Flash Accelerator configuration register
• w4 0x400FC040 0x01 – Place the processor into user mode by writing to the MAP bit of the Memory Mapping Control register
Page 19 of 19
advertisement
Key Features
- Program uEZ GUIs using SEGGER J-Link
- Production line programming using script files
- Production programming using J-Flash software
- Recovering from bad programs
- J-Link User’s Manual
- SEGGER J-Links
- J-Flash utility
- J-Link base model
Frequently Answers and Questions
How do I program uEZ GUIs using SEGGER J-Link?
What is SEGGER J-Link?
How do I program uEZ GUIs using script files?
What is J-Flash?
How do I recover from a bad program?
Related manuals
advertisement
Table of contents
- 3 Introduction
- 3 Segger J-Link
- 3 Production Line Programming (Programing with Script Files)
- 3 Associating the Script File with the SEGGER Tools
- 6 Windows 7 “Open with” issues
- 6 Once these steps are complete, return to Section 2.1 step 1 and try again
- 7 Converting HEX Files to Binary Files
- 9 Setting up the Script File
- 10 RX62N
- 11 RX63N
- 11 Setting up the hardware
- 12 Running the Script File
- 13 Production Programming
- 13 Required License
- 13 Setting up the J-Flash Project
- 14 Creating *.jflash File with GUI
- 15 Creating a Batch File to run J-Flash
- 16 Recovering from a Bad Program
- 16 FDI Examples
- 16 Recovering the Unit
- 19 Appendix A