J-Link support in own applications
The J-Link SDK allows customers to integrate J-Link support into their own applications. This is used in professional IDEs like IAR EWARM or KEIL uVision to allow debugging directly via a J-Link, as well as in customized production utilities.
Typical applications to be used with J-Link are for example
- Complete debuggers or additional debugger utilities like data visualizers.
- Customized flash programming utilities to be used in the production.
- Automated test applications.
The J-Link SDK is available for Windows, Linux and macOS, as 32 bit and 64 bit versions and can be used with nearly every programming language/solution.
The integration of J-Link is done via a standard DLL / share library and provides easy to use C-language API functions. The SDK comes with startup projects for C (Visual C++ 6 and Visual Studio 2010), VB6 (Microsoft Visual Basic) and VB.NET (Visual Studio 2010).
The J-Link SDK allows using the entire functionality of J-Link, such as:
- The integrated flash programming capabilities, allowing high-speed flash programming of all supported devices without creating a custom flash-loader.
- Complete control of the target (Run, halt, reset, step, ...).
- Setting breakpoints and watchpoints, including setting Unlimited Flash Breakpoints.
- Using High-Speed Sampling, SEGGER Real-Time Terminal, SWO and Simple Trace directly in the application.
- Low-level communication with the target via JTAG commands.
Sample Projects and Test Applications
The J-Link SDK includes different sample applications in source code which demonstrate the usage of the J-Link API, show the basic startup sequence and provide examples how to integrate the J-Link DLL in different programming languages. The sample projects are organized by the executing target platform (Windows, Linux, Mac, Target) and the programming language / environment. The following table gives an overview about the included sample projects. The usage of the J-Link SDK is not limited to these programming environments, it can be used from nearly every programming language which allows loading shared libraries.
|Windows, Visual Studio 2010, C code||Visual Studio 2010 solution including sample projects for the J-Link DLL startup sequence and flash download via J-Link.|
|Windows, Visual C++ 6.0, C code||Visual C++ 6 workspace, including sample projects for the J-Link DLL startup sequence, flash download via J-Link, reading the target's JTAG ID, hardware testing, instruction tracing and the J-Link RTT Logger and J-Link Commander tool.|
|Windows, VB.NET||Visual Basic .NET Visual Studio 2010 project showing how to call J-Link DLL functions and demonstrating the startup sequence.|
|Windows, Mircosoft Visual Basic 6.0||Visual Basic 6.0 project for the J-Link DLL startup sequence and the usage or the J-Link SDK in a VB application.|
|Windows, LabView 2011||LabView 2011 project for the J-Link DLL startup sequence and the usage or the J-Link SDK in a LabView application.|
|Windows, Visual Studio 2010 C#||Visual Studio 2010 project for the J-Link DLL startup sequence and the usage or the J-Link SDK in a C# application.|
Using the Sample Applications
The sample projects are configured to be compiled and executed out-of-the-box and included as precompiled executable. They can be used to test the correct installation and proper function of the J-Link.
Sample C Code Applications
Sample Visual Basic and Visual Basic .NET Application
Requirements and Supported CPU Cores
- The J-Link SDK
- PC running Windows 2000 or later / Linux / macOS
- A J-Link
- Compiler or IDE of choice for the desired programming language
Supported CPU Cores
The J-Link SDK always supports all cores which are also supported by J-Link. New supported cores can be added by updating the J-Link DLL. For a complete list of supported CPU cores, please refer to here.
The J-Link SDK Package
The J-Link SDK comes with everything which is needed to start implementing J-Link support into software or create a new application using J-Link. It includes the needed libraries for the selected platform, a complete documentation of the available J-Link API and additional background information, the USB drivers for J-Link and sample startup projects to show the usage of J-Link. The J-Link SDK includes everything which is needed to integrate J-Link into an application. The table below lists the most important files which are included.
J-Link SDK Package Content
The J-Link SDK includes everything which is needed to integrate J-Link into an application. The table below lists the most important files which are included.
|JLinkARMDLL.h||Default J-Link DLL header file. Contains function declarations, defines and typedefs used in the DLL.|
Must be included to use the DLL functions.
|JLink.h||Fallback J-Link DLL header file. Like JLinkARMDLL.h, but with stdcall function declarations instead of C declaration. Must be used for applications which cannot use C declaration functions.|
|JLink.lib||J-Link import library to load the J-Link DLL functions. Searches for J-Link DLL in installed J-Link software if the DLL is not in executable directory.|
|JLinkARM.lib||J-Link import library to load the J-Link DLL functions. Searches for J-Link DLL in executable directory only. Should not be used when updating the DLL shall be possible.|
|JLinkARM.dll||The J-Link DLL itself to be copied into the application's executable directory.|
|UM08002_JLinkDLL.pdf||J-Link SDK documentation.|
|Release.html||J-Link SDK release notes.|
J-Link SDK Licensing
The J-Link SDK license allows using custom applications within the customer's company only. Authorization to distribute and ship software which uses the J-Link SDK or parts of it can be permitted by SEGGER upon request.
For more information on how to obtain a J-Link SDK license please contact infosegger.com.
How do I program the internal flash memory of my device?
A: 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, simply select the appropriate device and perform memory writes. With this functionality you do not have to care about whether you are writing to or reading from RAM or flash.
How do I program external CFI compliant NOR flash connected to my device?
A: Direct download into external parallel NOR flash is supported, too. Prior to programming the NOR flash, you will have to make sure the flash interface is configured on the device and tell J-Link some info about the flash. After this the NOR flash can be handled the same way as internal flash.
I want to program or read other external flashes. Is this possible?
A: In general, yes. Although other, non-memory mapped flashes, like NAND flash, SPI NOR flash, EEPROM, etc., cannot be handled directly via the flash download capability of J-Link, it is possible to control the flash memory by writing and reading its memory controller registers on the target. With J-Link it is possible to read and write memory mapped registers, too. There are NAND dumping utilities available from SEGGER for J-Link SDK customers upon request. One NAND dumping utility as executable is provided free of charge for SDK customers.
I purchased J-Link SDK Vx.xx. Can my application be used with a newer version of the DLL?
A: Yes. The J-Link DLL is downward compatible and allows usage of applications with newer DLLs. When the JLink.lib import library is used and no JLinkARM.dll is in the application's directory the newest installed version if the J-Link DLL will be used automatically. When the JLinkARM.lib import library is used, the JLinkARM.dll in the application's directory has to be replaced in order to use a newer version. Updating the DLL may even be done after the J-Link DLL update period expired.
I want to create an application with an IDE or programming language which is not listed above. Can I use the J-Link SDK?
A: In general, yes. The J-Link SDK can be used with every programming language or solution which allows importing functions from DLLs / shared libraries. In some cases a wrapper library might be needed to import the C functions. In case of doubt, please contact us at infosegger.com.
We purchased one J-Link SDK license. Are we allowed to use our application at different production places?
A: Yes. The J-Link SDK license allows company-wide usage of the J-Link SDK package and the applications using it.
Are we allowed to distribute or sell our application using J-Link to our customers and make it publicly available?
A: Distributing parts of the J-Link SDK or software which uses parts of it requires prior authorization. Please contact us at infosegger.com.