UM08003 JFlash
UM08003 JFlash
UM08003 JFlash
Document: UM08003
Software Version: 8.10
Date: September 25, 2024
www.segger.com
2
Disclaimer
The information written in this document is assumed to be accurate without guarantee. The
information in this manual is subject to change for functional or performance improvements
without notice. SEGGER Microcontroller GmbH (SEGGER) assumes no responsibility for any errors
or omissions in this document. SEGGER disclaims any warranties or conditions, express, implied
or statutory for the fitness of the product for a particular purpose. It is your sole responsibility
to evaluate the fitness of the product for any specific use.
Copyright notice
You may not extract portions of this manual or modify the PDF file in any way without the prior
written permission of SEGGER. The software described in this document is furnished under a
license and may only be used or copied in accordance with the terms of such a license.
© 2004-2018 SEGGER Microcontroller GmbH, Monheim am Rhein / Germany
Trademarks
Names mentioned in this manual may be trademarks of their respective companies.
Brand and product names are trademarks or registered trademarks of their respective holders.
Contact address
SEGGER Microcontroller GmbH
Ecolab-Allee 5
D-40789 Monheim am Rhein
Germany
Tel. +49-2173-99312-0
Fax. +49-2173-99312-28
E-mail: support@segger.com
Internet: www.segger.com
Manual versions
This manual describes the current software version. If you find an error in the manual or a
problem in the software, please report it to us and we will try to assist you as soon as possible.
Contact us for further information on topics or functions that are not yet documented.
Print date: September 25, 2024
Manual
Revision Date By Description
version
Chapter “Command Line interface”
7.86 0 230223 JB * Section “Command line options”: Parameters do not necessarily have to
follow a command directly anymore, a space is now also possible.
Chapter “Menu structure”
7.80 0 221005 JB * Section “Help menu elements”: Added additional wiki links and user
guides.
Chapter “Command Line interface”
* Section “Programming multiple targets in parallel”: Updated batch file
7.68 0 220802 LG example.
* Section “Programming multiple targets in parallel”: Added Python script
example.
All chapters
6.70 0 200416 LG
Updated for new version of J-Flash.
Chapter “Target systems”
6.70 0 200414 LG * Section “Which devices can be programmed by J-Flash?”: Added refer-
ence to SEGGER Wiki article about ’Open Flash Loader’.
All chapters
6.64 0 200324 LG
Updated for recently added cross-platform availability of J-Flash.
Chapter “Settings”
6.55b 0 191114 FF
* Section “Init steps”: Added info about Verify/Write&Verify.
Chapter “Command Line Interface”
6.49 4 190814 LG * Section “Programming multiple targets in parallel”: Updated batch
scripts.
Chapter “Command Line Interface”
6.48b 0 190812 AB * Section “Command line options”: Updated CL option -jlinkdevicesxml-
path.
Chapter “Getting Started”
6.32 4 190418 FF * Section “Menu structure”: added a note in the table “Target menu ele-
ments” for Manual Programming > Program.
Chapter “Settings”
6.32 3 190327 MF * Section “Production setting”: added clarification note for target power
supply.
Chapter “Command Line Interface”
6.32 2 180621 LG
* Section “Command line options”: Added new CL option -setcpuidcode.
Chapter “Command Line Interface”
* Section “Command line options”: Added new CL option -saveas.
6.32 1 180427 LG
* Section “Command line options”: Updated CL option -merge.
* Section “Command line options”: Updated CL option -setrxidcode.
Screenshots updated.
Chapter “Command Line Interface”
6.30 2 180417 NV * Section “Command line options”: Added new CL option -hide.
* Section “Command line options”: Updated CL option -jflashlog.
* Section “Command line options”: Updated CL option -jlinklog.
Screenshots updated.
6.30 1 180216 LG Chapter “Settings”
* Added section “Performance settings”
Chapter “Command Line Interface”
* Section “Command line options”
5.02c 0 150914 RH
Added new commands:
-verifycrca, verifycrcs and verifycrcc
Chapter “Command Line Interface”
5.02a 0 150907 EL
* Section “Command line options” updated.
Chapter “Command Line Interface”
5.00c 0 150611 EL
* Section “Programming multiple targets in parallel” updated.
Manual
Revision Date By Description
version
Chapter “Command Line Interface”
4.98 2 150427 EL * Section “Command line options”
Added new command: -ip and -USB.
Chapter “Background information”
4.98 1 150320 AG * Section “CRC of current data file”
Polynomial corrected.
Chapter “Command Line Interface”
4.98 0 150113 NG
Changed “JFlashARM.exe” to “JFlash.exe”.
Chapter “Device specifics”
4.96 0 150109 EL * Section “ST” updated.
* Section “Freescale” updated.
Chapter “Device specifics”
4.82 0 140307 AG
* Section “ST” updated.
Chapter “Command Line Interface”
4.80 0 131220 AG
* Section “Command line options” updated.
Chapter “Getting Started”
4.73c 0 130703 JL
* Added Section “Start Dialog”
Chapter “Settings”
4.66 1 130320 EL * Section “CPU Settings”
Added description for the core ID “Mask” field
Chapter “Introduction”
4.66 0 130221 JL * Section “What is J-Flash”
Added Linux and Mac OSX
Chapter “Command Line Interface”
4.58 0 121113 JL * Section “Batch processing” updated.
* Section “Command line options” updated.
Chapter “Getting Started”
* Section “Menu structure” updated
Chapter “Settings”
* Section “CPU Settings” updated
4.52 0 120807 EL
Chapter “Command Line Interface”
* Section “Programming multiple targets in parallel” added.
Chapter “Getting Started”
* Section “Sample Projects” updated.
Chapter “Create a new J-Flash project”
4.51i 0 120724 EL
* Section “Configuration for serial number programming” added.
Chapter “Background information”
4.42b 0 120217 AG
* Section “CRC of current data file” added.
4.24 0 110216 AG Chapter “Target systems” updated.
Chapter “Command Line Interface”
4.16 1 100817 AG
* Section “Command line options” corrected.
Chapter “Settings”
4.16 0 100723 KN
* Section “Init sequence” updated.
Chapter “Device specifics”
4.10 4 091204 AG
* Section “Freescale” added.
Chapter “Command Line interface”
4.10 2 090918 AG
* Section “Command line options” updated.
Chapter “Device specifics”
4.10 1 090902 AG
* Section “ST Microelectronics” updated.
Chapter “Device specifics”
4.10 0 090825 AG
* Section “ST Microelectronics” updated.
Chapter “Introduction”
4.04 1 090414 AG
* Section “What is J-Flash?” updated.
Chapter “Command Line Interface”
4.04 0 090204 AG * Section “Overview” updated.
* Section “Command Line Options” updated.
Chapter “Target systems”
* Section “Supported Flash Devices” updated
3.97e 0 081204 KN
Chapter “Settings”
* Section “Init sequence” corrected
Manual
Revision Date By Description
version
Chapter “Working with J-Flash” renamed to
“Create a new J-Flash project.”
Chapter “Create a new J-Flash project”
3.91n 0 080923 AG Chapter “Settings”
* Section “Init sequence” updated.
Chapter “Command Line Interface” updated.
* Section “Create a new J-Flash project” updated.
Chapter “Targets”
3.90 0 080811 AG
* Section “Supported Microcontrollers” updated.
Chapter “Licensing”
3.80 2 080408 AG * Section “Introduction” added.
* Section “License types” added.
Chapter “Target systems”
* Section “Supported Microcontrollers” updated.
3.80 1 080311 AG
Chapter “Working with J-Flash”
* Section “Create a new J-Flash project” updated.
Chapter “Device specifics” added.
3.80 0 080206 SK Chapter “Target systems”
* Section supported MCUs updated.
Chapter “Installation” updated.
Chapter “Command Line Interface”:
3.68 1 070508 SK
* Section “Batch processing” added.
Various improvements.
Chapter “Target systems” updated.
3.66 1 070322 SK
Chapter “Getting started” updated.
3.46 4 061222 SK Section “About” and company description added.
Assumptions
This document assumes that you already have a solid knowledge of the following:
• The software tools used for building your application (assembler, linker, C compiler).
• The C programming language.
• The target processor.
• DOS command line.
If you feel that your knowledge of C is not sufficient, we recommend The C Programming Lan-
guage by Kernighan and Ritchie (ISBN 0--13--1103628), which describes the standard in C pro-
gramming and, in newer editions, also covers the ANSI C standard.
Table of contents
1 Introduction ..................................................................................................................11
1.1 What is J-Flash? .......................................................................................... 12
1.1.1 Supported Operating Systems .............................................................12
1.1.2 Features ...........................................................................................12
1.2 Assumptions ................................................................................................ 13
1.3 Requirements .............................................................................................. 14
2 Licensing ..................................................................................................................... 15
4 Settings ....................................................................................................................... 28
4.1 Project Settings ........................................................................................... 29
4.1.1 General Settings ............................................................................... 29
4.1.2 Target Interface Settings ....................................................................30
4.1.3 MCU Settings ....................................................................................32
4.1.4 Flash Settings ...................................................................................36
4.1.5 Production settings ............................................................................39
4.1.6 Performance settings ......................................................................... 41
4.2 Global Settings ............................................................................................ 42
8 Performance ................................................................................................................57
10 Support ......................................................................................................................60
10.1 Troubleshooting .......................................................................................... 61
10.1.1 General procedure ........................................................................... 61
10.1.2 Typical problems ............................................................................. 61
10.2 Contacting support ..................................................................................... 63
Introduction
The following chapter introduces J-Flash, highlights some of its features, and lists its re-
quirements on host and target systems.
1.1.2 Features
• Any ARM7/ARM9/ARM11, Cortex-M0/M1/M3/M4/M7, Cortex-A5/A8/A9/R4/R5 and
Renesas RX600 core supported
• Microcontroller (internal flash) support.
• Support for most external flash chips (For more information please refer to Target
systems on page 54).
• High speed programming: up to 550 KBytes/s* (depending on flash device).
• Smart read back: only non-blank portions of flash are transferred and saved.
• Free evaluation licenses available.
• Verbose logging of all communication.
• .hex, .mot, .srec, .bin and .elf support.
• Intuitive user interface.
* = Measured with J-Link V10
1.2 Assumptions
This user manual assumes that you already possess working knowledge of the J-Link device.
If you feel that your knowledge of J-Link is not sufficient, we recommend the J-Link Manual
(UM08001), which describes the device and its use in detail.
1.3 Requirements
• J-Link / Flasher
• Supported operating system (see Supported Operating Systems on page 12)
• Interface from Host to probe (USB, Ethernet, WiFi, …)
• Supported device/core (see Supported microcontrollers on page 56)
Licensing
J-Flash may be installed on as many host machines as you want. Without a license key
J-Flash can still be used to open project files, read from connected devices, blank check
target memory, verify data files and so on. However to actually program devices via J-Flash
and J-Link, a valid license is required. For an overview which SEGGER products come with
a built-in license for J-Flash, please refer to the J-Link Model overview . All Flasher models
come with a built-in license for J-Flash.
Getting Started
3.1 Setup
The J-Link setup procedure required in order to work with J-Flash is described in chapter 2
of the J-Link / J-Trace User Guide (UM08001). The J-Link / J-Trace User Guide (UM08001) is
part of the J-Link Software and Documentation Pack which is available for download under
segger.com/jlink-software.html .
Directory Contents
Welcome Dialog
The startup dialog provides the following options:
• Open existing project: Select a project from the list of recent projects or press
Other… to open another existing project.
• Create new project: Opens another dialog to create a new J-Flash project
If “Do not show this message again.” is checked, J-Flash will execute the option currently
selected automatically on future starts without showing the welcome dialog again.
Setting Meaning
Example
An 8-byte serial number should be programmed at address 0x08000000. It should be pro-
grammed as follows in the memory:
0x08000000: 0x01 0x02 0x03 0x04 0x55 0x66 0x77 0x88
The serial number list file should look as follows:
0102030455667788
SN list example
The number of bytes to read per line is configured via the Len option in J-Flash. For more
information, please refer to Serial number settings on page 21.
Which line J-Flash will read at the next programming cycle is configured via the Next SN
option. For more information, please refer to Serial number settings on page 21. In this
case Next SN needs to be set to 0, since programming should be started with the serial
number bytes defined in the first line of the file.
Note
If the number of bytes specified in a line of the serial number list file is less than the
serial number length defined in the project, the remaining bytes are filled with 0s by
Flasher ARM.
Note
If the number of bytes specified in a line of the serial number list file is greater than
the serial number length defined in the J-Flash project, the remaining bytes will be
ignored by J-Flash
Note
When using Windows 7, please make sure that the used project file is located at a
folder with write permission.
• Increment is 1
New project Creates a new project (See Creating a new J-Flash project)
Opens a J-Flash project file. Please note that only one project file
Open project may be open at a time. Opening a project will close any other
project currently open.
Save project Saves a J-Flash project file.
Save project as… Saves a J-Flash project file using the name and location given.
Close project Closes a J-Flash project file.
Saves a .CFG file for stand-alone mode using the name and loca-
Save Flasher config
tion given. Please refer to the Flasher documentation (UM08022)
file…
for more information regarding stand-alone mode.
Saves a .DAT file for stand-alone mode using the name and loca-
Save Flasher data
tion given. Please refer to the Flasher documentation (UM08022)
file…
for more information regarding stand-alone mode.
Prepares a connected Flasher for stand-alone mode using the
Download config & current project and the data file which had focus most recently.
data file to Flasher Please refer to the Flasher documentation (UM08022) for more
information regarding stand-alone mode.
Download serial Downloads a serial number file to a connected Flasher. Please re-
number file to Flash- fer to the Flasher documentation (UM08022) for more informa-
er tion regarding stand-alone mode.
Recent Files Contains a list of the most recently open data files.
Recent Projects Contains a list of the most recently open project files.
Generates data which can be used to test if the flash can be pro-
Test > Generate test
grammed correctly. The size of the generated data file can be de-
data
fined.
Writes data of an specified size to an defined address, reads the
Test > Test speed
written data back and measures the up- and download speed.
Test > Show CFI in-
Reads the CFI query information of a CFI compliant flash device.
fo
Test > Hardware > Sets the RS232 Busy signal of a connected Flasher. Can be used
Activate BUSY to test the RS232 setup.
Test > Hardware > Resets the RS232 Busy signal of a connected Flasher. Can be
Deactivate BUSY used to test the RS232 setup.
Test > Hardware > Sets the RS232 OK signal of a connected Flasher. Can be used to
Activate OK test the RS232 setup.
Test > Hardware > Resets the RS232 OK signal of a connected Flasher. Can be used
Deactivate OK to test the RS232 setup.
Command Description
Programs the chip using the currently active data file. Please
Manual Program-
note that no erase / blank check is performed prior programming
ming > Program
so the flash is assumed to be in an erased state.
Manual Program-
Programs the chip using the currently active data file and then
ming > Program &
verifies that it was written successfully.
Verify
Manual Program-
Verifies the data found on the chip with the data file.
ming > Verify
Manual Program-
Reads back the data found in the selected sectors and creates a
ming > Read back >
new data file to store this information.
Selected Sectors
Manual Program-
Reads back the data found on the chip and creates a new data
ming > Read back >
file to store this information.
Entire chip
Manual Program-
Reads back the data found in a range specified by the user and
ming > Read back >
creates a new data file to store this information.
Range
Manual Program-
ming > Start Appli- Starts the application.
cation
Settings
The following chapter provides an overview of the program settings. Both general and per
project settings are considered.
General Settings
USB
If this option is checked, J-Flash will connect to J-Link / Flasher over the USB port. The de-
fault device number is 0. For more information about how to use multiple J-Link / Flasher on
one PC, please see also the chapter “Working with J-Link” of the J-Link Manual (UM08001).
USB S/N
If this option is checked, J-Flash will connect to J-Link / Flasher over the USB port. J-Flash
will only use the J-Link / Flasher with the specified S/N and any operation will fail if the J-
Link / Flasher with specified S/N is not connected or cannot be used for any reason.
TCP/IP
If this option is checked, J-Flash will connect to J-Link / Flasher via TCP/IP. This should
be configured for SEGGER probes connected via Ethernet directly (e.g. J-Link PRO, Flasher
PRO, …) or using the J-Link Remote Server. The hostname (or IP address) of the system
to connect to be may be entered in the textbox for TCP/IP. For connections via the J-Link
Remote Server the according connection string may be entered.
In the simplified user interface some options are disabled to reduce possible error sources
in the production phase.
JTAG-chain
The position of the device to connect with J-Flash is selected from the Position dropdown
menu. The Instruction Register length (IRLen) of a device is defined by its manufacturer.
For ARM cores, the IRLen is always four, which is why the value of IRLen is by default set to
four times the position indicated. This works fine for ARM only scan chains. However, if any
non-ARM devices are introduced to the scan chain the IRLen must be modified accordingly.
MCU Settings
J-Flash can be used to program both external or internal flash memory. In order to use J-
Flash with an external flash device, the proper Core must be selected.
To program internal flash devices, the respective microcontroller must be selected in the
Device list by clicking the … button. If a microcontroller is not found on this list, contact
SEGGER, as new microcontrollers are continuously being added.
Device
Select the respective microcontroller from the list to program internal flash devices. In
order to program external flash, select the device or core from the list.
Clock speed
For some devices, the actual CPU clock frequency in Hz of the MCU is required to guarantee
accurate operation of J-Flash. By default, J-Flash uses the “Auto” CPU speed detection
feature.
Endianness
The compatible endianness of the selected device is set automatically if possible. Otherwise,
select little endian or big endian from the dropdown menu accordant to the device.
Mask
This option allows the user to mask out specified bits of the core ID. All bits set to 0 in
“Mask” are not taken into account when comparing the Code ID found by the J-Link / Flasher
with the Core ID entered in J-Flash.
Example:
must be disabled manually. To use these chips the user must first perform the required
initialization.
This dialog allows the user to enter a custom initialization sequence using a predefined list
of operations. After choosing an operation and corresponding values to be associated with
the operation, a comment may be added to make it easier for others to determine its effect.
The following list shows all valid commands which can be used in an init sequence:
Note
All “Write *” commands may only be used to write RAM or SFR registers, but not Flash
memory. Flash memory can only be influenced by altering the data file. The data file
can changed in the init steps by using the “Write File*” commands.
Note
Exit steps are only performed for Target -> Production Programming operations.
Organization
For some flashes (e.g. CFI compliant NOR flashes), the organization needs to be specified.
The organization settings make it possible to configure the bus width and the number of
flash chips connected to the address and data bus of the MCU.
ID checking
There are two other checkboxes that are of interest in this subsection which are Check
manufacturer flash Id and Check product flash Id. These checkboxes should be se-
lected to confirm the type of device that is in communication with J-Flash.
Production Settings
Delay before start defines the delay (in ms) after enabling the target power supply and
before starting to communicate with the target.
Discharge target on disconnect causes a discharge of any capacities left on the target
on disconnect.
Note
The option VTGT for power source is for Flasher ATE only. Other Flasher models will
use VCC5V, even when VTGT is selected.
Note
The option Discharge target on disconnect is for Flasher ATE only and will be ig-
nored by the other Flasher models.
Performance Settings
Note
This check takes place for Target -> Production Programming as well as Target
-> Manual Programming.
On "Verify"
Configures the type of verify that takes place:
• via CRC
• via readback
Global Settings
Global settings are available from the Options menu in the main window.
This chapter describes the J-Flash command line interface. The command line interface
allows using J-Flash in batch processing mode and other advanced uses.
5.1 Overview
In addition to its graphical user interface (GUI), J-Flash supports a command line mode as
well. This makes it possible to use J-Flash for batch processing or automatization purposes.
All important options accessible from the menus are available in command line mode as
well. If command line options are provided, J-Flash will still start its GUI, but processing
will start immediately.
The screenshot below shows the command line help dialog, which is displayed if J-Flash is
started with the command line parameter -help or -?:
JFlash.exe -help
JFlash.exe -?
Option Description
-? Displays the help dialog.
Executes the steps selected in Production Pro-
-auto gramming. Default: Erases, programs and veri-
fies target.
-checkblank Blank checks target.
-connect Connects to the target.
-delrange<SADDR>,<EADDR> Deletes data in the given range.
-disconnect Disconnects from the target.
-download Downloads configuration to emulator.
-eliminate Eliminates blank areas in data file.
-erasechip Erases the entire flash chip.
-erasesectors Erases selected sectors.
-exit Exits J-Flash.
-help Displays the help dialog.
-jflashlog<FILENAME> Sets a temporary J-Flash logfile.
-jlinklog<FILENAME> Sets a temporary J-Link logfile.
-jlinkdevicesxmlpath<PATH> Sets the path to the JLinkDevices.xml file.
• -merge<FILENAME> Merges a given data file with the one currently
• -merge<FILENAME>.bin,<ADDR> opened in J-Flash.
-min Starts J-Flash minimized
-open<FILENAME>[,<SADDR>] Opens a data file
Opens an existing project file. This will also au-
-openprj<FILENAME> tomatically open the data file that has been re-
cently used with this project.
-production Same as -auto
-program Programs the target.
-programverify Programs and verify the target.
-readchip Reads the entire flash chip.
-readsectors Reads selected sectors.
-readrange<SADDR>,<EADDR> Reads specified range of target memory.
-relocate<OFFSET> Relocates data by the given offset.
Option Description
Saves the current data file. Please note that
-save[<SADDR>,<EADDR>] the parameters <SADDR>,<EADDR> apply on-
ly if the data file is a *.bin file or *.c file.
Saves the current data file in the specified
-saveas<FILENAME>[,<SAD- file. Please note that the parameters <SAD-
DR>,<EADDR>] DR>,<EADDR> apply only if the data file is a
*.bin file or *.c file.
-savecfg<FILENAME> Saves emulator config file.
-savedat<FILENAME> Saves emulator data file.
-saveprj Saves the current project.
-saveprjas<FILENAME> Saves the current project in the specified file.
-securechip Secures target device.
Sets the CPU ID code to be used by the DLL
-setcpuidcode<IDCodeString>
(e.g. during authentication process).
Sets the RXIDCode to be used by the DLL.
-setrxidcode<IDCodeString> Additional info <IDCodeString>: 32 characters,
16 IDCode bytes
-startapp Starts the target application.
-unsecurechip Unsecures target device.
-verify Verifies the target memory.
-usb<SN> Overrides connection settings to USB S/N.
• -ip<xxx.xxx.xxx.xxx>
Overrides connection settings to IP.
• -ip<HostName>
-hide Starts J-Flash hidden.
@ECHO OFF
ECHO Open a project and data file, start auto processing and exit
JFlash.exe -openprjC:\Projects\Default.jflash -openC:\Data
\data.bin,0x100000 -auto -exit
IF ERRORLEVEL 1 goto ERROR
goto END
:ERROR
ECHO J-Flash ARM: Error!
pause
:END
Note
Every call of JFlash.exe has to be completed with the -exit option, otherwise the
execution of the batch file stops and the following commands will not be processed.
ParallelProgramming.bat
Executing this file starts parallel programming using J-Flash.
Note
The “List of jobs” section contains placeholders and must be adjusted to use the
desired Flasher serial numbers, J-Flash project file(s) and data file(s). Furthermore,
the list may be expanded to run more sessions of J-Flash in parallel.
@ECHO OFF
REM
REM List of jobs
REM Serial no. J-Flash project file Data file
set aJobs[0]=1015000001 Path\To\ProjectFile.jflash Path\To\DataFile.hex
set aJobs[1]=1015000002 Path\To\ProjectFile.jflash Path\To\DataFile.hex
set aJobs[2]=1015000003 Path\To\ProjectFile.jflash Path\To\DataFile.hex
REM set aJobs[3]=1015000004 Path\To\ProjectFile.jflash Path\To\DataFile.hex
REM set aJobs[4]=1015000005 Path\To\ProjectFile.jflash Path\To\DataFile.hex
REM set aJobs[5]=1015000006 Path\To\ProjectFile.jflash Path\To\DataFile.hex
REM set aJobs[6]=1015000007 Path\To\ProjectFile.jflash Path\To\DataFile.hex
REM [...]
REM
REM
REM :Main
REM
REM Function description
REM Entry point for the batch script
REM Starts multiple instances of J-Flash and waits until all of them have
exited
REM
:Main
REM
REM Enable the use of variables inside the for loop by using delayed variable
expansion
REM
setlocal ENABLEDELAYEDEXPANSION
REM
REM In order to wait for all processes to finish, lock files are used which are
located at %temp%
REM Each process blocks its corresponding lock file as long as the process is
alive.
REM
set "lock=%temp%\wait!random!.lock"
REM
REM :WaitForUnlock
REM
REM Function description
REM This function waits for the passed lock file to be accessible
REM
REM Parameters
REM %~1 Lock file path
REM
:WaitForUnlock
goto :Start
:Retry
REM
REM This is a ping to the IPv6 local loopback address which is used to burn
some time waiting for J-Flash to finish.
REM There is a 1 sec delay between two pings, so /n 2 generates a sleep for at
least 1 sec.
REM
1>nul 2>nul ping /n 2 ::1
:Start
call 9>"%~1" || goto Retry
exit /b
StartJFlash.bat
This file is used as a helper file for ParallelProgramming.bat and should not be executed
on its own.
Note
The path to the J-Flash executable (“JFlash.exe”) may be adjusted to fit the envi-
ronment this file is used in.
@ECHO OFF
REM
REM Expected parameters passed to this script:
REM %1 S/N of USB Flasher
REM %2 Path to project file
ParallelProgramming.py
Note
The list of job information (_aJobs) contains placeholders and must be adjusted to use
the desired J-Flash command line options. Furthermore, the list may be expanded to
run more sessions of J-Flash in parallel. Additionally, the path to the J-Flash executable
(_PATH_JFLASH_EXE) may be adjusted to fit the environment this file is used in.
#/*********************************************************************
#*
#* Version Check
#*
#**********************************************************************
#*/
import os
import sys
import subprocess
#/*********************************************************************
#*
#* Defines
#*
#**********************************************************************
#*/
#/*********************************************************************
#*
#* Classes
#*
#**********************************************************************
#*/
class JOB_INFO:
#/*********************************************************************
#*
#* List of jobs
#*
#**********************************************************************
#*/
#/*********************************************************************
#*
#* Functions / Code
#*
#**********************************************************************
#*/
#/*********************************************************************
#*
#* main()
#*
#* Function description
#* Handles parallel programming via multiple J-Flash instances
#*/
def main():
aProc = []
#
# Sanity check
#
r = os.path.exists(_PATH_JFLASH_EXE)
if (r == False):
print("Could not find J-Flash at", _PATH_JFLASH_EXE)
input("Press <Return> to exit...")
return -1
#
# Go through jobs and start J-Flash instance for each job
#
print("Starting J-Flash...")
for JobInfo in _aJobs:
aCmd = [_PATH_JFLASH_EXE] # The first arg passed to subprocess.Popen is the
path to the executable
aCmd += JobInfo.ParamList
hProc = subprocess.Popen(aCmd, shell=True)
aProc.append(hProc)
#
# Go through processes and wait for each to finish executing
#
print("Waiting for J-Flash to finish...")
Result = 0
for hProc in aProc:
hProc.wait()
r = hProc.returncode
if (r != 0): # Error occurred? => Print error message including
arguments for identification of failed session
Result = -1
print("Error occurred for following J-Flash instance:", hProc.args)
if (Result == 0): # No errors occurred?
print("Success!")
print("Done.")
input("Press <Return> to exit...")
return Result
#/*********************************************************************
#*
#* Main
#*
#**********************************************************************
#*/
if __name__ == "__main__": # only executed if this module is executed directly,
not if its imported
main()
Device specifics
For some devices, special handling might be required. In order to find out if special handling
is necessary for the used device, please refer to the SEGGER wiki: SEGGER Wiki: Device
specifics
Target systems
Performance
For programming speed measurements, please refer to the SEGGER website: Internal
Flash programming performance
Background information
This chapter provides some background information about specific parts of the J-Flash
software.
Support
The following chapter provides information about how to contact our support.
10.1 Troubleshooting
10.1.1 General procedure
• Make sure the J-Link / Flasher is working as expected. See the troubleshooting article
in the SEGGER wiki: SEGGER Wiki: J-Link / J-Trace / Flasher Troubleshooting
• Ensure that the target hardware matches the project file settings. Pay special attention
to the following aspects:
- Init sequence
- Clock speed
- RAM address
- Flash base address
- MCU / Flash chip
- Flash organization
• The interface clock frequency depends on several factors, e.g. cable length, target board
etc. Try setting the frequency to lower or higher values accordingly.
• Make sure the flash memory is unlocked before programming or erasing.
Unexpected core ID
Meaning:
The specified CPU core ID does not match with the one read from the target CPU.
Remedy:
Ensure the specified core ID is correct for the used target CPU. See section MCU Settings
for information about setting the core ID.
No matching RAMCode
Meaning:
There is no programming algorithm available for the selected target memory type.
Remedy:
Inform us about the flash type you want to use. SEGGER is constantly adding support for
new flash memory devices.
Ecolab-Allee 5
D-40789 Monheim am Rhein
Germany
Tel. +49-2173-99312-0
Fax. +49-2173-99312-28
E-mail: support@segger.com
Internet: www.segger.com