Difference between revisions of "OpenOCD"

From SEGGER Wiki
Jump to: navigation, search
Line 1: Line 1:
 
__TOC__
 
__TOC__
   
= Modes =
+
= About =
  +
OpenOCD is a open and free project to support different debug probes under one "API".
SEGGER RTT ([https://www.segger.com/products/debug-probes/j-link/technology/real-time-transfer/about-real-time-transfer/ SEGGER Real Time Transfer]) can run in different modes where some modes are not available on all devices but other modes are which then have an impact on the real time behavior of the device.
 
   
  +
= Using J-Link with OpenOCD =
== Background mode ==
 
  +
In general, it is possible to use J-Link with OpenOCD. OpenOCD handles J-Link as a dumb JTAG/SWD/... probe and only uses the very low level logic to output JTAG/SWD/... sequences. It does not make use of any high level logic etc. and therefore is much slower than the proprietary SEGGER J-Link DLL / GDBServer / ... implementation. In order to use J-Link with OpenOCD the standard J-Link USB driver must be replaced with the WinUSB driver, using 3rd party utilities. There are lots of walkthroughs available on the internet.
This is the mode which RTT was initially introduced with. In this mode, J-Link can access the memory of the target system while the MCU + application keeps running (background memory access), effectively not impacting the real time behavior of the application. In order to use this mode, the target MCU needs to support background memory accesses.
 
   
  +
'''Note:''' Once the J-Link USB driver has been replaced, no SEGGER software from the J-Link software package will be able to communicate with J-Link anymore. To use SEGGER J-Link software again, the USB driver needs to be switched back to its default.
=== Cores with background mode support ===
 
*Cortex-M based devices (all cores from the series)
 
*Renesas RX based devices (all cores from the series)
 
   
  +
== Limitations ==
=== Cores with optional background mode support ===
 
  +
There are several limitations that apply when using J-Link with OpenOCD instead of the SEGGER J-Link software:
* Cortex-A based devices (all cores from the series)
 
  +
* Much slower than using J-Link with the SEGGER J-Link DLL
* Cortex-R based devices (all cores from the series)
 
  +
* No RTT support
* RISC-V based devices ('''no core available so far that implements this feature''')
 
  +
* No HSS support
'''Cortex-A/R specific:''' It depends on the actual device if it supports background memory accesses because it is up to the device vendor if the necessary hardware unit is implemented or not. In addition to that, when using the background mode on Cortex-A/R based devices, some considerations need to be taken into account when it comes to caches etc. These are explained in [https://www.segger.com/downloads/application-notes/ AN08005]
 
  +
* No unlimited flash breakpoints support
  +
* No support for any utilities from the SEGGER J-Link software package
  +
* No support from SEGGER
   
== Stop mode ==
+
== Support ==
  +
Please understand that SEGGER does not provide any support for J-Links used with OpenOCD. The OpenOCD software is released and maintained by a 3rd party.
This mode has been introduced in J-Link software V6.30 in order to also allow using RTT on devices / CPU architectures that do not support background memory accesses. This mode affects the real time behavior of the application but can still be used for most target applications.
 
 
In this mode, J-Link temporarily halts the CPU (interrupts the execution of the target application) to access the memory and continues operation automatically after the memory access is done. The actual impact (halted time) on the real time behavior depends on the setup (target interface speed used, target interface used, length of JTAG chain, actual core that is used, ...).
 
 
=== Cores with stop mode support ===
 
* Cortex-A based devices
 
* Cortex-R based devices
 
* RISC-V based devices
 
 
'''Note:''' It is recommended to only use this mode with target interface speeds of '''25 MHz or higher''' (J-Link ULTRA+, J-Link PRO) to keep the effect on the real time behavior as small as possible. [https://www.segger.com/products/debug-probes/j-link/models/model-overview/ J-Link model overview]
 
 
=== Effect on real time behavior ===
 
 
Typical halted times for memory read accesses in stop mode with '''J-Link ULTRA+ @ 50 MHz''':
 
<gallery>
 
File:Wiki-RTT_StopMode_JTAG_50MHz_256B.png|JTAG @ 50 MHz<br>256 bytes, ~552us
 
File:Wiki-RTT_StopMode_JTAG_50MHz_1B.png|JTAG @ 50 MHz<br>4 bytes, ~418us
 
</gallery>
 
 
Typical halted times for memory read accesses in stop mode with '''J-Link PLUS @ 15 MHz''':
 
<gallery>
 
File:Wiki-RTT_StopMode_JTAG_15MHz_256B.png|JTAG @ 15 MHz<br>256 bytes, ~1.02ms
 
File:Wiki-RTT_StopMode_JTAG_15MHz_1B.png|JTAG @ 15 MHz<br>4 bytes, ~718us
 
</gallery>
 

Revision as of 11:43, 30 January 2018

About

OpenOCD is a open and free project to support different debug probes under one "API".

Using J-Link with OpenOCD

In general, it is possible to use J-Link with OpenOCD. OpenOCD handles J-Link as a dumb JTAG/SWD/... probe and only uses the very low level logic to output JTAG/SWD/... sequences. It does not make use of any high level logic etc. and therefore is much slower than the proprietary SEGGER J-Link DLL / GDBServer / ... implementation. In order to use J-Link with OpenOCD the standard J-Link USB driver must be replaced with the WinUSB driver, using 3rd party utilities. There are lots of walkthroughs available on the internet.

Note: Once the J-Link USB driver has been replaced, no SEGGER software from the J-Link software package will be able to communicate with J-Link anymore. To use SEGGER J-Link software again, the USB driver needs to be switched back to its default.

Limitations

There are several limitations that apply when using J-Link with OpenOCD instead of the SEGGER J-Link software:

  • Much slower than using J-Link with the SEGGER J-Link DLL
  • No RTT support
  • No HSS support
  • No unlimited flash breakpoints support
  • No support for any utilities from the SEGGER J-Link software package
  • No support from SEGGER

Support

Please understand that SEGGER does not provide any support for J-Links used with OpenOCD. The OpenOCD software is released and maintained by a 3rd party.