Segger J-Link Support

Hi,

I’m using the Mbed Studio IDE to develop some code for my FRDM-K64F board. The debugger built into that board is fine for now. Once I build my own boards for my design, they’ll lack the embedded debugger hardware and I’ll need to use something like a Segger J-Link to program and debug my code.

Is there a plan to support the Segger J-Link from within the Mbed Studio IDE?

If not, is there an alternative standalone programmer / debugger I can use to debug my software once I transition to my own board design?

Thanks.

Hi Glen,

Apologies for the late reply on this. We are introducing support for custom boards in our 1.0 release and have mainly been using an external STLink for testing. However, Mbed Studio currently uses pyOCD under the hood, and Segger J-Link is listed as “experimental”: GitHub - pyocd/pyOCD: Open source Python library for programming and debugging Arm Cortex-M microcontrollers

For moving to your custom board, we have a couple of options: export to an IDE like Keil MDK and use that (J-link is supported), or use the Mbed command line tools, which we do ship with Mbed Studio (you’ll need to manually set up a debugger etc for this).

We are also carrying out some research at the moment to understand how we can support custom board development more seamlessly, so if you are happy to provide some insight, please get in touch with us at mbed-ux@arm.com.

Thanks,
Joe

2 Likes

Hi,
i am using SEGGER J-Link for flashing our boards.

  1. In mbed_app.json add

{
“target_overrides”: {
“*”: {
“target.OUTPUT_EXT”: “hex”
}
}
}

  1. Create a file jlflash.jlink with this content

device STM32L476VG
si 1
speed 4000
loadfile BUILD/main/app_main.hex 0
r
g
exit

  1. Flash the hex with this command

JLinkExe jlflash.jlink

2 Likes

Thanks for the replies, everybody! I’ll check out the command line tools. I’ve also found a few open source projects to build low-cost USB CMSIS-DAP debuggers that connect to the target using the 10-pin SWD interface that I plan on checking out.

I use JLink and Ozone.

Accono has an inexpensive programmer with tag-connect. I haven’t tried it yet. But, I thought it might work for you.
https://aconno.de/products/aconno-acnprog/

1 Like

Hi @bikerglen, @schef, @lonesometraveler,

A new version of Mbed Studio has just been released today. We added support in it for custom boards connected using external probes. You can find more information about it here: Custom targets - Supported and custom targets | Mbed Studio Documentation

Thanks,
Arek - Mbed Studio team

1 Like

Thanks, Alex. I’ll try to install it tonight and take a look at it.

Hi,

I’d also love to hook my J-Link up to Mbed Studio. I’ve noticed that the new custom board feature seems to recognize the J-Link driver, but if I try to use the run or debug functions, it produces a PyOCD deploy failed error. Anything special I need to do? I’m targeting a MK64F.

Have you tried your J-Link with pyOCD directly? According to this: pyOCD/jlink_probe.py at main · pyocd/pyOCD · GitHub it should be supported, but to be open with you, our team doesn’t have access to any J-Link probes at the moment since we’re all WFH.

Hi @JoeA

I’m able to flash and use the commander from the pyOCD command line interface. Any info I can give you to help?

Has there been any updates on supporting J-Links in MBED studio?

Greetings,

I’m trying to use the JLink-Edu Mini with the nrf52832 and I get the following error when running pyocd in Mbed Studio Terminal window.

0001188:INFO:board:Target type is nrf52
0001538:INFO:dap:DP IDR = 0x2ba01477 (v1 rev2)
0001580:CRITICAL:main:uncaught exception: ‘JLinkProbe’ object has no attribute ‘_lock’

I have pyocd version 0.27.0 along with Python 3.7.1

Any help would be really appreciated.

Sincerely,

Julien