J-Link OB

From SEGGER Wiki
Revision as of 10:19, 26 March 2019 by Alex (talk | contribs)
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

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