05192024

Last update2016/05/28 14:38

Back 現在地: Home パートナー segger-tools

J-Link Ultra Flash Download

J-Link Flash Download

 

J-Link comes with a set of highly speed-optimized built-in flashloaders which allow fast download of applications, directly into the flash memory of your target system. This flash memory can be internal, on-chip flash memory or external CFI-compliant NOR flash memory.

And the best of all: This feature is free of charge.

What makes J-Link's built-in flash programming so much faster ?

The flashloaders which come with the J-Link software (JLinkARM.dll) are a set of so-called "RAMCodes" which are small programs that include the logic for erasing and programming the flash memory. These RAMCodes are downloaded into and are executed in the RAM of the target system.

But the flash-algorithm itself is not the only thing which makes the J-Link flashloaders so extremely fast. In addition to this, only the flash-sectors which are needed to be programmed are programmed by J-Link.

What does this mean?: By default, the J-Link DLL is configured to check if the same application which is intended to download, is already present in the flash of the target memory. If this is the case, the flash download it skipped which saves a lot of time. The process of checking if the target application is already in flash is also a highly speed-optimized process since this check is performed by a CRC comparison.

Moreover, if you are debugging, usually your target application continuously changes and the debug session is terminated and re-started multiple times. J-Link is also able to detect only small changes in your target application which means that only the parts which have been changed are re-downloaded if the debug session is re-started.

To get a better idea of what difference the above mentioned logic makes, in the following you will find a speed comparison test which has been performed with the J-Link flash download.

For the speed comparison test, a standard IAR EAWRM sample project and the maximum supported JTAG frequency (usually 12 MHz) has been used. All time values have been taken from the point where downloading starts until the debugger is ready to start debugging (application arrived at main()).

 

Emulator Settings Download-Time
Toshiba TMPM330FDFG, 512 KB application size
J-Link V8 J-Link commander1 5 sec. (102 KB/s)
J-Link Ultra J-Link commander1 4.2 sec. (122 KB/s)
J-Link V8 IAR EWARM flashloader 10.6 sec. (48 KB/s)
J-Link V8 SEGGER flashloader,
flash content completely different from application
9.5 sec. (54 KB/s)
J-Link V8 SEGGER flashloader,
flash content almost identical to application
(only the value of a constant variable has been changed)
7.8 sec. (66 KB/s)
J-Link V8 SEGGER flashloader,
flash content identical to application
2.8 sec. (183 KB/s)
Freescale MK40X256VMD100 (Cortex-M4 Kinetis), 256 KB application size
J-Link V8 J-Link commander2 8.3 sec. (31 KB/s)
J-Link Ultra J-Link commander2 7.5 sec. (34 KB/s)
J-Link V8 IAR EWARM flashloader 16.7 sec. (15.3 KB/s)
J-Link V8 SEGGER flashloader,
flash content completely different from application
16.4 sec. (15.6 KB/s)
J-Link V8 SEGGER flashloader,
flash content almost identical to application
(only the value of a constant variable has been changed)
3.9 sec. (65.6 KB/s)
J-Link V8 SEGGER flashloader,
flash content identical to application
2.8 sec. (91 KB/s)
ST STM32F103ZE, 512 KB application size
J-Link V8 J-Link commander3 25.8 sec. (20 KB/s)
J-Link Ultra J-Link commander3 25.8 sec. (20 KB/s)
ST-Link IAR EWARM flashloader 45 sec. (11.4 KB/s)
J-Link V8 IAR EWARM flashloader 28 sec. (18.3 KB/s)
J-Link V8 SEGGER flashloader,
flash content completely different from application
26 sec. (20 KB/s)
J-Link V8 SEGGER flashloader,
flash content almost identical to application
(only the value of a constant variable has been changed)
9.7 sec. (53 KB/s)
J-Link V8 SEGGER flashloader,
flash content identical to application
5.5 sec. (93 KB/s)

1J-Link commander has been used as follows:
speed 20000
exec device = TMPM330FDFG
loadbin C:\TMPM330.bin,0

2J-Link commander has been used as follows:
speed 20000
exec device = MK40X256VMD100
loadbin C:\MK40.bin,0

3J-Link commander has been used as follows:
speed 20000
exec device = STM32F103ZE
loadbin C:\STM32.bin,0x08000000

Why do the speeds differ between different devices with the same CPU core?

Download speed into RAM is identical for all devices, but flash programming speed depends heavily on the flash technolgy and flash controller used. On most devices, J-Link speed is so high that the limiting factor is the time that it takes to erase the flash memory and to copy the data from RAM to flash.

Does the data above include the time it takes to erase the flash?

Yes, in all cases in which the flash is programmed the required sectors are also erased. This time is included.

Debuggers with support for J-Link flash download:

Currently, the flash download feature of J-Link is supported by the following debuggers/workbenches:

  • IAR Embedded Workbench for ARM (IAR EWARM)
  • Keil RealView MDK
  • Yagarto GNU ARM Toolchain (free) + J-Link GDB Server
  • GNU Debugger (GDB) + J-Link GDB Server
  • RDI + any RDI compliant debugger

But in general, the flash download feature can be used with every workbench which supports J-Link, since even if it is not possible to select your target device in the debugger, you can always select it in the J-Link control panel, which is opened when a debug session starts.

Download into flash memory for production purposes

  • Flasher ARM - Stand-alone flash programming solution. Flasher ARM is a programming tool for ARM/Cortex devices with internal or external flash memory. Flasher ARM is designed for programming flash targets with the J-Flash software or stand-alone. Flasher ARM can also operate as a normal J-Link.
  • J-Flash - Complete flash programming solution. J-Flash is a Windows application, which can program internal and external flash on ARM/Cortex devices. J-Flash can be used as a GUI-based application or in batch mode.
  • J-Link Flash SDK - An enhanced version of the J-Link SDK, which comes with an DLL with API functions for flash programming (erase, program verify). Ideally for customers which are planning to built their own application for production process.

Enabling J-Link built-in flashloaders in different debuggers

Usually, in order to enable the J-Link built-in flashloaders you only need to disable the debugger's flashloader. Since the built-in flashloaders of J-Link make flash behave as RAM , when the debugger writes to the target memory, the J-Link DLL automatically detects if the memory range which is written in flash memory or not. If the affected memory area is in flash memory, the J-Link flashloader will become active and performs the programming of the flash memory automatically in a very short time. Please note that the correct device has to be selected in the debugger in order to tell J-Link which device is intended to be programmed.

The following screenshot illustrates how to disable the IAR EWARM flashloader, in order to use the J-Link built-in flashloader.

 

J-Link Ultra RDI

J-Link ARM RDI

 

Support for RDI compatible ARM debuggers

The JLink-RDI software is an RDI interface for J-Link. It makes it possible to use J-Link with any RDI compliant debugger. The package consists of 2 DLLs, which need to be copied to the same folder. In order to use these DLLs, they need to be selected in the debugger. It is a separate item and not included in the J-Link software. For more information on the pricing please check out our Pricelist.

Software download

Supported ARM Debuggers

J-Link RDI can be used with any RDI-compliant debuggers. In the following all RDI compliant debuggers which have been tested with J-Link RDI are listed.

  • ARM® Developer Suite (ADS)
  • ARM® RealView® Development Suite (RVDS) V3.0 (Since RVDS 3.1 removed RDI support, J-Link RDI will not work with RVDS 3.1)
  • IAR Embedded Workbench for ARM (EWARM)
  • RealView® Microcontroller Development Kit (Keil MDK)

For more information about how to use RDI with debuggers listed above, please refer to the J-Link RDI User's Guide (UM08004).

Flash breakpoints

The RDI DLL allows setting software breakpoints in flash memory areas, in the following called flash breakpoints. This makes it possible to set an unlimited number of flash breakpoints, rather than just the 2 hardware breakpoints permitted by the ICE. Setting flash breakpoints is executed very fast using a RAMcode specially designed for this purpose; on chips with fast flash the difference between breakpoints in RAM and Flash is unnoticeable.

More information about flash breakpoints

Configuration

RDI allows various configuartion settings, such as:

  • Target system initialization via setup file
  • JTAG Speed and scan chain settings
  • Enable / disable Flash programming
  • Breakpoint settings (use software breakpoints, use flash breakpoints
  • CPU specific settings (Endianess, Reset strategy)
  • Enable / Disable Logfiles

Commands in the setup file

Command Description
SetJTAGSpeed(x); Sets the JTAG speed, x = speed in kHz (0=Auto)
Delay(x); Waits a given time,
x = delay in milliseconds
Reset(x); Resets the target,
x = delay in milliseconds
Go(); Starts the ARM core
Halt(); Halts the ARM core
Read8(Addr); Reads a 8/16/32 bit value,
Addr = address to read (as hex value)
Read16(Addr);
Read32(Addr);
Verify8(Addr, Data); Verifies a 8/16/32 bit value,
Addr = address to verify (as hex value)
Data = data to verify (as hex value)
Verify16(Addr, Data);
Verify32(Addr, Data);
Write8(Addr, Data); Writes a 8/16/32 bit value,
Addr = address to write (as hex value)
Data = data to write (as hex value)
Write16(Addr, Data);
Write32(Addr, Data);
WriteVerify8(Addr, Data); Writes and verifies a 8/16/32 bit value,
Addr = address to write (as hex value)
Data = data to write (as hex value)
WriteVerify16(Addr, Data);
WriteVerify32(Addr, Data);
WriteRegister(Reg, Data); Writes a register
WriteJTAG_IR(Cmd); Writes the JTAG instruction register
WriteJTAG_DR(nBits, Data); Writes the JTAG data register

Example of setup file

/*********************************************************************
*
*    Setup file for J-LINK RDI
*
**********************************************************************
* File:    LPC2294.setup
* Purpose: Setup for Philips LPC2294 chip
**********************************************************************
*/
SetJTAGSpeed(1000);
Reset(0);
Write32(0xE01FC040, 0x00000001); // Map User Flash into Vector area at (0-3f)
Write32(0xFFE00000, 0x20003CE3); // Setup CS0
Write32(0xE002C014, 0x0E6001E4); // Setup  PINSEL2 Register
SetJTAGSpeed(2000);

 

J-Link Ultra SDK

J-Link SDK

 

The J-Link DLL is a standard Windows DLL typically used from "C" (Visual Basic or Delphi projects are also doable).
It makes the entire functionality of J-Link available thru the exported functions. The functionality includes things such as halting / stepping the ARM core, reading / writing CPU and ICE registers and reading / writing memory. Therefore it can be used in any kind of application accessing an ARM core.

The J-Link ARM SDK comes with different sample applications in source code which demonstrate the usage of the J-Link DLL API. The following table gives a short overview about the sample applications which come with the SDK:

Name Description
DCCTest.c Sample application which demonstrates DCC communication with the target CPU by using the J-Link DCC API functions.
FlashDownload.c Uses the J-Link DLL flash download functionality (does not need an additional license) in order to download a .bin file into the internal flash memory of a microcontroller

ReadId.c

Sample application which reads out and shows the JTAG-ID of the target device

Sample_RAWTRACE.c

Sample application which demonstrates the usage of the RAWTRACE API functions
TestHW.c Several hardware tests like checking memory, target power and core ID
Main.c Source code of J-Link commander. This tool permits some simple commands such as memory dump, halt, step, go and Id-check as well as some more in-depths analysis of the state of the ARM core and the ICE breaker module.


The standard DLL does not have API functions for flash programming. However, the functionality offered can be used to program the flash. In that case a flashloader is required.

Supported CPU cores

The J-Link SDK always supports all cores which are also supported by the current version of the J-Link software,
such as:
  • ARM7TDMI
  • ARM7TDMI-S
  • ARM720T
  • ARM920T
  • ARM922T
  • ARM926EJ-S
  • ARM946E-S
  • ARM966E-S
  • ARM1136
  • ARM1156
  • ARM1176
  • Cortex-M0
  • Cortex-M1
  • Cortex-M3
  • Cortex-M4

What do I need to write my own program with J-Link?

The J-Link ARM SDK is needed if you want to write your own program with J-Link. The listed files in the table below are included in the J-Link ARM SDK.
For more information on how to obtain a license please contact このメールアドレスはスパムボットから保護されています。閲覧するにはJavaScriptを有効にする必要があります。 .'; document.write(''); document.write(addy_text66529); document.write('<\/a>'); //-->\n このメールアドレスはスパムボットから保護されています。閲覧するにはJavaScriptを有効にする必要があります。

Files Contents
GLOBAL.h
JLinkARMDLL.h
Header files that must be included to use the DLL functions. These files contain the defines, typedefs and function declarations.
JLinkARM.lib Library contains the exports of the J-Link DLL.
JLinkARM.dll The DLL itself.
main.c Sample application, which calls some J-Link ARM DLL functions.
JLink.dsp
JLink.dsw
Project files of the sample application. Double click "JLink.dsw" to open the project.
JLink.exe Compiled version of the sample application.
JLinkARMDLL.pdf Documentation.
Release.html Release notes.
JMem.exe Life memory viewer (Displays content of target memory).
JLinkServer.exe J-Link TCP/IP server (allows using J-Link via TCP/IP networks).
jlink.inf
jlink.sys
J-Link ARM USB driver.

How do I use the flash programming capabilities of the J-Link DLL?

The J-Link DLL supports direct download into the internal flash memory of most microcontrollers.
In order to use this functionality in your own application, you simply have to select the appropriate device.

After the device has been selected, you can perform a download into flash memory by simply performing a memory write access to a flash address. The flash loader makes flash behaving as RAM, so the user does not have to take care about,
whether he is writing to an address which is in RAM or in flash.

Note: The J-Link SDK comes with a sample application which demonstrate the usage of the flash download functionality.

Development environment (compiler)

Any "C/C++" compiler will do. Workspace (Project) file is for Microsoft Visual Studio (V6.0) or Visual Studio .net (V7.0 or newer).
Other compilers will work as well, but no example workspace is provided.

Using the sample applications

The sample application can be used to test the correct installation and proper function of the J-Link ARM. The SDK comes with different sample applications for different purposes.

By default, when opening JLink.dsw the ReadId.c sample application is selected. This application opens the DLL and connects to the J-Link. If the connection has been established successfully, the JTAG-ID of the target device is read.
The sample applications are supplied in source code form. To run the sample applications, you have to compile them with an ANSI "C" compiler. A project workspace for Microsoft Visual C++ 6.0 or Microsoft Visual .Net which contains all sample applications, is supplied with the SDK.

Compiling and running the sample application

Open the project workspace with a double click on JLink.dsw, compile the source with Build | Build JLink.exe (Shortcut: F7) and run the executable with Build | Execute JLink.exe (Shortcut: CTRL-F5) from the menu.

After the application has been started, you should see the following output:

Requirements

The following items are required to develop software for J-Link:

  • PC running Windows 2000, Windows XP, Windows Server 2003 or Windows Vista.
  • J-Link ARM
  • ARM target system
  • x86 compiler, linker, opt. IDE

 

Microchip PIC32 V2 日本語

マイクロチップPIC32のV2の

 

マイクロチップPIC32のデモボードV2の

コントローラ:
  • PIC32MX460
のCPU:
  • PIC32の
委員会の主な機能:
  • LGDP4531ディスプレイコントローラ
  • 3.5"4分の1のVGA TFT液晶本当にグラフィックLCDの
  • MicroSDカードスロット
  • 温度センサ
  • オーディオin-/output
  • ミニUSBホストコネクタ
  • ミニUSBデバイスのコネクタ
  • バッテリを介して電源利用可能
コントローラの主な機能:
  • 5段パイプラインのMIPSのM4K TMの32ビットコア
  • シングルサイクル自律複数の除算ユニット
  • 最大40%小さなコードサイズMIPS16eモード
  • ユーザーとカーネルモードでは、堅牢な組み込みシステムを有効にするには
  • 2つの32ビットコアは割り込み遅延を減らすためにファイルを登録する
  • 個別に複数の割り込みベクタのプログラマブル優​​先順位とサブの優先順位
  • 中古Flashからの実行を高速化するためにキャッシュモジュールを取得する
利用可能なソフトウェア:

Microchip PIC32 日本語

 

マイクロチップPIC32のデモボード

コントローラ:
  • PIC32MX460
のCPU:
  • PIC32の
委員会の主な機能:
  • S6D0129は、コントローラを表示する
  • 4分の1のVGA TFT液晶マイクロチップのグラフィック液晶3.5"
  • MicroSDカードスロット
  • 温度センサ
  • オーディオin-/output
  • ミニUSBホストコネクタ
  • ミニUSBデバイスのコネクタ
  • バッテリを介して電源利用可能
コントローラの主な機能:
  • 5段パイプラインのMIPSのM4K TMの32ビットコア
  • シングルサイクル自律複数の除算ユニット
  • 最大40%小さなコードサイズMIPS16eモード
  • ユーザーとカーネルモードでは、堅牢な組み込みシステムを有効にするには
  • 2つの32ビットコアは割り込み遅延を減らすためにファイルを登録する
  • 個別に複数の割り込みベクタのプログラマブル優​​先順位とサブの優先順位
  • 中古Flashからの実行を高速化するためにキャッシュモジュールを取得する
利用可能なソフトウェア: