J-Link OB

From SEGGER Wiki
Revision as of 09:22, 26 March 2019 by Alex (talk | contribs) (J-Link-OB SAM3U)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

J-Link OB is a single chip microcontroller "on-board" version of J-Link. It is designed to be a low-cost, single chip, on-board debug solution for evaluation boards. There are various J-Link-OB implementations available, which are based on different devices. For more information about what J-Link-OB implementations are available in general, please refer to https://www.segger.com/jlink-ob.html

J-Link OB SAM3U NordicSemi

VCOM functionality

This J-Link model supports VCOM.

Supported baudrates

This J-Link OB supports max. 1 MBaud. The internal divider is calculated as follows:

 Baudrate = 96000000 / Div * 16;
 Div = 96000000 / (Baudrate * 16);

Note: The real baudrate and the selected one should not deviate more than 3% to guarantee proper communication on VCOM.

Pin driving policy

The following pins are available on this OB:

  • OB_Tx (driven by J-Link OB)
  • OB_Rx (driven by target)
  • CTS (driven by target. LOW == Target ready to receive data)
  • RTS (driven by J-Link OB. LOW == J-Link OB ready to receive data)

J-Link OB starts driving its VCOM output pins as soon as it receives a "set baudrate" command. This command is send by the PC as soon as a COM port is opened. Unfortunately, there is no specific command / packet etc. send by the PC in case a COM port is opened. Therefore the "set baudrate" approach is the only one to detect COM port activity.

J-Link OB stops driving the RTS pin if J-Link OB detects that hardware flow control is not used on the target side.

Hardware flow control support

Hardware flow control is supported by this J-Link OB. By default, J-Link detects at runtime if the target uses flow control or not. This is done as follows:

  • If CTS is detected as HIGH (Target not ready) before the first character is sent by J-Link OB, the pin is assumed to be not used by the target and flow control on the J-Link side gets disabled (CTS is ignored from now on, J-Link stops driving RTS)

Force or disable hardware flow control

It is possible to configure J-Link OB to bypass the hardware flow control auto-detection in the firmware and assume that hardware flow control is always or never used. This can be done via J-Link Commander and the following command:

 SetHWFC Enable/Disable/Force

Note: This setting gets active immediately and survives a power-cycle of J-Link.

  • Enable: Default. Enables hardware flow control and runtime auto-detection
  • Disable: Disables hardware flow control (never used)
  • Force: Enables hardware flow control and bypasses runtime auto-detection (RTS is kept driven and CTS is kept sampling)
Force hardware flow control
Minimum requirements

J-Link-OB SAM3U

The J-Link-OB-SAM3U is a J-Link-OB based on the Microchip SAM3U series device.

Limitations under Mac OS X

Problem description

There are different implementations of the J-Link-OB-SAM3U on various eval boards. The following only applies to implementations which incorporate VCOM support as well as MSD drag & drop programming support.

By hardware design, the Atmel SAM3U device implements 6 USB endpoints (EPs) that can be used. The following EPs are used by the J-Link firmware:

  • J-Link component: 2 EPs
  • VCOM: 2 EPs
  • MSD: 2 EPs

Unfortunately, only 4 of the 6 EPs support USB packet sizes of up to 512 bytes. The EPs used for VCOM are the ones that do not support 512 byte packet sizes but only 64 bytes. As the J-Link-OB-SAM3U enumerates as a USB Hi-Speed device, by USB spec. all endpoints need to support packets sizes up to 512 bytes. This cannot be fulfilled on the SAM3U when using all 3 components.

While this is no problem under Windows and Linux, it is a problem under Mac OS X. OS X will not send packages on the VCOM port that are bigger than 64 bytes in size. Such packages are "swallowed" silently and only a message is output in the syslog of OS X. No errors etc. are returned on the system API level. From the J-Link firmware side it is always made sure that no packets bigger than 64 bytes are sent on the VCOM port. If necessary, J-Link splits a transaction into multiple packets.

Affected Evaluation Boards

The following evaluation boards are for example affected by this limitation:

  • NordicSemi nRF51-DK
  • NordicSemi nRF52-DK

Workaround 1

If both are needed the MSD and VCOM component, please make sure that no packets bigger than 64 bytes are sent on the VCOM port, by your application.

Workaround 2

If MSD and VCOM are not needed at the same time, it is possible to disable the MSD component on the J-Link, freeing 2 EPs so that these ones can be used for VCOM to support 512 byte packets. In order to disable the MSD component, please do the following:

  • Connect the J-Link-OB to your PC
  • Start J-Link Commander
  • execute the following command (without quotes): "MSDDisable"
  • Quit J-Link Commander
  • Power-cycle J-Link-OB

To re-enable the MSD component, please perform the same procedure as above but use the "MSDEnable" command instead.

J-Link-OB-RX621-ARM-SWD

The J-Link-OB-RX621-ARM-SWD is a J-Link-OB based on the Renesas RX621 series devices which is capable of debugging ARM based target devices like the Renesas Synergy series devices.

Enumeration under Ubuntu running in VirtualBox fails

Problem Description

Under special circumstances and with a special setup, it could happen with older bootloader versions of the J-Link-OB-RX621-ARM-SWD, that enumerating via USB in a Ubuntu environment running in VirtualBox failed and J-Link was not detected properly under Ubuntu. SEGGER has reproduced the issue with the following setup but it may also occur under other constellations as well:

  • Host OS: Win7 64-bit
  • VirtualBox: Version 5.0.18
  • VirtualBox guest OS: Ubuntu 14.04 LTS

The problem only occurred if the J-Link was enumerating directly inside the VirtualBox guest OS. If it initially enumerated under the host OS and was connected to the VirtualBox guest OS later on, it worked fine.

Affected Evaluation Boards

This J-Link-OB model for example is used on the Renesas Synergy development kits.

Replacing the Bootloader (Fix)

As the fix requires to replace the bootloader of the J-Link OB, which can result (even if very unlikely) in a unusable J-Link-OB, the fix for this is not automatically applied when a new version of the J-Link software is installed. In the following it is described how to replace the bootloader of the J-Link-OB.

The following should only be done if you are affected by this problem. Please make sure that power supply to the J-Link-OB is stable. Unstable power supply during bootloader replacement can result in an unusable J-Link-OB.

Download and install the latest J-Link software:

Start J-Link Commander and perform firmware update if asked for

Execute updatebtl command

SEGGER J-Link Commander V5.41b (Compiled May  3 2016 13:50:50)
DLL version V5.41b, compiled May  3 2016 13:50:27

Connecting to J-Link via USB...O.K.
Firmware: J-Link OB RX621-ARM-SWD V1 compiled May  3 2016 12:18:23
Hardware version: V2.10
S/N: 708000000
VTref = 3.300V


Type "connect" to establish a target connection, '?' for help
J-Link>updatebtl
O.K.
J-Link>