I love the J-Link — it’s extremely fast, reliable, and works with basically everything. The J-Link EDU has been a big hit with students and hobbyists who just want to get stuff done (instead of messing with open-source debug adapters) — and at only $60, it’s a no-brainer.
While Segger tried to build a debug adapter that can be everything to everyone, they made some engineering decisions that are well-intentioned, yet somewhat annoying:
- No 3.3V output to power your target. Even though 99.9% of MCUs you hook up to this thing are going to run off 3.3V, the only voltage output Segger provides is a software-switchable 5V supply (that no vendor IDE allows you to easily enable).
- You must feed the IO voltage level back into VTref. This allows the fancy logic-level converters to operate at the proper voltage for your target — which 99.9% of the time is running off 3.3V.
If you have two wires and a soldering iron, this is easily remedied, though.
We’re going to pop off the high-side switch controlling the 5V supply, and repurpose that pin to carry 3.3V from the internal regulator. We’ll route this to the NC across from VTref so we can bridge it with a standard 0.1″ jumper. Here’s the game plan:
I tried this on my personal EDU version of the J-Link, but this should work great on other J-Link models (which mostly share identical hardware).
Start by prying open your J-Link by targeting the flexures on the side (don’t bother popping off the rubber feet or sticker on the bottom — there’s no screws under there).
Resist your urge to feel angry that you blew lots of money on a microcontroller and some 15-cent level shifters.
After you crack open the J-Link, you’ll notice a 3.3V regulator on the right (supplied from USB VBUS). You’ll notice a transistor in a high-side switch configuration in the top-left next to the screw.
Simply pop off that transistor (we don’t want to inadvertently back-feed the 3.3V regulator with 5V!), and solder a wire from the regulator to the connector:
Next, flip the board over, and connect pin 19 to pin 2:
Put it back together, install a jumper, and use your silliest-looking chicken-scratch handwriting to label your accomplishment:
Once it’s done, you won’t be needing that bench supply anymore — just wire up your debugger to your target and go!
Notes: You can always switch back to an arbitrary VTref by removing the jumper. I didn’t take the time to try to identify the 3.3V regulator, but given its SOT-23 package, I wouldn’t pull more than 100 mA from it without inspecting the package for overheating. If you have an older model with an 1117 regulator on it, you’re good to 800 mA. In any case, use your brain, and remember this hack offers no overload current protection, and if you were to accidentally back-feed this with something other than 3.3V, at best, you’d fry the regulator, and at worst, you’d fry the $3 MCU that turns your $300 debugger into a paperweight.
Happy JTAGing!
Hi Jay,
Thank you very much for this patch. It makes an interesting modification for people willing to modify their debug tool.
However, from a commercial/professional point of view, there is an authorized version to achieve this. The 5V is there for backwards compatibility. To get the 3.3V, there is an adapter:
https://www.segger.com/products/debug-probes/j-link/accessories/adapters/target-supply-adapter/
If you do not need the 3.3V, but do not want to feed the VTref, you can use the following:
https://www.segger.com/products/debug-probes/j-link/accessories/adapters/supply-adapter/
With the adapters the built-in protection of the J-Link remains active.
Best regards,
Dirk Akemann
Hi,
I’ve also have been searching for a solution to a similar external power issue, which motivated me to design my own board. It is in 4th revision now, and it’s (shameless plug) available for order at https://www.tindie.com/products/bitsmith/cortex-m-jtag-interface-extender/. More information is available on my blog at https://lubos.medovarsky.com/blog/doku.php?id=embedded:j-link_tagconnect_swd_adapter.
Hi,
my name is Marinko
thank you for your work.
can you describe more work of debugging with Renesas-Nec microcontrollers, especially Nec, of which there is very little quality material. ?
For Nec microcontrollers (D78Fxx) everyone says it is impossible to read the flash content because the debug software has no read.
Are there tools that have the option to read or download?
Thank you
Hey Jay! I like you blog – very helpful!
I have a little off-topic question: I want to use the J-Link EDU to flash a N76E003 (on Linux, Keil does not work). I have the J-Link installed and setup and it can communicate with the J-Link programmer. I try JLinkExe to connect using S) SWD and 4000 kHz but it responds with “No valid device has been selected.”. Did you by any chance use the J-Link to program the N76, too – do you remember the settings?
I did not connect the 5V on the J-Link because the N76 development board is labled with 3.3V. I do not think this is really necessary because I power the dev board with a sep. USB cable – otherwise I would mod my J-Link like yours.
Best,
Mark
The N76E003 is an 8051 MCU, not an ARM microcontroller. Do you mean one of Nuvoton’s ARM offerings? You’ll need a Nuvoton Nu-Link to debug the N76E003.
Great hack, thank you! This might be a stupid question, but why not just use the 3.3v line we pull to pin 2 and keep pin 19 at 5v? That way you’d have two different voltages. Right?
Sure, but I did it this way because I wanted jumper control of VTref (I don’t always want it connected to 3.3V), but I also wanted a second pin I could actually use to power my target. If I had a single 3.3V supply pin that would have to be shared between VTref and my target, I’d have to build a Y jumper cable, or have two separate power pins on my target, or other clunky stuff like that.
This reminds me of Dave Jones’ hack of the Atmel AVRISPMkII, where he added 2 slide-switches onto the top case; 1st switch to select either 5V or 3.3V (3.3V provided by a hacked-in linear reg), and the 2nd other switch to select whether to present 5/3.3 to the target connector, or not at all. For the J-Link, a 3rd switch to allow you to jumper the 5/3.3 outward supply to the VTref pin, or leave it as defined by the target’s design, would be the best of 3 worlds 🙂
My knock-off “H-link” which I got from huá qiáng běi (Shenzhen electronics market) powers my 3.3v targets like a charm! Surprisingly never run into any issues with Segger IDE compatibility. It cost me $10 USD.
Hi Jay,
Thanks a lot for this post. Do you think you would be able to update/append it for the new J-Link layout?
Thanks,
Nick
Thanks for the information. I am able me to reuse a JLINK_OB for other project after read this port. Great job!!
Hello,
Regarding your comment:
*Resist your urge to feel angry that you blew lots of money on a microcontroller and some 15-cent level shifters.*
I do get what you mean.
But when you consider the software support that comes with a SEGGER, the price makes sense from an industrial point of view.
Unlike their competitors, no extra licences need to be purchased. Nor do we need to pay them to develop the algorythm.
So when we splash out for the SEGGER hardware, we are paying for the expertise of the developers.