05022024

Last update2016/05/28 14:38

Back 現在地: Home パートナー segger-tools J-Link Flash Download

J-Link Flash Download

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.